A provider is an interface for abstracting the user's wallet implementation from the application, which enables the development of wallet-agnostic applications.
For the XpansionChain StarkEx network, XpansionChain has defined a Provider interface incorporating the IMX-specific signable actions, such as creating an order, withdrawals, and more.
The following list details all the signable actions supported by the IMX Provider along with definitions of the request and response payloads.
▸ batchNftTransfer (request): Promise<CreateTransferResponse >
Create a batch of NFT transfer requests
Parameters arrow-up-right
An array of NFT transfer details
Returns arrow-up-right
Promise<CreateTransferResponse >
Resolves a promise that resolves with the list of Transfer IDs
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:73
▸ cancelOrder (request): Promise<CancelOrderResponse >
Cancel an Order
Parameters arrow-up-right
GetSignableCancelOrderRequest
The signable cancel order request
Returns arrow-up-right
Promise<CancelOrderResponse >
Returns a promise that resolves with the cancelled Order
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:52
▸ completeWithdrawal (starkPublicKey, token): Promise<TransactionResponse>
Completes a Withdrawal
Parameters arrow-up-right
Returns arrow-up-right
Promise<TransactionResponse>
Returns a promise that resolves with the transaction
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:102
▸ createOrder (request): Promise<CreateOrderResponse >
Create an Order
Parameters arrow-up-right
The unsigned order request to create an order
Returns arrow-up-right
Promise<CreateOrderResponse >
Returns a promise that resolves with the created Order
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:45
▸ createTrade (request): Promise<CreateTradeResponse >
Create a Trade
Parameters arrow-up-right
The signable trade request
Returns arrow-up-right
Promise<CreateTradeResponse >
Returns a promise that resolves with the created Trade
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:59
▸ deposit (deposit): Promise<TransactionResponse>
Deposit either ETH, ERC20 or ERC721 tokens
Parameters arrow-up-right
Returns arrow-up-right
Promise<TransactionResponse>
Returns a promise that resolves with the transaction
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:87
▸ exchangeTransfer (request): Promise<CreateTransferResponseV1 >
Create a new Exchange transaction
Parameters arrow-up-right
UnsignedExchangeTransferRequest
The unsigned exchange transfer request
Returns arrow-up-right
Promise<CreateTransferResponseV1 >
Returns a promise that resolves with the created Exchange Transaction
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:80
▸ getAddress (): Promise<string>
Get the Signer address
Returns arrow-up-right
Promise<string>
Returns a promise that resolves with the signer's address
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:26
▸ isRegisteredOnchain (): Promise<boolean>
Checks if a User is registered on-chain
Returns arrow-up-right
Promise<boolean>
Returns a promise that resolves with true if the User is registered, false otherwise
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:38
▸ prepareWithdrawal (request): Promise<CreateWithdrawalResponse >
Create a Withdrawal
Parameters arrow-up-right
The token type amount in its corresponding unit
Returns arrow-up-right
Promise<CreateWithdrawalResponse >
Returns a promise that resolves with the created Withdrawal
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:94
▸ registerOffchain (): Promise<RegisterUserResponse >
Register a User to XpansionChain if they are not already registered
Returns arrow-up-right
Promise<RegisterUserResponse >
Returns a promise that resolves with the user registration response
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:32
▸ transfer (request): Promise<CreateTransferResponseV1 >
Create a new Transfer request
Parameters arrow-up-right
The unsigned transfer request
Returns arrow-up-right
Promise<CreateTransferResponseV1 >
Returns a promise that resolves with the created Transfer
Defined in arrow-up-right
src/modules/provider/imxProvider.ts:66
ETHToken | ERC721Token | ERC20Token
ID of the cancelled order
An ETH token
An ERC721 token
The string literal "ERC721"
An ERC20 token
The string literal "ERC20"
ETHToken | ERC721Token | ERC20Token
Union type that represents all token type amounts
Union type that represents exchange token type amounts
An amount in units for the given ERC20 token
Inherited from ERC20Token
Inherited from ERC20Token
Ethereum address of the receiving user
The token contract address
ID of the order to be cancelled
ID of the cancelled order
The amount of tokens that will be bought for this order
(Optional) ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
(Optional) Inclusion of either maker or taker fees
The amount of tokens that will be sold for this order
(Optional) Request ID as a reference for an asynchronous order creation request
Status of the created order
Timestamp of the created order
(Optional) ExpirationTimestamp in Unix time. Note: will be rounded down to the nearest hour
Inclusion of either maker or taker fees
The ID of the maker order involved
Ethereum address of the submitting user
(Optional) Request ID as a reference for an asynchronous trade creation request
ID of trade within XpansionChain
Ethereum address of the receiving user
Union type that represents exchange token type amounts
Union type that represents all token type amounts
[deprecated] Time of the transfer
[deprecated] The status of transfer
[deprecated] Sent signature
XpansionChain signature authorising registration
XpansionChain signature authorising registration