{"id":23263156,"url":"https://github.com/wavesplatform/waves-games","last_synced_at":"2025-06-13T03:03:19.508Z","repository":{"id":46939791,"uuid":"150712534","full_name":"wavesplatform/waves-games","owner":"wavesplatform","description":null,"archived":false,"fork":false,"pushed_at":"2023-01-03T15:17:07.000Z","size":1330,"stargazers_count":5,"open_issues_count":15,"forks_count":12,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-05-29T10:39:36.443Z","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":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-28T08:52:05.000Z","updated_at":"2022-07-09T23:26:11.000Z","dependencies_parsed_at":"2023-02-01T07:01:16.824Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/waves-games","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wavesplatform/waves-games","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-games","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-games/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-games/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-games/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/waves-games/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-games/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259571640,"owners_count":22878182,"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","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-12-19T14:15:01.173Z","updated_at":"2025-06-13T03:03:19.253Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# WAVES ITEMS\n## Items Protocol\nThe Items protocol is supported on the Waves blockchain by convention. Namely speaking it is a set of rules and transaction format restrictions. There is no specific capabilities or checks for an item format on Waves blockchain itself. Items protocol convention is a subject to change. For now it operates with **version 1**. Waves team will put their best efforts to provide backward compatibility is case of future changes.\n\nNow let's take a look on how everything woks.\n\nTo represent an item on Waves blockchain you should submit **two** transactions with a specific format. \n\n### 1. Issue transaction\nThe first one is issue transaction. It describes an asset - a primitive consensus entity, which will represent an item on the Waves blockchain.\n\nLet's look at the issue transaction that follows the Waves items protocol:\n```js\n{\n  id: '8GyBZQjQ8GSpxvs9FWnu7MCCUzfJ45oVJQQb3ivLoA17',\n  type: 3,\n  version: 2,\n  name: 'ITEM',\n  description: '',\n  quantity: 100,\n  script: undefined,\n  decimals: 0,\n  reissuable: false,\n  fee: 100000000,\n  timestamp: 1562248791746,\n  chainId: 84,\n  senderPublicKey: '4Gqd2YuaCMh4PM6nVt33NJbETWMkJ5sHerJQCcd4Fbhe',\n  proofs: ['4HkJ5TLM7HFzuiLYrY7CTyoTXcNSVs4tBiMo2Jud7be6rF14Ja9AA2qujFwhFA3WGeRw2QxvuSnc3fceMXNBJpXs']\n}\n```\n\nThis is a standard issue transaction with an extra restrictions:\n- *name* should be **ITEM**\n- *description* should be **empty**\n- *script* should be **undefined**\n- *decimals* should be **0**\n- *reissuable* should be **false**\n\nYou can broadcast transactions to Waves blockchain via node REST API using \n**/transactions/broadcast** endpoint. You can read more about node api and play around with it using public Waves node [mainnet](https://nodes.wavesnodes.com) or [testnet](https://testnodes.wavesnodes.com) pools.\n\n### 2. Data transaction\nThe second transaction is **Data transaction**. It describes the particular in-game item and holds all the metadata that particular game will use. This data transaction must be sourced from the same account.\n\nHere is data transaction example that should follow the issue transaction from the first section: \n\n```js\n{\n  id: 'DJadLmeQkcU4f7eGdXAqnSoKwLJbpZ3eXRMJSVcbnGT6',\n  type: 12,\n  version: 1,\n  data: [{\n      type: 'string',\n      key: '8GyBZQjQ8GSpxvs9FWnu7MCCUzfJ45oVJQQb3ivLoA17',\n      value: '{\"version\":1,\"name\":\"The sword of pain\",\"imageUrl\":\"https://i.pinimg.com/originals/02/c0/46/02c046b9ec76ebb3061515df8cb9f118.jpg\",\"misc\":{\"damage\":22,\"power\":13}}'\n  }]\n  fee: 100000,\n  timestamp: 1562248791771,\n  senderPublicKey: '4Gqd2YuaCMh4PM6nVt33NJbETWMkJ5sHerJQCcd4Fbhe',\n  proofs: ['4i4e4cCvTajmSUFonzeRGhMNxHMX5S5E3jaq1fDdJ7svC74vspRm8ZPSMX3zdx7AfZ51A85HMZj6ywrENuZxTKcK'],\n}\n```\nThis is a standard data transaction with an extra restrictions:\n- *data key* should equal to **issue transaction ID**\n- *data value* should be a serialised **JSON string with an Item payload object**\n\n#### Item payload\nItem payload is an convention entity that has the following format:\n\n```json\n{\n  \"version\": 1,\n  \"name\": \"The sword of pain\",\n  \"imageUrl\": \"https://i.pinimg.com/originals/02/c0/46/02c046b9ec76ebb3061515df8cb9f118.jpg\",\n  \"misc\": {\n    \"damage\": 22,\n    \"power\": 13\n  }\n}\n```\nIt describes the item and may contain the optional **misc** field with the item properties.\n\nLuckily you have no need to build and broadcast transactions yourself, instead you may use a dedicated npm-package **@waves/waves-games** for this.\n\n\n## @waves/waves-games\n\n#### Installation\n```\nnpm i @waves/waves-games \n```\n\n#### Create an item\n```ts\nimport { wavesItemsApi } from '@waves/waves-games'\nconst seed = 'my secret backend seed'\n\nasync function createItem() {\n  const items = wavesItemsApi('T') //testnet, use 'W' for mainnet\n  const item = await items\n    .createItem({\n      version: 1,\n      quantity: 100,\n      name: 'The sword of pain',\n      imageUrl: 'https://i.pinimg.com/originals/02/c0/46/02c046b9ec76ebb3061515df8cb9f118.jpg',\n      misc: {\n        damage: 22,\n        power: 13,\n      },\n    }).broadcast(seed)\n  console.log(item)\n}\ncreateItem()\n```\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-games","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fwaves-games","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-games/lists"}