We provide a Create Transaction API for your wallet. To send ETH,
we need to set the following parameters:
calls: An array of objects with the following properties:
to: The recipient’s Ethereum address.
value: The amount of ETH to send, in wei.
data: Unnecessary for just sending ETH. Set it to "0x".
chain: The chain where the transaction will be sent.
signer: One of the wallet’s signers. In most cases, this will be the admin signer.
const walletLocator ='0x...';const apiKey ='sk_staging...';const recipientAddress ='0x...';const signerAddress ='0x...';asyncfunctionsendTransaction(){const response =awaitfetch(`https://api.crossmint.com/2022-06-09/wallets/${walletLocator}/transactions`,{ method:'POST', headers:{'Content-Type':'application/json','X-API-KEY': apiKey,}, body:JSON.stringify({ params:{ calls:[{ to: recipientAddress, value:'100000000000000000',// 0.1 ETH in wei data:'0x',},], chain:'base-sepolia', signer:`evm-keypair:${signerAddress}`,},}),});const data =await response.json();console.log(data);}sendTransaction().catch(console.error);
We provide a Create Transaction API for your wallet. To send ETH,
we need to set the following parameters:
calls: An array of objects with the following properties:
to: The recipient’s Ethereum address.
value: The amount of ETH to send, in wei.
data: Unnecessary for just sending ETH. Set it to "0x".
chain: The chain where the transaction will be sent.
signer: One of the wallet’s signers. In most cases, this will be the admin signer.
const walletLocator ='0x...';const apiKey ='sk_staging...';const recipientAddress ='0x...';const signerAddress ='0x...';asyncfunctionsendTransaction(){const response =awaitfetch(`https://api.crossmint.com/2022-06-09/wallets/${walletLocator}/transactions`,{ method:'POST', headers:{'Content-Type':'application/json','X-API-KEY': apiKey,}, body:JSON.stringify({ params:{ calls:[{ to: recipientAddress, value:'100000000000000000',// 0.1 ETH in wei data:'0x',},], chain:'base-sepolia', signer:`evm-keypair:${signerAddress}`,},}),});const data =await response.json();console.log(data);}sendTransaction().catch(console.error);
1
First, we need to prepare the transaction that will send 0.001 SOL.
For the transaction parameters:
Use "11111111111111111111111111111111" as the blockhash (Crossmint will replace this)
Use "11111111111111111111111111111112" as the payerKey (Crossmint will replace this)
Do not include the sending wallet in the signers array
Do not sign the transaction (Crossmint will handle signing)
The transaction will be properly configured on Crossmint’s servers with the correct values before execution. Crossmint will also pay for the transaction fee.
Send the transaction to the /transactions endpoint. We only need to send the transaction field with the base58 encoded transaction generated in the previous step.