YATORI
DOCS

Integrations

Explore example integrations showing how to incorporate Arrow API into your JavaScript and TypeScript applications.

JavaScriptTypeScript

Create SOL Transfer Transaction Data

Generate raw unsigned SOL transfer transaction data using Arrow API.

import { Transaction } from '@solana/web3.js';

const response = await fetch('https://arrow-api.yatori.io/sol-transfer', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from_address: fromAddress,
    to_address: toAddress,
    lamports: lamports.toString()
  })
});

let transaction = response.data;

const deserializedTx = Transaction.from(transaction);

const blockhash = await // FETCH YOUR BLOCKHASH HERE //

deserializedTx.recentBlockhash = blockhash;

const serializedTransaction = deserializedTx.serialize({
  requireAllSignatures: false,
});
JavaScriptTypeScript

Create Token Transfer Transaction Data

Generate raw unsigned SPL token transfer transaction data using Arrow API.

import { Transaction } from '@solana/web3.js';

const response = await fetch('https://arrow-api.yatori.io/token-transfer', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from_address: fromAddress,
    to_address: toAddress,
    token_mint_address: tokenMint,
    amount: amount.toString()
  })
});

let transaction = response.data;

const deserializedTx = Transaction.from(transaction);

const blockhash = await // FETCH YOUR BLOCKHASH HERE //

deserializedTx.recentBlockhash = blockhash;

const serializedTransaction = deserializedTx.serialize({
  requireAllSignatures: false,
});