Cannot transfer from ONG (evm-account) to ONG (native-account) via JS-SDK

Hi Ontology dev team,

We ran into an issue of transferring ONG coin from Ontology EVM to Ontology Native via JS-SDK, this is hard for us to integrate Ontology into our popular crypto ShibaWallet.

Our team is eager to solve the problem so that we hope the dev team is able to answer it here, please.

We just follow the step on docs.https://ontio.github.io/documentation/tutorial_for_developer_en.html

The error is saying: Insufficient balance, but my account actually has over 6000 ONG and I can see it on the block exporer explorer.ont.io

Please! please!

Environment:
“ontology-ts-sdk”: “^2.0.0”

To get the balance:

const rest = new OntWallet.RestClient(CONST.MAIN_ONT_URL.REST_UR);
let balance = await rest.getBalanceV2(addr)

To make a transaction:

OntAssetTxBuilder.makeWithdrawOngTx(from, _to, amount, payer, gasPrice, gasLimit);

or

OntAssetTxBuilder.makeTransferTx(assetType, from, _to, amount, gasPrice, gasLimit, payer);

Both are failed to send due to insufficient balance.

Code snippet:

1 Like

Hello. ONG cannot be directly transferred from Ontology EVM 0x address to Ontology non-EVM A address. You can use Ontology Bridge to transfer ONG between 0x addresses and A addresses. Link of guide: Use of Ontology Bridge - ONTO Web Wallet Help Center

1 Like