Documentation
WebsiteMineGitHubFaucet
  • Welcome to MakeOS
  • Introduction
    • Install
    • Quick Start
    • Set Up a Private Network
    • Get Test Coins
    • Track a Repository
    • What is MakeOS
    • How it Works
    • Tokenomics ($MAKE)
    • Dilithium (Deprecated)
    • Roadmap
    • Team
  • Concepts
    • Repository
      • Register a Repository
      • Initialize a New Repository
      • Repository Governance
      • Access Control Config
    • Namespace
    • Key
    • Issue Management
    • Merge Request
    • Transactions
      • Register a Repository
      • Send Coins
    • Validator
    • Host
    • Remote
  • JavaScript Console API
    • repo
    • pushkey
    • namespace
    • node
    • user
    • transaction
    • ticket
  • KIT CLI Reference
    • Overview
    • init
    • start
    • console
    • attach
    • key
      • create
      • gen
      • get
      • import
      • list
      • update
    • tx
      • get
    • repo
      • config
      • create
      • hook
      • init
      • vote
    • user
      • send
    • pk
      • register
    • sign
      • commit
      • note
      • tag
    • contributor
      • add
    • issue
      • close
      • create
      • list
      • read
      • reopen
      • status
    • mr
      • checkout
      • close
      • create
      • fetch
      • list
      • read
      • reopen
      • status
Powered by GitBook
On this page
  • Example
  • Send Coins to a Repository

Was this helpful?

  1. Concepts
  2. Transactions

Send Coins

Transfer coins between accounts and repositories.

The native coin can be transferred from one account to another account by creating and sending a TxCoinTransfer transaction.

Example

user.send({ 
   to: "os1858effdlfecl30hgq0dvpesygp2daf97malemz", 
   value:"5000",
   fee: "1",
   nonce: 3,
}, user.getKey(accounts[0], "passphrase"))
lob user send "os1858effdlfecl30hgq0dvpesygp2daf97malemz"  \
    --fee=1.2  \
    --value=5000  \
    --nonce=3  \
    --signing-key=0

The code above calls the user.send console method, passing to it the transaction data and a key from the key store.

In the example above, we unlock Alice’s private key using user.getKey, set the transfer value to 5000 and fee to 1.

to specifies the recipient of the transaction value. To can be a user address or a repository full address.

nonce is the number of all transactions Alice’s key has sent to the network. The nonce value is used to order Alice’s transactions and prevent a double-spend attack. If not provided, it will be automatically set.

On the console, the accountsglobal variable contains a list of address of keys on the keystore.

Send Coins to a Repository

var alicePrivateKey = user.getKey(accounts[0], "passphrase")
user.send({ 
   to: "r/cashmap", 
   value:"5000",
   fee: "1",
   nonce: 3,
}, alicePrivateKey)

Here we are transferring 5000 coins to a repository called cashmap; We prefixed the repository name with r/ to indicate that the recipient is a repo.

PreviousRegister a RepositoryNextValidator

Last updated 4 years ago

Was this helpful?