EnviDa Protocol
  • 🌍About Envida Blockchain
    • Introduction
    • Overview
    • Why EnviDa?
    • How it works?
    • Understanding the EnviDa Blockchain
    • DeFi Essentials
    • The Joint Potential of Blockchain, IOT and AI
  • πŸš™What is DriveMiner?
    • Environmental Tracking Devices
    • The Cost of Mining
    • The Solution of Mining
    • POW Consensus
    • Technical Specs
    • Device Sales and ROI
  • πŸ’°$EDAT Tokenomics
    • Detailed EDAT Tokenomics
    • ICO and Token Listings
    • Token Unlock and Allocation
    • Game Theory
  • πŸ“ˆStaking and Rewards
    • Reward Distribution
    • DriveMining Rewards
    • Validator Rewards
      • Unstaking Penalty
    • Staking Pool Rewards
      • Discounts
    • Data Collection Rewards
      • Stream Payment - Sensors
        • Competition and Arrival
      • Stream Payment - Lidiar
        • Teamwork
      • Pool Bonus
      • Formulas
  • ROI
  • πŸ¦Έβ€β™‚οΈFor Users
    • EnviDa Wallet
    • Driver Experience
    • Data Marketplace
    • DeFi Essentials
    • External Wallets
  • ⛓️Blockchain Architecture
    • Trustless EVM
    • Bridges
    • Runtime Development
    • Cross-Chain Compatibility
    • EnviDa Dex Engine
    • Technical Architecture
    • Scalability
    • Indexer & Explorer
    • Application Security
    • Storage
    • IPLD
    • Governance
    • Liquidity
    • Concensus
    • Runtime Environment
  • πŸ“”API Recipes
    • Account
    • Asset
    • Bag
    • Bundle
    • Market
  • 🌐EnviDa Network Infrastructure
  • ☸️Nodes and Validators
  • 🧠AI & Simulations
  • 🀝Network Referral System
  • πŸ›£οΈRoadmap
  • πŸ“šResources
    • Website
    • Business Whitepaper
    • Github
    • Technical Whitepaper
Powered by GitBook
On this page
  • Register
  • Mint
  1. API Recipes

Bundle

Register

Description:

This function registers a new bundle schema.

Previous Steps:

  1. Create a class

  2. Create an asset

  3. Mint an asset

Steps:

  1. Call the bundle/register endpoint with the following request body:

  • seed: the seed of the account that will pay for the transaction.

  • class_id: the new class identifier that the bundle will manage.

  • asset_id: the new asset identifier that the bundle will manage.

  • schema: this will represent all the classes and assets that need to be present in order to fulfill the other transactions

    • class_ids: an array of the class identifiers that will be part of the schema.

    • asset_ids: an array of asset_ids arrays that will be related to each class_id.

    • amounts: an array of amount arrays that will be related to each asset_id.

  • metadata: additional information about the bundle.

Example Input:

{
    "seed": "//Alice",
    "class_id": 3,
    "asset_id": 0,
    "schema": {
        "class_ids": [1],
        "asset_ids": [
            [1]
        ],
        "amounts": [
            [5]
        ]
    },
    "metadata": {
        "userdata": ""
    }
}

Expected Output:

{
    "bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
    "who": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "class_id": 3,
    "asset_id": 0
}
  • who: the account address associated with the bundle.

  • bundle_id: the bundle identifier.

  • class_id: the class identifier managed by the bundle.

  • asset_id: the asset identifier managed by the bundle.

Mint

Description:

This function mints a bundle.

Previous Steps:

  1. Create an account

Steps:

  1. Call the bundle/mint endpoint with the following request body:

  • seed: the seed of the account that will pay for the transaction.

  • from: the account address of the sender.

  • to: the account address of the receiver.

  • bundle_id: the bundle identifier.

  • amount: the amount to be minted.

Example Input:

{
    "seed": "//Alice",
    "from": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
    "amount": 10
}

Expected Output:

{
    "who": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "from": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "to": "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
    "bundle_id": "460bf8be553867922d58c434b3e672ffee40d163d4e744d28c1f67f93d0b3a3c",
    "amount": 10
}
  • who: the account address that paid for the transaction.

  • from: the account address of the sender.

  • to: the account address of the receiver.

  • bundle_id: the bundle identifier.

  • amount: the amount minted.

PreviousBagNextMarket

Last updated 2 years ago

πŸ“”
Register a bundle schema