Sending MobileCoin
async function buildAndSubmitTransaction() {
const response = await fetch('http://127.0.0.1:9090/wallet/v2', {
method: 'POST',
body: `{
"method": "build_and_submit_transaction",
"params": {
"account_id": "1f32a...",
"recipient_public_address": "3yNzpvKEpis...",
"amount": {"value": "1000000000", "token_id": "0"}
},
"id": 1,
"jsonrpc": "2.0"
}`,
headers: {
'Content-Type': 'application/json'
}
});
return await response.json();
}
buildAndSubmitTransaction().then((response) => {
console.log(response);
});Last updated
Was this helpful?