Versions in this module Expand all Collapse all v3 v3.6.2 Feb 8, 2023 v3.6.1 Nov 15, 2022 Changes in this version + const ED25519 + const ED25519Prefix + const PubKeyBytesLenCompressed + const PubKeyBytesLenUncompressed + const SWAPOUTLOG + const SWAPOUTNATIVELOG + const TRANSFERLOG + const TRANSFERV4LOG + var EmptyArgs = "e30=" + var GetFtBalance = "ft_balance_of" + var GetFtMetadata = "ft_metadata" + func BroadcastTxCommit(url string, signedTx []byte) (string, error) + func CheckBalance(url, account, amount string) error + func CheckTokenBalance(url, token, account, amount string) error + func GenerateKey() (seed, pub []byte, err error) + func GeneratePubKeyByBase58(b58Key string) ([]byte, error) + func GeneratePubKeyBySeed(seed []byte) ([]byte, error) + func GetAccountNonce(url, account, publicKey string) (uint64, error) + func GetBlockNumberByHash(url, hash string) (uint64, error) + func GetLatestBlockHash(url string) (string, error) + func GetLatestBlockNumber(url string) (uint64, error) + func GetStubChainID(network string) *big.Int + func SetRPCTimeout(timeout int) + func StringToPrivateKey(priv string) (*ed25519.PrivateKey, error) + func SupportsChainID(chainID *big.Int) bool + type AccessKey struct + Nonce uint64 + Permission AccessKeyPermission + type AccessKeyPermission struct + Enum borsh.Enum + FullAccess borsh.Enum + FunctionCall FunctionCallPermission + type Action struct + AddKey AddKey + CreateAccount borsh.Enum + DeleteAccount DeleteAccount + DeleteKey DeleteKey + DeployContract DeployContract + Enum borsh.Enum + FunctionCall FunctionCall + Stake Stake + Transfer Transfer + type AddKey struct + AccessKey AccessKey + PublicKey PublicKey + type BlockDetail struct + Header BlockHeader + type BlockHeader struct + Hash string + Height uint64 + type Bridge struct + func NewCrossChainBridge() *Bridge + func (b *Bridge) BroadcastTxCommit(signedTx []byte) (result string, err error) + func (b *Bridge) BuildRawTransaction(args *tokens.BuildTxArgs) (rawTx interface{}, err error) + func (b *Bridge) CheckBalance(address, amount string) error + func (b *Bridge) CheckTokenBalance(token, amount string) error + func (b *Bridge) CreateFunctionCall(txHash, multichainToken, to, amount, fromChainID string, logIndex int, ...) (string, []Action, error) + func (b *Bridge) GetAccountNonce(account, publicKey string) (uint64, error) + func (b *Bridge) GetBlockNumberByHash(blockHash string) (uint64, error) + func (b *Bridge) GetLatestBlockHash() (string, error) + func (b *Bridge) GetLatestBlockNumber() (uint64, error) + func (b *Bridge) GetLatestBlockNumberOf(apiAddress string) (uint64, error) + func (b *Bridge) GetPoolNonce(address, _height string) (uint64, error) + func (b *Bridge) GetSeq(args *tokens.BuildTxArgs) (nonceptr *uint64, err error) + func (b *Bridge) GetTokenDecimals(tokenAddr string) (uint8, error) + func (b *Bridge) GetTransaction(txHash string) (tx interface{}, err error) + func (b *Bridge) GetTransactionByHash(txHash string) (result *TransactionResult, err error) + func (b *Bridge) GetTransactionStatus(txHash string) (status *tokens.TxStatus, err error) + func (b *Bridge) GetTxBlockInfo(txHash string) (blockHeight, blockTime uint64) + func (b *Bridge) InitAfterConfig() + func (b *Bridge) InitRouterInfo(routerContract string) (err error) + func (b *Bridge) IsValidAddress(address string) bool + func (b *Bridge) MPCSignTransaction(rawTx interface{}, args *tokens.BuildTxArgs) (signedTx interface{}, txHash string, err error) + func (b *Bridge) PublicKeyToAddress(pubKeyHex string) (string, error) + func (b *Bridge) RegisterSwap(txHash string, args *tokens.RegisterArgs) ([]*tokens.SwapTxInfo, []error) + func (b *Bridge) SendTransaction(signedTx interface{}) (txHash string, err error) + func (b *Bridge) SetTokenConfig(tokenAddr string, tokenCfg *tokens.TokenConfig) + func (b *Bridge) SignTransactionWithPrivateKey(rawTx interface{}, privKey string) (signedTx interface{}, txHash string, err error) + func (b *Bridge) VerifyMsgHash(rawTx interface{}, msgHashes []string) (err error) + func (b *Bridge) VerifyPubKey(address, pubkey string) error + func (b *Bridge) VerifyTokenConfig(tokenCfg *tokens.TokenConfig) error + func (b *Bridge) VerifyTransaction(txHash string, args *tokens.VerifyArgs) (*tokens.SwapTxInfo, error) + type CreateAccount struct + NewAccountId string + NewPublicKey string + type DeleteAccount struct + BeneficiaryID string + type DeleteKey struct + PublicKey PublicKey + type DeployContract struct + Code []byte + type EcdsaPublic struct + func (k *EcdsaPublic) Private(sequence *uint32) []byte + func (k *EcdsaPublic) Public(sequence *uint32) []byte + type FtSwapIn struct + Amount string + FromChainId string + ReceiverId string + TxHash string + type FtTransfer struct + Amount string + Memo string + ReceiverId string + type FunctionCall struct + Args []byte + Deposit big.Int + Gas uint64 + MethodName string + type FunctionCallPermission struct + Allowance *big.Int + MethodNames []string + ReceiverID string + type FunctionCallResult struct + BlockHash string + BlockHeight uint64 + Error string + Logs []string + Result []byte + type FungibleTokenMetadata struct + Decimals uint8 + Icon string + Name string + Reference string + ReferenceHash string + Spec string + Symbol string + type Nep141V4TransferEvent struct + Data []Nep141V4TransferMemo + Event string + Standard string + Version string + type Nep141V4TransferMemo struct + Amount string + Memo string + NewOwnerId string + OldOwnerId string + type Outcome struct + ExecutorID string + GasBurnt int64 + Logs []string + ReceiptIds []string + Status Status + TokensBurnt string + type Proof struct + Direction string + Hash string + type PublicKey struct + Data [32]byte + KeyType uint8 + func PublicKeyFromBytes(pubKeyBytes []byte) (*PublicKey, error) + func PublicKeyFromEd25519(pk ed25519.PublicKey) *PublicKey + func PublicKeyFromHexString(pubKeyHex string) (*PublicKey, error) + func PublicKeyFromString(pub string) (*PublicKey, error) + func (pk *PublicKey) Address() string + func (pk *PublicKey) Bytes() []byte + func (pk *PublicKey) String() string + type RawTransaction struct + Actions []Action + BlockHash [32]byte + Nonce uint64 + PublicKey PublicKey + ReceiverID string + SignerID string + func CreateTransaction(signerID string, publicKey *PublicKey, receiverID string, nonce uint64, ...) *RawTransaction + type ReceiptsOutcome struct + BlockHash string + ID string + Outcome Outcome + Proof []Proof + type Signature struct + Data [64]byte + KeyType uint8 + type SignedTransaction struct + Signature Signature + Transaction RawTransaction + type Stake struct + PublicKey PublicKey + Stake big.Int + type Status struct + Failure interface{} + SuccessReceiptID interface{} + SuccessValue interface{} + Unknown interface{} + type Transaction struct + Hash string + Nonce uint64 + PublicKey string + ReceiverID string + Signature string + SignerID string + type TransactionOutcome struct + BlockHash string + ID string + Outcome Outcome + Proof []Proof + type TransactionResult struct + ReceiptsOutcome []ReceiptsOutcome + Status Status + Transaction Transaction + TransactionOutcome TransactionOutcome + func GetTransactionByHash(url, txHash, senderID string) (*TransactionResult, error) + type Transfer struct + Deposit big.Int