Documentation
¶
Index ¶
- Constants
- func BalanceOf(client *Client, publicKey []byte) (*big.Int, error)
- func BatchSubmit(client *Client, calls []types.Call) error
- func InitializeChain(client *Client, relayers []types.AccountID, chains []msg.ChainId, ...) error
- func QueryConst(client *Client, prefix, name string, res interface{}) error
- func QueryStorage(client *Client, prefix, method string, arg1, arg2 []byte, result interface{}) (bool, error)
- func SubmitSudoTx(client *Client, method Method, args ...interface{}) error
- func SubmitTx(client *Client, method Method, args ...interface{}) error
- type AssetId
- type Client
- func (c *Client) AddRelayer(relayer types.AccountID) error
- func (c *Client) GetDepositNonce(chain msg.ChainId) (uint64, error)
- func (c *Client) InitiateHashTransfer(hash types.Hash, destId msg.ChainId) error
- func (c *Client) InitiateNativeTransfer(amount types.U128, recipient []byte, destId msg.ChainId) error
- func (c *Client) InitiateNonFungibleTransfer(tokenId types.U256, recipient []byte, destId msg.ChainId) error
- func (c *Client) LatestBlock() (uint64, error)
- func (c *Client) MintErc721(tokenId *big.Int, metadata []byte, recipient *signature.KeyringPair) error
- func (c *Client) NewAddRelayerCall(relayer types.AccountID) (types.Call, error)
- func (c *Client) NewNativeTransferCall(amount types.U128, recipient []byte, destId msg.ChainId) (types.Call, error)
- func (c *Client) NewRegisterResourceCall(id msg.ResourceId, method string) (types.Call, error)
- func (c *Client) NewSetRelayerThresholdCall(threshold types.U32) (types.Call, error)
- func (c *Client) NewSudoCall(call types.Call) (types.Call, error)
- func (c *Client) NewWhitelistChainCall(id msg.ChainId) (types.Call, error)
- func (c *Client) OwnerOf(tokenId *big.Int) (types.AccountID, error)
- func (c *Client) RegisterResource(id msg.ResourceId, method string) error
- func (c *Client) SetRelayerThreshold(threshold types.U32) error
- func (c *Client) WhitelistChain(id msg.ChainId) error
- type Erc721Token
- type EventErc721Burned
- type EventErc721Minted
- type EventErc721Transferred
- type EventExampleRemark
- type EventFeeChanged
- type EventMultiAccountRemoved
- type EventMultiAccountUpdated
- type EventMultisigApproval
- type EventMultisigCancelled
- type EventMultisigExecuted
- type EventNFTDeposited
- type EventNewMultiAccount
- type EventNewMultisig
- type EventNftTransferred
- type EventRadClaimsClaimed
- type EventRadClaimsRootHashStored
- type EventRegistryMint
- type EventRegistryRegistryCreated
- type EventRegistryTmp
- type EventTreasuryMinting
- type Events
- type Method
- type RegistryId
- type TimePoint
- type TokenId
Constants ¶
const BridgePalletName = "ChainBridge"
const BridgeStoragePrefix = "ChainBridge"
Variables ¶
This section is empty.
Functions ¶
func BatchSubmit ¶
Batch submit take multiple calls and attempts to sumbit all of them, then waits until they complete. This should allow for the calls to be processed in a single block (to some limit). WARNING: Failed calls are not reported
func InitializeChain ¶
func QueryConst ¶
QueryConst looks up a constant in the metadata
func QueryStorage ¶
func SubmitSudoTx ¶
Types ¶
type AssetId ¶
type AssetId struct { RegistryId RegistryId TokenId TokenId }
type Client ¶
type Client struct { Api *gsrpc.SubstrateAPI Meta *types.Metadata Genesis types.Hash Key *signature.KeyringPair }
Client is a container for all the components required to submit extrinsics TODO: Perhaps this would benefit an interface so we can interchange Connection and a client like this
func CreateClient ¶
func CreateClient(key *signature.KeyringPair, endpoint string) (*Client, error)
func (*Client) GetDepositNonce ¶
func (*Client) InitiateHashTransfer ¶
func (*Client) InitiateNativeTransfer ¶
func (*Client) InitiateNonFungibleTransfer ¶
func (*Client) LatestBlock ¶
func (*Client) MintErc721 ¶
func (*Client) NewAddRelayerCall ¶
func (*Client) NewNativeTransferCall ¶
func (*Client) NewRegisterResourceCall ¶
func (*Client) NewSetRelayerThresholdCall ¶
func (*Client) NewWhitelistChainCall ¶
func (*Client) RegisterResource ¶
func (c *Client) RegisterResource(id msg.ResourceId, method string) error
func (*Client) SetRelayerThreshold ¶
type Erc721Token ¶
func GetErc721Token ¶
func GetErc721Token(client *Client, id types.U256) (*Erc721Token, error)
type EventErc721Burned ¶
type EventErc721Minted ¶
type EventErc721Transferred ¶
type EventExampleRemark ¶
type EventFeeChanged ¶
type EventFeeChanged struct { Phase types.Phase Key types.Hash NewPrice types.U128 Topics []types.Hash }
EventFeeChanged is emitted when a fee for a given key is changed.
type EventMultiAccountRemoved ¶
EventMultiAccountRemoved is emitted when a multi account has been removed. First param is the multisig account.
type EventMultiAccountUpdated ¶
EventMultiAccountUpdated is emitted when a multi account has been updated. First param is the multisig account.
type EventMultisigApproval ¶
type EventMultisigApproval struct { Phase types.Phase Who types.AccountID TimePoint TimePoint ID types.AccountID Topics []types.Hash }
EventMultisigApproval is emitted when a multisig operation has been approved by someone. First param is the account that is approving, third is the multisig account.
type EventMultisigCancelled ¶
type EventMultisigCancelled struct { Phase types.Phase Who types.AccountID TimePoint TimePoint ID types.AccountID Topics []types.Hash }
EventMultisigCancelled is emitted when a multisig operation has been cancelled by someone. First param is the account that is approving, third is the multisig account.
type EventMultisigExecuted ¶
type EventMultisigExecuted struct { Phase types.Phase Who types.AccountID TimePoint TimePoint ID types.AccountID Result types.DispatchResult Topics []types.Hash }
EventMultisigExecuted is emitted when a multisig operation has been executed by someone. First param is the account that is approving, third is the multisig account.
type EventNFTDeposited ¶
EventNFTDeposited is emitted when NFT is ready to be deposited to other chain.
type EventNewMultiAccount ¶
EventNewMultiAccount is emitted when a multi account has been created. First param is the account that created it, second is the multisig account.
type EventNewMultisig ¶
EventNewMultisig is emitted when a new multisig operation has begun. First param is the account that is approving, second is the multisig account.
type EventNftTransferred ¶
type EventNftTransferred struct { Phase types.Phase RegistryId RegistryId AssetId AssetId Who types.AccountID Topics []types.Hash }
EventNftTransferred is emitted when the ownership of the asset has been transferred to the account
type EventRadClaimsClaimed ¶
type EventRadClaimsClaimed struct { Phase types.Phase Who types.AccountID Value types.U128 Topics []types.Hash }
EventRadClaimsClaimed is emitted when RAD Tokens have been claimed
type EventRadClaimsRootHashStored ¶
type EventRadClaimsRootHashStored struct { Phase types.Phase RootHash types.Hash Topics []types.Hash }
EventRadClaimsRootHashStored is emitted when RootHash has been stored for the correspondent RAD Claims batch
type EventRegistryMint ¶
type EventRegistryMint struct { Phase types.Phase RegistryId RegistryId TokenId TokenId Topics []types.Hash }
EventRegistryMint is emitted when successfully minting an NFT
type EventRegistryRegistryCreated ¶
type EventRegistryRegistryCreated struct { Phase types.Phase RegistryId RegistryId Topics []types.Hash }
EventRegistryRegistryCreated is emitted when successfully creating a NFT registry
type EventRegistryTmp ¶
EventRegistryTmp is emitted only for testing
type EventTreasuryMinting ¶
type Events ¶
type Events struct { types.EventRecords events.Events Erc721_Minted []EventErc721Minted //nolint:stylecheck,golint Erc721_Transferred []EventErc721Transferred //nolint:stylecheck,golint Erc721_Burned []EventErc721Burned //nolint:stylecheck,golint Example_Remark []EventExampleRemark //nolint:stylecheck,golint Nfts_DepositAsset []EventNFTDeposited //nolint:stylecheck,golint Council_Proposed []types.EventCollectiveProposed //nolint:stylecheck,golint Council_Voted []types.EventCollectiveVoted //nolint:stylecheck,golint Council_Approved []types.EventCollectiveApproved //nolint:stylecheck,golint Council_Disapproved []types.EventCollectiveDisapproved //nolint:stylecheck,golint Council_Executed []types.EventCollectiveExecuted //nolint:stylecheck,golint Council_MemberExecuted []types.EventCollectiveMemberExecuted //nolint:stylecheck,golint Council_Closed []types.EventCollectiveClosed //nolint:stylecheck,golint Fees_FeeChanged []EventFeeChanged //nolint:stylecheck,golint MultiAccount_NewMultiAccount []EventNewMultiAccount //nolint:stylecheck,golint MultiAccount_MultiAccountUpdated []EventMultiAccountUpdated //nolint:stylecheck,golint MultiAccount_MultiAccountRemoved []EventMultiAccountRemoved //nolint:stylecheck,golint MultiAccount_NewMultisig []EventNewMultisig //nolint:stylecheck,golint MultiAccount_MultisigApproval []EventMultisigApproval //nolint:stylecheck,golint MultiAccount_MultisigExecuted []EventMultisigExecuted //nolint:stylecheck,golint MultiAccount_MultisigCancelled []EventMultisigCancelled //nolint:stylecheck,golint TreasuryReward_TreasuryMinting []EventTreasuryMinting //nolint:stylecheck,golint Nft_Transferred []EventNftTransferred //nolint:stylecheck,golint RadClaims_Claimed []EventRadClaimsClaimed //nolint:stylecheck,golint RadClaims_RootHashStored []EventRadClaimsRootHashStored //nolint:stylecheck,golint Registry_Mint []EventRegistryMint //nolint:stylecheck,golint Registry_RegistryCreated []EventRegistryRegistryCreated //nolint:stylecheck,golint Registry_RegistryTmp []EventRegistryTmp //nolint:stylecheck,golint }
type Method ¶
type Method string
An available method on the substrate chain
var AddRelayerMethod Method = BridgePalletName + ".add_relayer"
var Erc721MintMethod Method = "Erc721.mint"
var ExampleMintErc721Method Method = "Example.mint_erc721"
var ExampleRemarkMethod Method = "Example.remark"
var ExampleTransferErc721Method Method = "Example.transfer_erc721"
var ExampleTransferHashMethod Method = "Example.transfer_hash"
var ExampleTransferMethod Method = "Example.transfer"
var ExampleTransferNativeMethod Method = "Example.transfer_native"
var SetResourceMethod Method = BridgePalletName + ".set_resource"
var SetThresholdMethod Method = BridgePalletName + ".set_threshold"
var SudoMethod Method = "Sudo.sudo"
var WhitelistChainMethod Method = BridgePalletName + ".whitelist_chain"