LogoLogo
  • Overview
  • Basics
    • Architecture
  • Key Concepts
    • EVM Ledger
    • UTXO Chain
      • Confidential transfers
        • Overview
        • Concepts
        • Technical Specifications
    • Prism++ Transfer
    • Triple Masking
      • Overview
      • SDK Installation
      • Bar to Abar
      • Abar to Bar
      • Abar Transfer
    • Staking
      • Overview
      • EVM Staking
        • UTXO Staking and EVM Staking
        • EVM Staking Portal User Guide
      • Consensus
      • Rewards
      • Penalties
  • Developers
    • Acquire Testnet FRA
    • EVM Tools & Tutorials
      • Contract Deployment
        • Ganache
        • Hardhat
        • Remix
        • Truffle
        • Waffle
      • The Graph
      • Band Protocol
      • Mint NFTs
        • Deploy NFT Contract (1 of 3)
        • Mint NFT (2 of 3)
        • View NFT (3 of 3)
    • Developer SDKs
      • UTXO Native Chain SDK
        • UTXO Native Chain SDK Installation
        • Developer Tools
          • Findora CLI Tool
        • UTXO API Reference
          • Account
          • Keypair
          • Network
          • Asset
          • Staking
          • Transaction
          • Helpers
      • ZkRouting SDK
      • zkDID SDK
        • zkDID SDK Installation
        • zkDID API Reference
        • zkDID Example Code
      • Prism++ SDK
    • EVM References
      • Metamask
      • Local Development Network Setup
      • EVM API Reference
      • Precompiled Contracts
    • Resources
      • Bug Bounties
      • Events
        • 🏗️ETH San Francisco 2022
          • zkDID and Credentials
        • 🏗️ETH Denver 2023
    • Game-Specific Chains
      • GSC Highlights
      • User Guide
      • Developer Tools
  • Network Settings
    • Contract Addresses
    • Network Settings
  • General User Materials
    • Acquire FRA
    • Acquire FRA (Testnet)
    • Stake FRA
    • Use Wallets
      • MetaMask
        • Download
        • Configure (Auto)
        • Configure (Manual)
      • Findora Wallet
        • Download
        • New Wallet
        • Transfer
        • Prism++
        • Adding Assets to the Findora Wallet
        • Manage Assets
      • Ledger Hardware Wallet
    • Bridging Tokens to Findora
    • Use Block Explorers
    • Explore Testnet
      • Triple Masking
        • Triple Masking Demo
      • EVM Staking
      • Prism++
        • Prism++ Testing Campaign
          • 💰Testnet Wallet Setup/Funding
          • 👨‍🌾👨🌾 Peasant: Prism++ Campaign Signup
          • 🧒Pupil: FRC20 Token Transfers
          • 🧑‍🎨🧑🎨 Pilgrim: FRC 721 Token Transfers
          • 🧑‍🎓🧑🎓 Prodigy: FRC1155 Token Transfers
          • 🧑‍🚀🧑🚀 Pioneer: Mainnet Transfers
          • Prism++ Testnet Campaign FAQs
    • Gaxle Events
      • Game Chain Challenges
        • Getting Started
        • The Campaigns
        • The Reward Raffles
  • Validator Materials
    • Findora's University Program
    • 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

Was this helpful?

Edit on GitHub
  1. Developers
  2. Developer SDKs
  3. UTXO Native Chain SDK
  4. UTXO API Reference

Asset

PreviousNetworkNextStaking

Last updated 2 years ago

Was this helpful?

defineAsset

- Defines a custom asset An asset definition operation registers an asset with the Findora ledger. An asset is a digital resource that can be issued and transferred. An asset has an issuer and a unique code. The DefineAsset operation must provide an unused token code. The transaction containing the DefineAsset operation will fail if there is already another asset on the ledger with the same code.

Parameters:

  • <WalletKeypar> - Wallet keypair

  • <string> - asset name

  • <string> - (optinal) asset memo

  • <string> - (optinal) A set of rules (options) for the new asset.

Results:

  • Promise<TransactionBuilder> - An instance of TransactionBuilder from Ledger

Example:

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

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

// Then, we submit a transaction
const handle = await Transaction.submitTransaction(assetBuilder);

- Return Asset Code This method returns Asset Code by given asset type

  • <number[]> - asset type

  • Promise<string> - asset code.

const assetType = [1, 2];

// Get the decrypted Asset code
const assetCode = await Asset.getAssetCode(assetType);

- Get Asset Details This method returns Asset details by given asset code

  • <string> - asset code

  • Promise<IAsset> - An instance of FindoraWallet.IAsset

const assetCode = "Your_Asset_Code";

// Get asset details
const assetDetails = await getAssetDetails(assetCode);

- Returns the pre-defined FRA asset code FRA asset code can not be re-defined, as well as it can not be used in the DefineAset or IssueAsset operations. This is the main asset code, which is used when user needs to create a transaction, or calculate the fee and so on.

  • Promise<string> - Findora Asset code

// Get the FRA Asset code
const fraAssetCode = await Asset.getFraAssetCode();

- Return Destination's Public Key This method returns the public key of destination

  • Promise<XfrPublicKey> - An instance of XfrPublicKey.

// Get the public key of destination
const pubKey = await Asset.getFraPublicKey();

- Return Minimal Fee for transaction This method returns the required minimal fee for transaction

  • Promise<BigInt> - An instance of BigInt.

// Get the minimal fee for transaction
const minFee = await Asset.getMinimalFee();

- Returns a random asset code Using Ledger, it generates and returns a random custom asset code

  • Promise<string> - Asset code.

// Get a random asset code
const assetCode = await Asset.getRandomAssetCode();

- Issue some amount of a custom asset Asset issuers can use the IssueAsset operation to mint units of an asset that they have created. Concretely, the IssueAsset operation creates asset records that represent ownership by a public key of a certain amount of an asset. These asset records are stored in a structure called a transaction output (TXO).

  • <WalletKeypar> - wallet keypair

  • <string> - asset name

  • <string> - amount to be issued

  • <AssetBlindRules> - asset blind rules

  • <number> - (optional) asset decimals. This parameter can define how many numbers after the comma would this asset have

  • Promise<TransactionBuilder> - An instance of TransactionBuilder from Ledger

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

// Define the new asset parameters (rules)
const assetBlindRules = { isAmountBlind: false };

// First, we create a transaction builder
const assetBuilder = await Asset.issueAsset(
  walletInfo,
  customAssetCode,
  amountToIssue,
  assetBlindRules
);

// Then, we submit a transaction
const handle = await Transaction.submitTransaction(assetBuilder);tyty

getAssetCode

Parameters:

Results:

Example:

getAssetDetails

Parameters:

Results:

Example:

getFraAssetCode

Results:

Example:

getFraPublicKey

Results:

Example:

getMinimalFee

Results:

Example:

getRandomAssetCode

Results:

Example:

issueAsset

Parameters:

Results:

Example:

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