Create Deposit Address
EIP-712
const domain: TypedDataDomain = {
name: 'MiraiLabs|Bank',
version: '1.0',
};
Deposit Address
- Endpoint: /deposit/address
- Description: Used to get deposit address for ERC20/ERC721
- Method:
POST - Params:
| Name | Type | Require? | Description |
|---|---|---|---|
tx | object | [x] | Raw transaction |
tx.chainType | EIP155,SOLANA | [x] | Type of address |
tx.asset | address | [x] | Adddress of asset |
signature | string | [x] | Signature of transaction |
const types: Record<string, TypedDataField[]> = {
DepositAddress: [
{ name: 'chainType', type: 'string' },
{ name: 'asset', type: 'address' },
],
};
const value = {
chainType: 'EIP155',
asset: '0x....',
};
const signature = await userWallet._signTypedData(domain, types, value);
- Return Values:
JSON object
| Name | Type | Description |
|---|---|---|
status | bool | Status of request |
address | address | Deposit Address |
asset | object | Asset |
asset.name | string | Name of asset |
asset.symbol | string | Symbol of asset |
asset.identity | string | Unique ID of asset on MiraiBank |
asset.decimals | number | Decimal of asset |
chain | object | Chain of asset |
chain.name | string | Name of chain |
chain.chainId | string | ChainId of chain |
chain.isMainnet | boolean | Mainnet or testnet |
chain.chainType | EIP155,SOLANA | Type of chain |
Deposit App
- Endpoint: /deposit/app
- Description: Used to get deposit address for ERC20/ERC721
- Method:
POST - Params:
| Name | Type | Require? | Description |
|---|---|---|---|
tx | object | [x] | Raw transaction |
tx.userId | string | [x] | UserId of user in app |
tx.chainType | EIP155,SOLANA | [x] | Type of address |
tx.asset | address | [x] | Adddress of asset |
signature | string | [x] | Signature of asset=&chainType=&userId= |
- Return Values:
JSON object
| Name | Type | Description |
|---|---|---|
status | bool | Status of request |
address | address | Deposit Address |
app | object | Asset |
app.name | string | Name of app |
app.address | address | Address of app |
app.userId | string | UserID of user in app |
asset | object | Asset |
asset.name | string | Name of asset |
asset.symbol | string | Symbol of asset |
asset.identity | string | Unique ID of asset on MiraiBank |
asset.decimals | number | Decimal of asset |
chain | object | Chain of asset |
chain.name | string | Name of chain |
chain.chainId | string | ChainId of chain |
chain.isMainnet | boolean | Mainnet or testnet |
chain.chainType | EIP155,SOLANA | Type of chain |