Documentation ¶
Index ¶
- Constants
- type API
- type AssetID
- type Bootstrapper
- type Config
- type EventChainWhitelisted
- type EventFeeChanged
- type EventFungibleTransfer
- type EventGenericTransfer
- type EventMultiAccountRemoved
- type EventMultiAccountUpdated
- type EventMultisigApproval
- type EventMultisigCancelled
- type EventMultisigExecuted
- type EventNFTDeposited
- type EventNFTMint
- type EventNFTTransferred
- type EventNewMultiAccount
- type EventNewMultisig
- type EventNonFungibleTransfer
- type EventRegistryCreated
- type EventRelayerAdded
- type EventRelayerThresholdChanged
- type Events
- type ExtrinsicInfo
- type TimePoint
Constants ¶
const ( // ErrCentChainTransaction is a generic error type to be used for CentChain errors ErrCentChainTransaction = errors.Error("error on centchain tx layer") // ErrNonceTooLow nonce is too low ErrNonceTooLow = errors.Error("Priority is too low") // ErrInvalidTransaction wrapper for a general error // Used sometimes as stale extrinsic (nonce too low) ErrInvalidTransaction = errors.Error("Invalid Transaction") )
const BootstrappedCentChainClient string = "BootstrappedCentChainClient"
BootstrappedCentChainClient is a key to mapped client in bootstrap context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
type API interface { // Call allows to make a read operation Call(result interface{}, method string, args ...interface{}) error // GetMetadataLatest returns latest metadata from the centrifuge chain. GetMetadataLatest() (*types.Metadata, error) // SubmitExtrinsic signs the given call with the provided KeyRingPair and submits an extrinsic. // Returns transaction hash, latest block number before extrinsic submission, and signature attached with the extrinsic. SubmitExtrinsic(ctx context.Context, meta *types.Metadata, c types.Call, krp signature.KeyringPair) (txHash types.Hash, bn types.BlockNumber, sig types.MultiSignature, err error) // SubmitAndWatch returns function that submits and watches an extrinsic, implements transaction.Submitter SubmitAndWatch( ctx context.Context, meta *types.Metadata, c types.Call, krp signature.KeyringPair) (ExtrinsicInfo, error) // GetStorageLatest returns latest value at the given key GetStorageLatest(key types.StorageKey, target interface{}) error }
API exposes required functions to interact with Centrifuge Chain.
type Bootstrapper ¶
type Bootstrapper struct{}
Bootstrapper implements bootstrap.Bootstrapper.
func (Bootstrapper) Bootstrap ¶
func (Bootstrapper) Bootstrap(context map[string]interface{}) error
Bootstrap initialises centchain client.
type Config ¶
type Config interface { GetCentChainIntervalRetry() time.Duration GetCentChainMaxRetries() int GetCentChainAccount() (acc config.CentChainAccount, err error) }
Config defines functions to get centchain details
type EventChainWhitelisted ¶
EventChainWhitelisted is emitted when a new chain has been whitelisted to interact with the bridge
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 EventFungibleTransfer ¶
type EventFungibleTransfer struct { Phase types.Phase Destination types.U8 DepositNonce types.U64 ResourceID types.Bytes32 Amount types.U32 Recipient types.Bytes Topics []types.Hash }
EventFungibleTransfer is emitted when a bridge fungible token transfer is executed
type EventGenericTransfer ¶
type EventGenericTransfer struct { Phase types.Phase Destination types.U8 DepositNonce types.U64 ResourceID types.Bytes32 Metadata types.Bytes Topics []types.Hash }
EventGenericTransfer is emitted when a bridge generic transfer is executed
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 EventNFTMint ¶ added in v1.3.0
type EventNFTMint struct { Phase types.Phase RegistryID types.H160 TokenID types.U256 Topics []types.Hash }
EventNFTMint is emitted when an NFT with tokenID is minted in a given registryID
type EventNFTTransferred ¶ added in v1.3.0
type EventNFTTransferred struct { Phase types.Phase RegistryID types.H160 AssetID AssetID AccountID types.AccountID Topics []types.Hash }
EventNFTTransferred is emitted when an NFT is transferred to a new owner
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 EventNonFungibleTransfer ¶
type EventNonFungibleTransfer struct { Phase types.Phase Destination types.U8 DepositNonce types.U64 ResourceID types.Bytes32 TokenID types.Bytes Recipient types.Bytes Metadata types.Bytes Topics []types.Hash }
EventNonFungibleTransfer is emitted when a bridge non fungible token transfer is executed
type EventRegistryCreated ¶ added in v1.3.0
EventRegistryCreated is emitted when a new registry is created
type EventRelayerAdded ¶
EventRelayerAdded is emitted when a new bridge relayer has been whitelisted
type EventRelayerThresholdChanged ¶
type EventRelayerThresholdChanged struct { Phase types.Phase Threshold types.U32 Topics []types.Hash }
EventRelayerThresholdChanged is emitted when the relayer threshold is changed
type Events ¶
type Events struct { types.EventRecords ChainBridge_FungibleTransfer []EventFungibleTransfer //nolint:stylecheck,revive ChainBridge_NonFungibleTransfer []EventNonFungibleTransfer //nolint:stylecheck,revive ChainBridge_GenericTransfer []EventGenericTransfer //nolint:stylecheck,revive ChainBridge_ChainWhitelisted []EventChainWhitelisted //nolint:stylecheck,revive ChainBridge_RelayerAdded []EventRelayerAdded //nolint:stylecheck,revive ChainBridge_RelayerThresholdChanged []EventRelayerThresholdChanged //nolint:stylecheck,revive Registry_RegistryCreated []EventRegistryCreated //nolint:stylecheck,revive Registry_Mint []EventNFTMint //nolint:stylecheck,revive Nft_Transferred []EventNFTTransferred //nolint:stylecheck,revive // contains filtered or unexported fields }
Events holds the default events and custom events for centrifuge chain
type ExtrinsicInfo ¶ added in v1.3.0
type ExtrinsicInfo struct { Hash types.Hash BlockHash types.Hash Index uint // index number of extrinsic in a block // EventsRaw contains all the events in the given block // if you want to filter events for an extrinsic, use the Index EventsRaw types.EventRecordsRaw }
ExtrinsicInfo holds details of a successful extrinsic