Documentation ¶
Index ¶
- Constants
- func BuildChainAssetId(base, asset string) string
- func BuildGnosisSafe(ctx context.Context, rpc, holder, signer, observer, rid string, ...) (*GnosisSafe, *SafeTransaction, error)
- func CheckFinalization(num uint64, chain byte) bool
- func CheckSafeAccountDeployed(rpc, address string) (bool, bool, error)
- func CheckTransactionPartiallySignedBy(raw, public string) bool
- func DeploySafeAccount(ctx context.Context, rpc, key string, chainId int64, owners []string, ...) error
- func FetchBalanceFromKey(ctx context.Context, rpc, key string) (*big.Int, error)
- func GenerateAssetId(chain byte, assetKey string) string
- func GetEvmChainID(chain int64) int64
- func GetMixinChainID(chain int64) string
- func GetOrDeploySafeAccount(ctx context.Context, rpc, key string, chainId int64, owners []string, ...) (*common.Address, error)
- func GetSafeAccountAddress(owners []string, threshold int64) common.Address
- func GetSafeAccountGuard(rpc, address string) (string, error)
- func GetSafeLastTxTime(rpc, address string) (time.Time, error)
- func GetSortedSafeOwners(holder, signer, observer string) ([]string, []string)
- func HashMessageForSignature(msg string) []byte
- func NormalizeAddress(addr string) string
- func ParseAmount(amount string, decimals int32) *big.Int
- func ParseEthereumCompressedPublicKey(public string) (*common.Address, error)
- func PrivToAddress(priv string) (*common.Address, error)
- func ProcessSignature(signature []byte) []byte
- func RPCGetAssetBalanceAtBlock(rpc, address, asset string, blockNumber uint64) (*big.Int, error)
- func RPCGetBlockHash(rpc string, height int64) (string, error)
- func RPCGetBlockHeight(rpc string) (int64, error)
- func RPCGetGasPrice(rpc string) (*big.Int, error)
- func SignerInit(ctx context.Context, conn *ethclient.Client, key string, evmChainId int64) *bind.TransactOpts
- func UnitAmount(amount *big.Int, decimals int32) string
- func VerifyAssetKey(assetKey string) error
- func VerifyDeposit(ctx context.Context, chain byte, ...) (*Transfer, *RPCTransaction, error)
- func VerifyHashSignature(public string, hash, sig []byte) error
- func VerifyHolderKey(public string) error
- func VerifyMessageSignature(public string, msg, sig []byte) error
- type Asset
- type GnosisSafe
- type Output
- type RPCBlock
- type RPCBlockCallTrace
- type RPCBlockWithTransactions
- type RPCTransaction
- type RPCTransactionCallTrace
- type SafeTransaction
- func CreateEnableGuardTransaction(ctx context.Context, chainID int64, id, safeAddress, observerAddress string, ...) (*SafeTransaction, error)
- func CreateMultiSendTransaction(ctx context.Context, chainID int64, id, safeAddress string, outputs []*Output, ...) (*SafeTransaction, error)
- func CreateTransaction(ctx context.Context, typ int, chainID int64, ...) (*SafeTransaction, error)
- func CreateTransactionFromOutputs(ctx context.Context, typ int, chainId int64, id, safeAddress string, ...) (*SafeTransaction, error)
- func UnmarshalSafeTransaction(b []byte) (*SafeTransaction, error)
- func (tx *SafeTransaction) ExecTransaction(ctx context.Context, rpc, key string) (string, error)
- func (tx *SafeTransaction) ExtractOutputs() []*Output
- func (tx *SafeTransaction) GetTransactionHash() []byte
- func (tx *SafeTransaction) Hash(id string) string
- func (tx *SafeTransaction) Marshal() []byte
- func (tx *SafeTransaction) ValidTransaction(rpc string) (bool, error)
- type Transfer
- func GetERC20TransferLogFromBlock(ctx context.Context, rpc string, chain, height int64) ([]*Transfer, error)
- func LoopBlockTraces(chain byte, chainId string, traces []*RPCBlockCallTrace, ...) []*Transfer
- func LoopCalls(chain byte, chainId, hash string, trace *RPCTransactionCallTrace, index int64) ([]*Transfer, int64)
Constants ¶
View Source
const ( ChainEthereum = 2 ChainPolygon = 6 ValuePrecision = 18 ValueDust = 100000000000000 MinimumBalance = "0.05" TimeLockMinimum = time.Hour * 1 TimeLockMaximum = time.Hour * 24 * 365 TypeETHTx = 1 TypeERC20Tx = 2 TypeMultiSendTx = 3 EthereumEmptyAddress = "0x0000000000000000000000000000000000000000" EthereumSafeProxyFactoryAddress = "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67" EthereumSafeL2Address = "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762" EthereumCompatibilityFallbackHandlerAddress = "0xfd0732Dc9E303f09fCEf3a7388Ad10A83459Ec99" EthereumMultiSendAddress = "0x38869bf66a61cF6bDB996A6aE40D5853Fd43B526" EthereumSafeGuardAddress = "0xA8Dfb37ba1f98171eDE39Ac5C48eCb5BF23F78a4" )
Variables ¶
This section is empty.
Functions ¶
func BuildChainAssetId ¶
func BuildGnosisSafe ¶
func BuildGnosisSafe(ctx context.Context, rpc, holder, signer, observer, rid string, lock time.Duration, chain byte) (*GnosisSafe, *SafeTransaction, error)
func CheckFinalization ¶
func DeploySafeAccount ¶
func FetchBalanceFromKey ¶ added in v0.12.1
func GenerateAssetId ¶
func GetEvmChainID ¶
func GetMixinChainID ¶
func GetOrDeploySafeAccount ¶
func GetSafeAccountAddress ¶
func GetSafeAccountGuard ¶ added in v0.13.0
func GetSortedSafeOwners ¶
func HashMessageForSignature ¶
func NormalizeAddress ¶
func ProcessSignature ¶
func RPCGetAssetBalanceAtBlock ¶ added in v0.13.0
func RPCGetBlockHeight ¶
func SignerInit ¶ added in v0.13.5
func VerifyAssetKey ¶
func VerifyDeposit ¶
func VerifyHashSignature ¶
func VerifyHolderKey ¶
func VerifyMessageSignature ¶
Types ¶
type GnosisSafe ¶
func UnmarshalGnosisSafe ¶
func UnmarshalGnosisSafe(extra []byte) (*GnosisSafe, error)
func (*GnosisSafe) Marshal ¶
func (gs *GnosisSafe) Marshal() []byte
type RPCBlock ¶
type RPCBlock struct { Hash string `json:"hash"` Number string `json:"number"` Tx []string `json:"transactions"` Timestamp string `json:"timestamp"` Height uint64 Time time.Time }
func RPCGetBlock ¶
type RPCBlockCallTrace ¶
type RPCBlockCallTrace struct {
Result *RPCTransactionCallTrace `json:"result"`
}
func RPCDebugTraceBlockByNumber ¶
func RPCDebugTraceBlockByNumber(rpc string, height int64) ([]*RPCBlockCallTrace, error)
type RPCBlockWithTransactions ¶
type RPCBlockWithTransactions struct { Hash string `json:"hash"` Number string `json:"number"` Tx []*RPCTransaction `json:"transactions"` Height uint64 }
func RPCGetBlockWithTransactions ¶
func RPCGetBlockWithTransactions(rpc string, height int64) (*RPCBlockWithTransactions, error)
type RPCTransaction ¶
type RPCTransaction struct { BlockHash string `json:"blockHash"` BlockNumber string `json:"blockNumber"` ChainID string `json:"chainId"` From string `json:"from"` Gas string `json:"gas"` GasPrice string `json:"gasPrice"` Hash string `json:"hash"` Input string `json:"input"` Nonce string `json:"Nonce"` To string `json:"to"` TransactionIndex string `json:"transactionIndex"` Type string `json:"type"` Value string `json:"value"` BlockHeight uint64 }
func RPCGetTransactionByHash ¶
func RPCGetTransactionByHash(rpc, hash string) (*RPCTransaction, error)
type RPCTransactionCallTrace ¶
type RPCTransactionCallTrace struct { Calls []*RPCTransactionCallTrace `json:"calls"` Error string `json:"error"` From string `json:"from"` Gas string `json:"gas"` GasUsed string `json:"gasUsed"` Input string `json:"input"` Output string `json:"output"` To string `json:"to"` Type string `json:"type"` Value string `json:"value"` }
func RPCDebugTraceTransactionByHash ¶
func RPCDebugTraceTransactionByHash(rpc, hash string) (*RPCTransactionCallTrace, error)
type SafeTransaction ¶
type SafeTransaction struct { TxHash string ChainID int64 SafeAddress string Destination common.Address Value *big.Int Data []byte Operation uint8 SafeTxGas *big.Int BaseGas *big.Int GasPrice *big.Int GasToken common.Address RefundReceiver common.Address Nonce *big.Int Message []byte Signatures [][]byte }
func CreateTransaction ¶
func UnmarshalSafeTransaction ¶
func UnmarshalSafeTransaction(b []byte) (*SafeTransaction, error)
func (*SafeTransaction) ExecTransaction ¶
func (*SafeTransaction) ExtractOutputs ¶
func (tx *SafeTransaction) ExtractOutputs() []*Output
func (*SafeTransaction) GetTransactionHash ¶
func (tx *SafeTransaction) GetTransactionHash() []byte
func (*SafeTransaction) Hash ¶
func (tx *SafeTransaction) Hash(id string) string
func (*SafeTransaction) Marshal ¶
func (tx *SafeTransaction) Marshal() []byte
func (*SafeTransaction) ValidTransaction ¶
func (tx *SafeTransaction) ValidTransaction(rpc string) (bool, error)
type Transfer ¶
type Transfer struct { Hash string Index int64 TokenAddress string AssetId string Sender string Receiver string Value *big.Int }
func LoopBlockTraces ¶
func LoopBlockTraces(chain byte, chainId string, traces []*RPCBlockCallTrace, blockTxs []*RPCTransaction) []*Transfer
TODO cross-chain deposits might be lost, which are sended from emtpy address and not included in the block traces in polygon pos
Click to show internal directories.
Click to hide internal directories.