{"id":23263184,"url":"https://github.com/wavesplatform/node-state","last_synced_at":"2025-08-20T18:35:04.208Z","repository":{"id":50091061,"uuid":"221907932","full_name":"wavesplatform/node-state","owner":"wavesplatform","description":null,"archived":false,"fork":false,"pushed_at":"2021-06-04T15:19:23.000Z","size":123,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-07T19:40:19.361Z","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":"2019-11-15T11:12:25.000Z","updated_at":"2022-02-15T20:11:57.000Z","dependencies_parsed_at":"2022-08-03T18:45:28.846Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/node-state","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wavesplatform/node-state","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fnode-state","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fnode-state/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fnode-state/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fnode-state/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/node-state/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fnode-state/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271363906,"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-12-19T14:15:12.537Z","updated_at":"2025-08-20T18:35:03.893Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"## Library for create unit test with WAVESPLATFORM node\n\n### install\n\n`npm install @waves/node-state -D`\n\n### Usage\n\n#### cli:\n`node-state -n -e -o ./state.json` or `node-state -n -e -o -m typescript ./state.ts`\n\n```bash\nOptions:\n  --help          Show help                                            [boolean]\n  --version       Show version number                                  [boolean]\n  --out, -o       Out of result                              [string] [required]\n  --config, -c    Path to config file                                   [string]\n  --mode, -m      Compile mode [choices: \"json\", \"typescript\"] [default: \"json\"]\n  --node, -n      Need up node (port 6869)                             [boolean]\n  --explorer, -e  Need up explorer (port 3000)                         [boolean]\n```\n\n### Usage example\n\n#### Step 1. Up the node and create the state\n`node-state -n -m typescript -o ./tests/state.ts`;\n#### Step 2. Write some tests with some test framework\n```typescript\nimport { NODE_URL, STATE, CHAIN_ID, MASTER_ACCOUNT } from './test/state.ts';\nimport { transfer, broadcast, waitForTx } from '@waves/waves-transactions';\n\n\nit('Create transfer transaction', async () =\u003e {\n    const tx = transfer({ \n        recipient: `alias:${CHAIN_ID}:${MASTER_ACCOUNT.ALIAS}`,\n        amount: 1000\n    }, STATE.ACCOUNTS.SIMPLE.seed);\n    await broadcast(tx);\n    await waitForTx(tx.id, { apiBase: NODE_URL }); // Transaction broadcast success!\n});\n```\n\n#### Example of output file (test/state.ts) in typescript:\n```typescript\nexport const MASTER_ACCOUNT = {\n    \"SEED\": \"waves private node seed with waves tokens\",\n    \"ADDRESS\": \"3M4qwDomRabJKLZxuXhwfqLApQkU592nWxF\",\n    \"PUBLIC_KEY\": \"AXbaBkJNocyrVpwqTzD4TpUY8fQ6eeRto9k1m2bNCzXV\",\n    \"ALIAS\": \"master\"\n};\nexport const NODE_URL = \"http://localhost:6869\";\nexport const CHAIN_ID = \"R\";\nexport const NETWORK_BYTE = 82;\n\nexport const STATE = {\n    \"ACCOUNTS\": {\n        \"FOR_SCRIPT\": {\n            \"seed\": \"yellow pulp memory brick mimic myself hungry amount canal crop service stuff bachelor pilot mention\",\n            \"address\": \"3MPXEgRCmT5cdsFKkq9x5mbiT3oCQ4ZjYw5\",\n            \"publicKey\": \"AZkHyW5o11h2RerR2e7tF4mRUZED5aAW33sHAAAkseKY\",\n            \"scripted\": true\n        }\n    },\n    \"ASSETS\": {\n        \"BTC\": {\n            \"type\": 3,\n            \"version\": 2,\n            \"senderPublicKey\": \"AXbaBkJNocyrVpwqTzD4TpUY8fQ6eeRto9k1m2bNCzXV\",\n            \"name\": \"WBTC\",\n            \"description\": \"WBTC description\",\n            \"quantity\": 100000000000000,\n            \"decimals\": 8,\n            \"reissuable\": false,\n            \"fee\": 100000000,\n            \"timestamp\": 1573820086719,\n            \"chainId\": 82,\n            \"proofs\": [\n                \"5YJF6zKSqMN315phAGDhT2fiKyHkZF3j46YAkwXM4f2THdjw4KFSmvbA5omi12ybWpBuqryJLbC9MdCDNSpRDyYg\"\n            ],\n            \"id\": \"DEtwtnL41USBmnoU4UN1rqhHGBKvLLqpH483TV6GK4Sy\"\n        },\n    }\n};\n```\n\n#### Example of output file (test/state.json) in json:\n```json\n{\n  \"ACCOUNTS\": {\n    \"FOR_SCRIPT\": {\n      \"seed\": \"usual scatter episode relax spy subway tuna around define expect kit wall cupboard list one\",\n      \"address\": \"3M2a7rdLCfStGjMJVQjmiTYCZUdgs7eYkkR\",\n      \"publicKey\": \"BsmaQyjqTmMX4mNoYo9RzV9H8GWtMJb6WPcgB2MNRzBU\",\n      \"scripted\": true\n    }\n  },\n  \"ASSETS\": {\n    \"BTC\": {\n      \"type\": 3,\n      \"version\": 2,\n      \"senderPublicKey\": \"AXbaBkJNocyrVpwqTzD4TpUY8fQ6eeRto9k1m2bNCzXV\",\n      \"name\": \"WBTC\",\n      \"description\": \"WBTC description\",\n      \"quantity\": 100000000000000,\n      \"decimals\": 8,\n      \"reissuable\": false,\n      \"fee\": 100000000,\n      \"timestamp\": 1573820268769,\n      \"chainId\": 82,\n      \"proofs\": [\n        \"nMtaXPFnAAasKhryqbwVco2SHro87X5vsDAwQmBjpprPaG3DVRSfQrNUKjAf3ejQatxQqSEkFCfPdEa74ALomM9\"\n      ],\n      \"id\": \"EeojFwKrozm9mpHvmYt6N5qnwhGTo8ztXpxogcHHYw8s\"\n    },\n    \"MASTER_ACCOUNT\": {\n      \"SEED\": \"waves private node seed with waves tokens\",\n      \"ADDRESS\": \"3M4qwDomRabJKLZxuXhwfqLApQkU592nWxF\",\n      \"PUBLIC_KEY\": \"AXbaBkJNocyrVpwqTzD4TpUY8fQ6eeRto9k1m2bNCzXV\",\n      \"ALIAS\": \"master\"\n    },\n    \"NODE_URL\": \"http://localhost:6869\",\n    \"CHAIN_ID\": \"R\",\n    \"NETWORK_BYTE\": 82\n  }\n}\n```\n\n### Custom config properties\n\n```json5\n{\n    // Assets for deploy to node state\n    \"ASSETS\": {\n        \"BTC\": {                               \n            // Required. Name of asset\n            \"name\": \"Asset name\",\n            // Optional. Description of asset        \n            \"description\": \"Asset description\",\n            // Optional. Decimals of asset. Default 8\n            \"decimals\": 4,\n            // Optional. Quantity of asset coins. Default 100000000000000\n            \"quantity\": 100,\n            // Optional. Reissuable of asset. Default true\n            \"reissuable\": true\n        }\n    },\n    \"ACCOUNTS\": {\n        // Account name for usage from tests\n        \"FOR_SCRIPT\": {\n            // Optional. Script for deploy to account. Choices [boolean or \"dApp\" or base64 string]\n            \"script\": \"dApp\",\n            // Optional. Create alias for account\n            \"alias\": true,\n            // Optional. Balance for account\n            \"balance\": {\n                // Hash with key in Key of ASSETS and value is coins of asset\n                \"BTC\": 10000000\n            },\n            // Optional. Data state for account. Not supported, in development.\n            \"data\": {\n                // Key of data state\n                \"someKey\": {\n                    // Type of field. Can be \"integer\" of \"binary\" of \"boolean\" or \"string\"\n                    \"type\": \"integer\",\n                    // Value for data state\n                    \"value\": 1000\n                }   \n            }\n        }\n    }\n}\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fnode-state","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fnode-state","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fnode-state/lists"}