Fractal
  • Overview
  • Basics
    • Architecture
  • Key Concepts
    • Fractal Confluence: The EVM Layer
    • The Confluence Bridge
    • Fractal Spring: The UTXO Layer
      • Concepts
      • Technical Specifications
    • Staking
      • Overview
      • EVM Staking
        • UTXO Staking and EVM Staking
      • Consensus
      • Rewards
      • Penalties
  • Developers
    • Acquire Testnet FRA
    • EVM Tools & Tutorials
      • Contract Deployment
        • Ganache
        • Hardhat
        • Remix
        • Truffle
        • Waffle
      • The Graph
    • Developer SDKs
      • UTXO Native Chain SDK
        • Fractal Spring (UTXO Layer) SDK Installation
        • Developer Tools
          • Fractal CLI Tool
        • UTXO API Reference
          • Account
          • Keypair
          • Network
          • Asset
          • Staking
          • Transaction
          • Helpers
      • The Confluence Bridge SDK
    • EVM References
      • Metamask
      • Local Development Network Setup
      • EVM API Reference
      • Precompiled Contracts
  • Network Settings
    • Contract Addresses
    • Network Settings
  • User Guides
    • Fractal Wallet Guides
      • MetaMask
        • Download
        • Configure (Auto)
        • Configure (Manual)
      • Fractal Wallet
        • Download
        • New Wallet
        • Transfer Tokens in the Fractal Wallet
        • The Confluence Bridge
        • Adding Custom Assets to the Fractal Wallet
        • Manage Assets
      • Ledger Hardware Wallet
    • Acquire FRA
    • Explore Testnet
    • Acquire FRA (Testnet)
    • Stake FRA
    • How to Use Block Explorers
    • Bridging Tokens to Fractal
  • Validator Materials
    • Validator Setup Guides
      • System Requirements
      • Acquire a Server
      • Validator Toolbox Setup
        • New Build
        • Existing Build
        • Additional Info
      • Manual Setup
      • Automated Setup (Deprecated)
    • Upgrade Guides
      • Node Upgrade (Toolbox)
      • Node Upgrade (Manual)
      • fn CLI Upgrade (Wallet)
    • Operational Guides
      • Emergency Recovery
      • Data Backup
      • CLI Staking
Powered by GitBook
On this page
  1. Developers
  2. Developer SDKs
  3. UTXO Native Chain SDK
  4. UTXO API Reference

Transaction

PreviousStakingNextHelpers

Last updated 1 year ago

getTransactionBuilder

- Create an instance of TransactionBuilder This method is used to create a transaction builder

Results:

  • Promise<TransactionBuilder> - TransactionBuilder which should be used in Transaction.submitTransaction.

Example:

// Create a TransactionBuilder object
const transactionBuilder = await Transaction.getTransactionBuilder();

getTxList

- Get a list of transactions for given wallet address This method is used to get a list of transactions for given wallet address

Parameters:

  • <string> - wallet address

  • <"to" | "from"> - transaction type. it can only be 'to' or 'from'

  • <number> - pagination. The defaul value is 1.

Results:

  • Promise<ProcessedTxListResponseResult> - An instance of ProcessedTxListResponseResult containing the total count and transactions.

Example:

const address = `fra000xxsr`;
const type = "to";

// Get list of `to` transaction of given address
const txDetail = await Transaction.getTxList(address, type);

- Send some asset to an address Using this function, user can transfer some amount of given asset to another address

  • <WalletKeypar> - wallet keypair

  • <string> - target wallet address

  • <string> - amount to be sent

  • <string> - asset code

  • <AssetBlindRules> - (optional) confidential options for blind rule

  • Promise<TransactionBuilder> - A TransactionBuilder which should be used in Transaction.submitTransaction

const walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);
const toWalletInfo = await Keypair.restoreFromPrivateKey(toPkeyMine2, password);

const assetCode = await Asset.getFraAssetCode();

const assetBlindRules: Asset.AssetBlindRules = {
  isTypeBlind: false,
  isAmountBlind: false,
};

const transactionBuilder = await Transaction.sendToAddress(
  walletInfo,
  toWalletInfo.address,
  "2",
  assetCode,
  assetBlindRules
);

const resultHandle = await Transaction.submitTransaction(transactionBuilder);

- Send some asset to multiple receivers Using this function, user can transfer perform multiple transfers of the same asset to multiple receivers using different amounts

  • <WalletKeypar> - wallet keypair

  • <TransferReciever[]> - the list of target wallet addresses and amount

  • <string> - asset code

  • <AssetBlindRules> - (optional) confidential options for blind rule

  • Promise<TransactionBuilder> - A TransactionBuilder which should be used in Transaction.submitTransaction

const walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);
const toWalletInfoMine2 = await Keypair.restoreFromPrivateKey(
  toPkeyMine2,
  password
);
const toWalletInfoMine3 = await Keypair.restoreFromPrivateKey(
  toPkeyMine3,
  password
);

const assetCode = await Asset.getFraAssetCode();

const assetBlindRules: Asset.AssetBlindRules = {
  isTypeBlind: false,
  isAmountBlind: false,
};

const recieversInfo = [
  { reciverWalletInfo: toWalletInfoMine2, amount: "2" },
  { reciverWalletInfo: toWalletInfoMine3, amount: "3" },
];

const transactionBuilder = await Transaction.sendToMany(
  walletInfo,
  recieversInfo,
  assetCode,
  assetBlindRules
);

const resultHandle = await Transaction.submitTransaction(transactionBuilder);

- Send some asset to a wallet by public key Using this function, user can transfer some amount of given asset to another wallet by target's public key

  • <WalletKeypar> - wallet keypair

  • <string> - target's public key

  • <string> - amount to be sent

  • <string> - asset code

  • <AssetBlindRules> - (optional) confidential options for blind rule

  • Promise<TransactionBuilder> - A TransactionBuilder which should be used in Transaction.submitTransaction

const walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);
const toWalletPublicKey = `tgshauuy213`;

const assetCode = await Asset.getFraAssetCode();

const assetBlindRules: Asset.AssetBlindRules = {
  isTypeBlind: false,
  isAmountBlind: false,
};

const transactionBuilder = await Transaction.sendToPublicKey(
  walletInfo,
  toWalletPublicKey,
  "2",
  assetCode,
  assetBlindRules
);

const resultHandle = await Transaction.submitTransaction(transactionBuilder);

- Submits a transaction The next step after creating a transaction is submitting it to the ledger, and, as a response, we retrieve the transaction handle.

  • <TransactionBuilder> - an instance of TransactionBuilder

  • Promise<string> - Transaction status handle

onst walletInfo = await Keypair.restoreFromPrivateKey(pkey, password);

// First, we create a transaction builder
const assetBuilder = await Asset.defineAsset(walletInfo, assetCode);

// Then, we submit a transaction
// If succcesful, the response of the submit transaction request will return a handle that can be used the query the status of the transaction.
const handle = await Transaction.submitTransaction(assetBuilder);

sendToAddress

Parameters:

Results:

Example:

sendToMany

Parameters:

Results:

Example:

sendToPublicKey

Parameters:

Results:

Example:

submitTransaction

Parameters:

Results:

Example:

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​