Configuration
Config Provider
This provider supports you to configure the business environment and the scope of business support, which is one of the means for you to flexibly build ETranfer.
Example
Method Parameters
Field | Type | Required | Remarks |
---|---|---|---|
networkType | 'MAINNET' | 'TESTNET' | true | Portkey network type. |
etransferUrl | string | true | ETransfer server URL. See more: ETransfer SDK Configuration |
etransferAuthUrl | string | false | ETransfer auth server URL. See more: ETransfer SDK Configuration |
etransferSocketUrl | string | false | ETransfer socket server URL. See more: ETransfer SDK Configuration |
storage | IStorageSuite | false | See more: ETransfer SDK Configuration |
authorization | { jwt : string } | true | ETransfer auth token. See More: ETransfer SDK Auth |
accountInfo | false | Configuration of the withdraw component | |
accountInfo.walletType | WalletTypeEnum | true | wallet type |
accountInfo.accounts | TAelfAccount | true | account address |
accountInfo.managerAddress | string | false | This is a required field if you use the withdraw function. |
accountInfo.caHash | string | false | This is a required field if you use the withdraw function. |
accountInfo.tokenContractCallSendmethod | <T, R>(props: ICallContractParamsV2) => Promise<R & { transactionId?: string; }>; | false | Token contract send method. This is a required field if you use the withdraw function. |
accountInfo.getSignature | TGetSignatureFunc | false | The method of getting signature. This is a required field if you use the withdraw function. |
depositConfig |
| false | Configuration of the deposit component. |
depositConfig.defaultDepositToken | string | false | The deposit token is selected by default when the deposit component is initialized.
|
depositConfig.supportDepositTokens | string[] | false | Deposit function optional deposit tokens.
|
depositConfig.defaultReceiveToken | string | false | The receive token selected by default when the deposit component is initialized.
|
depositConfig.supportReceiveTokens | string[] | false | Deposit function optional receive tokens.
|
depositConfig.defaultChainId | ChainId | false | The aelf chain selected by default when the deposit component is initialized. |
depositConfig.supportChainIds | ChainId[] | false | Deposit function optional chains. |
depositConfig.defaultNetwork | string | false | The network selected by default when the deposit component is initialized.
|
depositConfig.supportNetworks | string[] | false | Deposit function optional networks.
|
withdrawConfig |
| false | Configuration of the withdraw component. |
withdrawConfig.defaultToken | string | false | The withdrawal token selected by default when the withdraw component is initialized.
|
withdrawConfig.supportTokens | string[] | false | Withdrawal function optional tokens.
|
withdrawConfig.defaultChainId | ChainId | false | The aelf chain selected by default when the withdraw component is initialized. |
withdrawConfig.supportChainIds | ChainId[] | false | Withdrawal function optional chains. |
withdrawConfig.defaultNetwork | string | false | The network selected by default when the withdraw component is initialized.
|
withdrawConfig.supportNetworks | string[] | false | Withdrawal function optional networks.
|
Style Provider
If you want to use the ETransfer style, please wrap the ETransferStyleProvider
and css file.
Layout Provider
If you want to display global loading, please configure ETransferLayoutProvider
.
Deposit Provider
ETransferDepositProvider
provides a way to pass data through the component tree without having to pass props down manually at every level.
Method Parameters
Field | Type | Required | Remarks |
componentStyle | ComponentStyle | false | Component style configuration items. |
Withdraw Provider
ETransferWithdrawProvider
provides a way to pass data through the component tree without having to pass props down manually at every level.
Method Parameters
Field | Type | Required | Remarks |
componentStyle | ComponentStyle | false | Component style configuration items. |
Last updated