obyte.js
GitHubDiscord
0.1.0
0.1.0
  • Byteball.js
  • Getting started
    • Quick start
  • Client
    • Subscribe
    • Just saying
  • API
    • Get witnesses
    • Get peers
    • Get joint
    • Get last MCI
    • Get history
    • Get attestation
    • Get attestations
    • Get bots
    • Get asset metadata
    • Core
      • Catchup
      • Get hash tree
      • Get light props
      • Post joint
      • Pick divisible coins for amount
  • Post
    • Address definition change
    • Attestation
    • Asset
    • Asset attestors
    • Data
    • Data feed
    • Definition template
    • Payment
    • Poll
    • Vote
    • Profile
    • Text
  • Utils
    • Generate a random address
  • About
    • About
    • Links
    • Tutorials
Powered by GitBook
On this page
  • Example
  • Returns
  1. API
  2. Core

Pick divisible coins for amount

Get spendable inputs from a specific amount and asset.

Example

const params = {
  asset: 'xamdfH5Uk+alv3le0pEA01qSsfZjycyMsqaqHtycJ1M=',
  addresses: ['ULQA63NGEZACP4N7ZMBUBISH6ZTCUS2Q'],
  last_ball_mci: 1000000000,
  amount: 10000,
  spend_unconfirmed: 'own',
};

client.api.pickDivisibleCoinsForAmount(params, function(err, result) {
  console.log(result);
});

Returns

{
  inputs_with_proofs: [
    {
      input: {
        unit: "06ni8/eDzmcxwtWeQyuSXhqGsqmVN3I1fsR+5NAj4Sw=",
        message_index: 1,
        output_index: 1
      }
    }
  ],
  total_amount: 985000
}
PreviousPost jointNextAddress definition change

Last updated 6 years ago