waves_logo Docs
  • Getting Started
    Getting Started
  • How-to Guides
    • Reading Blockchain Data
      Reading Blockchain Data
    • Creating & Broadcasting Transactions
      Creating & Broadcasting Transactions
    • Tokenisation
      Tokenisation
    • Airdrop
      Airdrop
    • Payments
      Payments
    • Buying & Selling Tokens
      Buying & Selling Tokens
    • Creating Crypto Trading Bot
      Creating Crypto Trading Bot
    • Simple Voting
      Simple Voting
    • Reading Band’s Price Data
      Reading Band’s Price Data
    How-to Guides
  • Waves Smart Contracts
    Waves Smart Contracts
  • Smart Account
    • Creating smart account
      Creating smart account
    • Creating and deploying a script manually
      Creating and deploying a script manually
    • Video tutorials
      • Introduction to the Waves blockchain, Waves Smart Accounts and Waves Smart Assets
        Introduction to the Waves blockchain, Waves Smart Accounts and Waves Smart Assets
      • Waves Smart Account with multisignature
        Waves Smart Account with multisignature
      • Waves Smart Account with escrow service
        Waves Smart Account with escrow service
      • Creating multisignature account via Waves IDE tools
        Creating multisignature account via Waves IDE tools
      • Creating multisignature account via Waves Client
        Creating multisignature account via Waves Client
      • Waves console explained
        Waves console explained
      Video tutorials
    Smart Account
  • Smart Asset
    • What is a Smart Asset
      What is a Smart Asset
    Smart Asset
  • dApp
    • Creating & Launching dApp
      Creating & Launching dApp
    dApp
  • Articles on Smart Contracts
    Articles on Smart Contracts
  • Tools
    • Waves IDE
      Waves IDE
    • Visual Studio Code Extension
      Visual Studio Code Extension
    • Surfboard
      Surfboard
    • Ride REPL
      Ride REPL
    Tools
  • API & SDK
    • Waves data service API
      Waves data service API
    • Waves Games
      • Waves Games API
        Waves Games API
      • Examples
        Examples
      Waves Games
    API & SDK
  • Client libraries
    • Signer
      Signer
    • PyWaves
      PyWaves
    • WavesJ
      WavesJ
    • WavesCS
      WavesCS
    • WavesC
      WavesC
    • GoWaves
      GoWaves
    • WavesRS
      WavesRS
    • Waves transactions
      Waves transactions
    • Community libraries
      Community libraries
    Client libraries
      • English
      • Русский
      On this page
      waves_logo Docs

          # waves-transactions

          Using this library you can easily create and sign transactions for Waves blockchain.
          It also allows you to multi-sign existing transactions or create them without signature at all.

          This library is a set of transaction constructing functions:

          • Alias
          • Issue
          • Reissue
          • Burn
          • Lease
          • Cancel lease
          • Transfer
          • Mass transfer
          • Set script
          • Data
          • Sponsorship
          • Set asset script
          • InvokeScript
          • Order

          Check full documentation on GitHub Pages .

          # Transactions

          The idea is really simple - you create transaction and sign it from a minimal set of required params.
          If you want to create Transfer transaction the minimum you need to provide is amount and recipient as defined in Transfer params:

          const { transfer } = require('@waves/waves-transactions')
          const seed = 'some example seed phrase'
          const signedTranserTx = transfer({ 
            amount: 1,
            recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
            //Timestamp is optional but it was overrided, in case timestamp is not provided it will fallback to Date.now(). You can set any oftional params yourself. go check full docs
            timestamp: 1536917842558 
          }, seed)
          

          Output will be a signed transfer transaction:

          {
            id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
            type: 4,
            version: 2,
            recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
            attachment: undefined,
            feeAssetId: undefined,
            assetId: undefined,
            amount: 1,
            fee: 100000,
            senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
            timestamp: 1536917842558,
            proofs: [
              '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE'
            ]
          }
          

          You can also create transaction, but not sign it:

          const unsignedTransferTx = transfer({ 
            amount: 1,
            recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
            //senderPublicKey is required if you omit seed
            senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq' 
          })
          

          Now you are able to POST it to Waves API or store for future purpose or you can add another signature from other party:

          const otherPartySeed = 'other party seed phrase'
          const transferSidnedWithTwoParties = transfer(signedTranserTx, seed)
          

          So now there are two proofs:

          {
            id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',
            type: 4,
            version: 2,
            recipient: '3P6fVra21KmTfWHBdib45iYV6aFduh4WwC2',
            attachment: undefined,
            feeAssetId: undefined,
            assetId: undefined,
            amount: 1,
            fee: 100000,
            senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',
            timestamp: 1536917842558,
            proofs: [
              '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE',
              'CM9emPzpe6Ram7ZxcYax6s7Hkw6698wXCMPSckveFAS2Yh9vqJpy1X9nL7p4RKgU3UEa8c9RGXfUK6mFFq4dL9z'
            ]
          }
          
          WavesRS
          Community libraries
          WavesRS
          Community libraries