{"id":13772689,"url":"https://github.com/wavesplatform/waves-transactions","last_synced_at":"2025-08-20T18:34:58.753Z","repository":{"id":33832722,"uuid":"158679237","full_name":"wavesplatform/waves-transactions","owner":"wavesplatform","description":"Build and sign(multi-sign) transactions for Waves blockchain.","archived":false,"fork":false,"pushed_at":"2024-02-06T15:22:24.000Z","size":5681,"stargazers_count":32,"open_issues_count":22,"forks_count":28,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-07T13:06:02.687Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.MD","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-22T10:05:37.000Z","updated_at":"2025-01-28T23:46:53.000Z","dependencies_parsed_at":"2024-06-18T15:17:58.119Z","dependency_job_id":"0fe43445-86c5-4ee2-ae3a-86ab64742e9d","html_url":"https://github.com/wavesplatform/waves-transactions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/wavesplatform/waves-transactions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-transactions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-transactions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-transactions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-transactions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/waves-transactions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-transactions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271363903,"owners_count":24746789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T17:01:06.922Z","updated_at":"2025-08-20T18:34:58.254Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# waves-transactions  [![npm version](https://badge.fury.io/js/%40waves%2Fwaves-transactions.svg)](https://badge.fury.io/js/%40waves%2Fwaves-transactions)\n\n[![License][license-image]][license-url]\n\n[license-url]: https://opensource.org/licenses/MIT\n[license-image]: https://img.shields.io/npm/l/make-coverage-badge.svg\n\nUsing this library you can easily create and sign transactions for Waves blockchain.\nIt also allows you to multi-sign existing transactions or create them without signature at all.\n\n- [Transactions](#Transactions) \n  - [Creation](#Creation)\n  - [Signing](#Signing)\n  - [Params](#Params)\n- [Orders](#Orders)\n- [Broadcast](#Broadcast)\n- [Dependencies](#Dependencies)\n## Transactions\n\n### Creation\n\nTransactions are created via transaction creating functions. There are 15 of them:\n```typescript\nconst {\n alias, burn, cancelLease, data, exchange,\n invokeScript, issue, lease, massTransfer, reissue,\n setAssetScript, setScript, sponsorship, transfer, updateAssetInfo\n} = require('@waves/waves-transactions')\n```\nExample:\n```typescript\nconst issueTx = issue({\n  name: 'foo',\n  description: 'bar',\n  quantity: 10000,\n  senderPublicKey: 'GucCLYU7aqzcVUwVXX4nosceDisky9UpbmpFK39tVYom',\n  chainId: 'T'\n})\nconst burnTx = burn({\n  assetId: '6toKooURvF3CpRQV8hzhNbHjK3Rb3L9Krd7TFnzcoe8L',\n  senderPublicKey: 'GucCLYU7aqzcVUwVXX4nosceDisky9UpbmpFK39tVYom',\n  chainId: 'T'\n})\n```\n### Signing\nYou can provide seed or private key to transaction creating function to sign it. If you do, senderPublicKey can be omitted.\n```typescript\nconst signedTranfer = transfer({\n    recipient:'3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n    amount: 100000}, 'secret seed phraze'\n)\nconst signedTranferViaPrivateKey = transfer({\n    recipient:'3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n    amount: 100000}, {privateKey: 'GucCLYU7aqzcVUwVXX4nosceDisky9UpbmpFK39tVYom'}\n)\n```\n\n### Params\nType LONG represents string or number. Strings are allowed since max js int is 2**53\n#### Common params:\nPresent in all transactions\n```typescript\ninterface IBasicParams\u003cLONG = string | number\u003e {\n  /**\n   * Transaction fee. If not set, fee will be calculated automatically\n   */\n  fee?: LONG\n  /**\n   * If fee is not set, this value will be added to automatically calculated fee. E.x.:\n   * Account is scripted and 400000 fee more is required.\n   */\n  additionalFee?: number\n  /**\n   * If not set, public key will be derived from seed phrase. You should provide senderPublicKey in two cases:\n   * 1. Account, from which this tx should be sent, differs from tx signer. E.g., we have smart account that requires 2 signatures.\n   * 2. You to create tx without proof. Therefore no seed is provided.\n   */\n  senderPublicKey?: string\n  /**\n   * Transaction timestamp. If not set current timestamp will be used. Date.now()\n   */\n  timestamp?: number\n  /**\n   * Network byte. Could be set as number or as char.\n   * If set as char(string), charCodeAt(0) will be used. E.g.,\n   * 'W' will be converted to '87'\n   * If not set, 87 will be used as default\n   */\n  chainId?: string | number\n}\n```\n\n#### Issue transaction. Type 3\n```typescript\nexport interface IIssueParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  name: string\n  description: string\n  quantity: LONG\n  decimals?: number\n  reissuable?: boolean\n  script?: string\n}\n```\n#### Transfer transaction. Type 4\n```typescript\nexport interface ITransferParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  /**\n   * Can be either address(base58 encoded 24 byte address) or alias.\n   * Alias should be used like 'alias:{chainId}:{alias}\u003e'. E.g.:\n   * If we have alias 'foo', and we want TESTNET transaction, recipient should be 'alias:T:foo'\n   */\n  recipient: string\n  amount: LONG\n  assetId?: string | null\n  /**\n   * Fee can be paid in custom token if sponsorship has been set for this token\n   */\n  feeAssetId?: string | null\n  /**\n   * Bytearray encoded as base58 string\n   */\n  attachment?: string | TTypedData\n}\n```\n#### Reissue transaction. Type 5\n```typescript\nexport interface IReissueParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  assetId: string\n  quantity: LONG\n  reissuable: boolean\n}\n```\n#### Burn transaction. Type 6\n```typescript\nexport interface IBurnParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  assetId: string\n  quantity: LONG\n}\n```\n#### Exchange transaction. Type 7\nExchange transactions are used by DEX mather. If you want to create your own exchange transaction,\n there is no params. You need to construct it by hand(see interface below, IOrder is described in Order section) \n```typescript\nexport interface IExchangeTransaction\u003cLONG = string | number\u003e extends ITransaction\u003cLONG\u003e {\n  type: 7\n  order1: IOrder\n  order2: IOrder\n  price: LONG\n  amount: LONG\n  buyMatcherFee: LONG\n  sellMatcherFee: LONG\n}\n```\n#### Lease transaction. Type 8\n```typescript\nexport interface ILeaseParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  recipient: string\n  amount: LONG\n}\n```\n#### CancelLease transaction. Type 9\n```typescript\nexport interface ICancelLeaseParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  leaseId: string\n}\n```\n#### Alias transaction. Type 10\n```typescript\nexport interface IAliasParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  alias: string\n}\n```\n#### MassTransfer transaction. Type 11\n```typescript\nexport interface IMassTransferParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  transfers: IMassTransferItem[]\n  /**\n   * Bytearray encoded as base string\n   */\n  attachment?: string | TTypedData\n  assetId?: string | null\n}\n\nexport interface IMassTransferItem\u003cLONG = string | number\u003e {\n  recipient: string\n  amount: LONG\n}\n```\n#### Data transaction. Type 12\n```typescript\nexport interface IDataParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  data: Array\u003cIBooleanData | IIntegerData | IStringData | IBinaryData| TDeleteRequest\u003e\n}\nexport type TDeleteRequest = {\n  type?: null\n  value?: null\n  key: string\n}\n\nexport interface IBooleanData {\n  key: string\n  type: 'boolean'\n  value: boolean\n}\nexport interface IIntegerData\u003cLONG = string | number\u003e {\n  key: string\n  type: 'integer'\n  value: LONG\n}\nexport interface IStringData {\n  key: string\n  type: 'string'\n  value: string\n}\nexport interface IBinaryData {\n  key: string\n  type: 'binary'\n  value: string\n}\n\n\n```\n#### SetScript transaction. Type 13\n```typescript\nexport interface ISetScriptParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  /**\n   * Compiled script encoded as base64 string\n   */\n  script: string | null\n}\n```\n#### Sponsorship transaction. Type 14\n```typescript\nexport interface ISponsorshipParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  /**\n   * AssetID of sponsored token\n   */\n  assetId: string\n  /**\n   * Minimal fee amount in sponsored asset. To disable sponsorship set it to 0\n   */\n  minSponsoredAssetFee: LONG\n}\n```\n#### SetAssetScript transaction. Type 15\n```typescript\nexport interface ISetAssetScriptParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  /**\n   * Compiled script encoded as base64 string\n   */\n  script: string\n  assetId: string\n}\n```\n#### InvokeScript transaction. Type 16\n```typescript\nexport interface IInvokeScriptParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  dApp: string\n  feeAssetId?: string | null\n  call?: {\n    function: string\n    args?: {\n      type: 'binary' | 'integer' | 'boolean' | 'string',\n      value: string | LONG | boolean\n    }[]\n  },\n  payment?: {\n    assetId?: string | null\n    amount: LONG\n  }[]\n}\n```\n#### UpdateAssetInfo transaction. Type 17\n```typescript\nexport interface IUpdateAssetInfoParams\u003cLONG = string | number\u003e extends IBasicParams\u003cLONG\u003e {\n  /**\n   * Id of previously issued asset\n   */\n  assetId: string\n  /**\n   * New asset name\n   */\n  name: string\n  /**\n   * New asset description\n   */\n  description: string\n}\n```\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nIf you want to create  the minimum you need to provide is **amount** and **recipient** as defined in Transfer params:\n```js\n\nconst { transfer } = require('@waves/waves-transactions')\nconst seed = 'some example seed phrase'\nconst signedTranserTx = transfer({ \n  amount: 1,\n  recipient: '3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n  //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\n  timestamp: 1536917842558 \n}, seed)\n\n// or using alias\n\nconst signedTranserTx = transfer({ \n  amount: 1,\n  recipient: 'alias:W:aliasForMyAddress'\n}, seed)\n```\n\nOutput will be a signed transfer transaction:\n```js\n{\n  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',\n  type: 4,\n  version: 2,\n  recipient: '3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n  attachment: undefined,\n  feeAssetId: undefined,\n  assetId: undefined,\n  amount: 1,\n  fee: 100000,\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',\n  timestamp: 1536917842558,\n  proofs: [\n    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE'\n  ]\n}\n```\n\nYou can also create transaction, but not sign it:\n```javascript\nconst unsignedTransferTx = transfer({ \n  amount: 1,\n  recipient: '3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n  //senderPublicKey is required if you omit seed\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq' \n})\n```\n\nNow you are able to POST it to Waves API or store for future purpose or you can add another signature from other party:\n```js\nconst otherPartySeed = 'other party seed phrase'\nconst transferSignedWithTwoParties = transfer(signedTranserTx, seed)\n```\n\nSo now there are two proofs:\n```js\n{\n  id: '8NrUwgKRCMFbUbqXKQAHkGnspmWHEjKUSi5opEC6Havq',\n  type: 4,\n  version: 2,\n  recipient: '3N4mLCaHq2twRKnbUjdvAHyXjoccQE9KDRE',\n  attachment: undefined,\n  feeAssetId: undefined,\n  assetId: undefined,\n  amount: 1,\n  fee: 100000,\n  senderPublicKey: '6nR7CXVV7Zmt9ew11BsNzSvVmuyM5PF6VPbWHW9BHgPq',\n  timestamp: 1536917842558,\n  proofs: [\n    '25kyX6HGjS3rkPTJRj5NVH6LLuZe6SzCzFtoJ8GDkojY9U5oPfVrnwBgrCHXZicfsmLthPUjTrfT9TQL2ciYrPGE',\n    'CM9emPzpe6Ram7ZxcYax6s7Hkw6698wXCMPSckveFAS2Yh9vqJpy1X9nL7p4RKgU3UEa8c9RGXfUK6mFFq4dL9z'\n  ]\n}\n```\n\n### Orders\nOrder is created the same way as transaction\n```typescript\nconst { order } = require('@waves/waves-transactions')\nconst params = {\n    amount: 100000000, //1 waves\n    price: 10, //for 0.00000010 BTC\n    priceAsset: '8LQW8f7P5d5PZM7GtZEBgaqRPGSzS3DfPuiXrURJ4AJS',\n    matcherPublicKey: '7kPFrHDiGw1rCm7LPszuECwWYL3dMf6iMifLRDJQZMzy',\n    orderType: 'buy'\n}\n  \nconst signedOrder = order(params, 'Some seed ')\n```\n### Broadcast\nTo send transaction you can use either node [REST API](https://nodes.wavesplatform.com/api-docs/index.html#!/transactions/broadcast) or [broadcast](https://wavesplatform.github.io/waves-transactions/globals.html#broadcast) helper function:\n```javascript\nconst {broadcast} =  require('@waves/waves-transactions');\nconst nodeUrl = 'https://nodes.wavesplatform.com';\n\nbroadcast(signedTx, nodeUrl).then(resp =\u003e console.log(resp))\n```\nYou can send tx to any waves node you like:. E.g.:\n* https://nodes-testnet.wavesnodes.com - waves TESTNET nodes hosted by Wavesplatform\n* https://nodes.wavesplatform.com - waves MAINNET nodes hosted by Wavesplatform\n#### Important!!!\nMost transactions require chainId as parameter, e.g: [IBurnParams](https://wavesplatform.github.io/waves-transactions/interfaces/_transactions_.iburnparams.html). By default chainId is 'W', which means MAINNET. To make transaction in TESTNET be sure to pass chainId if it is present in params interface and then send it to TESTNET node\n\n### Dependencies\nThis library uses `@waves/ts-lib-crypto` for cryptography and `@waves/node-api-js` for interacting with node. \nYou can access them this way:\n```typescript\nconst libCrypto = require('@waves/waves-transactions').libs.crypto\nconst libApi = require('@waves/waves-transactions').libs.nodeApiJs\n```\n","funding_links":[],"categories":["Frameworks and tools"],"sub_categories":["Client libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-transactions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fwaves-transactions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-transactions/lists"}