Skip to main content

Get Ionic Swap Proposal Info

Reads hex-encoded ionic swap proposal info, generated by other user and addressed to this wallet. Proxy of ionic_swap_get_proposal_info method.

In your web app, call extension Get Ionic Swap Proposal Info method, while extension is on.

Use zano_web3 lib SDK to make a request.

Request

import { ZanoWallet } from 'zano_web3/web';

const zanoWallet = new ZanoWallet();

const hexRawProposal = "";

const response = await zanoWallet.getIonicSwapProposalInfo(hexRawProposal, { timeoutMs: 60_000 });

where:

  • hexRawProposal - Hex-encoded proposal raw data(encrypted with common shared key). Includes half-created transaction template and some extra information that would be needed counterparty to finalize and sign transaction
  • timeoutMs - Timeout of request in ms (no timeout if not set)

Response

{
"success": true,
"data": {
"proposal": {
"fee_paid_by_a": 10000000000,
"to_finalizer": [{
"amount": 1000000000000,
"asset_id": "97d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc"
}],
"to_initiator": [{
"amount": 10000000000,
"asset_id": "d6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a"
}]
}
}
}

where:

  • proposal - Proposal details
  • fee_paid_by_a - Fee paid by party A(initiator)
  • to_finalizer - Assets sent to the finalizer
  • to_initiator - Assets sent to the initiator
  • amount - Amount of the asset
  • asset_id - ID of the asset

NOTE: You can opt out of the zano_web3 SDK and call Zano Companion directly via window.zano.request.

Request

window.zano.request(
'GET_IONIC_SWAP_PROPOSAL_INFO',
{
hex_raw_proposal: ""
},
timeout
);

where:

  • hex_raw_proposal - Hex-encoded proposal raw data(encrypted with common shared key). Includes half-created transaction template and some extra information that would be needed counterparty to finalize and sign transaction
  • timeout - Timeout of request in ms (set to null to disable)

Response

{
"data": {
"result": {
"proposal": {
"fee_paid_by_a": 10000000000,
"to_finalizer": [{
"amount": 1000000000000,
"asset_id": "97d91442f8f3c22683585eaa60b53757d49bf046a96269cef45c1bc9ff7300cc"
}],
"to_initiator": [{
"amount": 10000000000,
"asset_id": "d6329b5b1f7c0805b5c345f4957554002a2f557845f64d7645dae0e051a6498a"
}]
}
}
}
}

where:

  • proposal - Proposal details
  • fee_paid_by_a - Fee paid by party A(initiator)
  • to_finalizer - Assets sent to the finalizer
  • to_initiator - Assets sent to the initiator
  • amount - Amount of the asset
  • asset_id - ID of the asset