2023-02-20 10:56:30 +01:00
|
|
|
package custodial
|
|
|
|
|
|
|
|
import (
|
2023-03-06 09:18:41 +01:00
|
|
|
"crypto/ecdsa"
|
|
|
|
"math/big"
|
|
|
|
"time"
|
|
|
|
|
2023-02-20 10:56:30 +01:00
|
|
|
"github.com/bsm/redislock"
|
2023-03-06 09:18:41 +01:00
|
|
|
"github.com/celo-org/celo-blockchain/common"
|
2023-02-20 10:56:30 +01:00
|
|
|
"github.com/grassrootseconomics/celoutils"
|
|
|
|
"github.com/grassrootseconomics/cic-custodial/internal/keystore"
|
|
|
|
"github.com/grassrootseconomics/cic-custodial/internal/nonce"
|
2023-03-06 09:18:41 +01:00
|
|
|
"github.com/grassrootseconomics/cic-custodial/internal/pub"
|
2023-02-20 10:56:30 +01:00
|
|
|
"github.com/grassrootseconomics/cic-custodial/internal/store"
|
|
|
|
"github.com/grassrootseconomics/cic-custodial/internal/tasker"
|
2023-03-06 09:18:41 +01:00
|
|
|
"github.com/grassrootseconomics/w3-celo-patch"
|
2023-03-14 16:40:50 +01:00
|
|
|
"github.com/redis/go-redis/v9"
|
2023-02-20 10:56:30 +01:00
|
|
|
)
|
|
|
|
|
2023-03-06 09:18:41 +01:00
|
|
|
type (
|
|
|
|
SystemContainer struct {
|
|
|
|
Abis map[string]*w3.Func
|
|
|
|
AccountIndexContract common.Address
|
|
|
|
GasFaucetContract common.Address
|
|
|
|
GasRefillThreshold *big.Int
|
|
|
|
GasRefillValue *big.Int
|
|
|
|
GiftableGasValue *big.Int
|
|
|
|
GiftableToken common.Address
|
|
|
|
GiftableTokenValue *big.Int
|
|
|
|
LockTimeout time.Duration
|
|
|
|
PrivateKey *ecdsa.PrivateKey
|
|
|
|
PublicKey string
|
|
|
|
TokenDecimals int
|
|
|
|
TokenTransferGasLimit uint64
|
|
|
|
}
|
|
|
|
Custodial struct {
|
|
|
|
CeloProvider *celoutils.Provider
|
|
|
|
Keystore keystore.Keystore
|
|
|
|
LockProvider *redislock.Client
|
|
|
|
Noncestore nonce.Noncestore
|
|
|
|
PgStore store.Store
|
|
|
|
Pub *pub.Pub
|
2023-03-08 07:49:09 +01:00
|
|
|
RedisClient *redis.Client
|
2023-03-06 09:18:41 +01:00
|
|
|
SystemContainer *SystemContainer
|
|
|
|
TaskerClient *tasker.TaskerClient
|
|
|
|
}
|
|
|
|
)
|