I want to transfer ETH that's on one IMX account to another IMX account. The transfer isn't bound to the transfer of any token. Just want to transfer ETH. How do I do that? I've found the concept of a Signable Transfer. https://docs.x.immutable.com/reference/post_v1-signable-transfer-details-1
And then the endpoint to create a transfer of tokens between parties. https://docs.x.immutable.com/reference/post_v1-transfers-1
But there are a couple of problems:
For the second one I don't know where to get the values for some of the fields to be passed in the request, like receiver_start_key, receiver_vault (respective fields for sender) and stark_signature.
I suppose that I'd get those fields maybe from the post_v1-signable-transfer-details-1 request. But I don't want to make a transfer based on the sale of a token. Just transfer amount.
I managed to get an example of what the request will look like from the IMX docs
url: 'https://api.x.immutable.com/v1/signable-transfer-details',
headers: {Accept: 'application/json', 'Content-Type': 'application/json'},
data: {
amount: 'string',
receiver: 'string',
sender: 'string',
token: {
data: {decimals: 18, token_address: 'string', token_id: '200'},
type: 'ETH/ERC20/ERC721'
}
}
But I don't know what I'm supposed to put in data[token_address] and data[token_id]
I don't even know if I'm approaching this problem properly or looking at the right place. but it's just a bit vague at the moment. So any help will be much welcome.
I think you should use Link SDK from Immutable instead https://docs.x.immutable.com/docs/linktransfer
const transferResponsePayload:TransferV2ResultsCodec = await link.transfer([
{
amount: '1.23',
symbol: 'GODS',
type: ERC20TokenType.ERC20,
tokenAddress: '0x4c04c39fb6d2b356ae8b06c47843576e32a1963e',
toAddress: 'replace-this-with-a-receiver-address',
},
{
amount: '0.23',
type: ETHTokenType.ETH,
toAddress: 'replace-this-with-a-receiver-address',
},
]);