{"id":23263174,"url":"https://github.com/wavesplatform/waves-repl","last_synced_at":"2025-08-20T18:35:05.243Z","repository":{"id":33768978,"uuid":"148613402","full_name":"wavesplatform/waves-repl","owner":"wavesplatform","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-02T09:58:18.000Z","size":2992,"stargazers_count":4,"open_issues_count":21,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-23T09:16:41.769Z","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-13T09:18:01.000Z","updated_at":"2024-09-20T14:17:36.000Z","dependencies_parsed_at":"2022-09-01T12:02:26.902Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/waves-repl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-repl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-repl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-repl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fwaves-repl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/waves-repl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230214948,"owners_count":18191385,"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:04.398Z","updated_at":"2024-12-19T14:15:05.083Z","avatar_url":"https://github.com/wavesplatform.png","language":"TypeScript","readme":"# REPL\n## About\nThis repository contains javascript console for waves blockchain.\nIt is built on top of [jsconsole](https://github.com/remy/jsconsole) and have predefined functions to work with waves\n## Builtin functions\n#### JS lib\nConsole uses [waves-transactions](https://wavesplatform.github.io/waves-transactions/) library. Top level library functions are bound to console global scope.\nThe difference is that in console, seed argument is equal to env.SEED by default. You need to pass null explicitly if you only want to create transaction and not to sign it\nE.x.:\n##### Console\n```javascript\nconst signedTx = transfer({amount: 100, recipient: '3MyAGEBuZGDKZDzYn6sbh2noqk9uYHy4kjw', senderPublicKey: '8ViwGfvyyN1teUKV4Uvk2orK6XiYB4S4VuM2DqJ9Mj5b'}, null)\n\n//returns tx with no proofs\n{\n  \"type\": 4,\n  \"version\": 2,\n  \"fee\": 100000,\n  \"senderPublicKey\": \"8ViwGfvyyN1teUKV4Uvk2orK6XiYB4S4VuM2DqJ9Mj5b\",\n  \"timestamp\": 1542640481876,\n  \"proofs\": [],\n  \"id\": \"CveeKH16XQcshV5GZP2RXppg3snxcKqRsM4wE5gxcuzc\",\n  \"chainId\": \"T\",\n  \"amount\": 100,\n  \"recipient\": \"3MyAGEBuZGDKZDzYn6sbh2noqk9uYHy4kjw\"\n}\n\n```\n#### Additional functions\nBroadcast signed tx using node from global variable \n```javascript\nconst resp = await broadcast(signedTx)\n```\nDeploy current open contract using node from global variable \n```javascript\nconst resp = deploy()\n```\nSign arbitrary transaction\n```javascript\nconst tx = transfer({amount: 100, recipient: '3MyAGEBuZGDKZDzYn6sbh2noqk9uYHy4kjw', senderPublicKey: '8ViwGfvyyN1teUKV4Uvk2orK6XiYB4S4VuM2DqJ9Mj5b'}, null)\nconst signedTx = signTx(tx)\n```\nCompile contract. Returns base64\n```javascript\nconst compiled = compile(contractText)\n```\nGet contract text by tab name. Used inside web-ide or vscode plugin\n```javascript\nconst contractText = file(tabName)\n```\nGet contract text from currently open tab. Used inside web-ide or vscode plugin\n```javascript\nconst contractText = contract()\n```\n\nKeys\n```javascript\naddress(seed = env.SEED) // Address from seed. \nkeyPair(seed = env.SEED) // Keypair from seed\npublicKey(seed = env.SEED) // Public key from seed\nprivateKey(seed = env.SEED) // Private key from seed\n```\n#### Global object env\n```javascript\nenv.SEED // Default seed\nenv.CHAIN_ID // Default network byte\nenv.API_BASE // Node url \nenv.editors // Open editor tabs info\n```\n## Usage\n### Dev server:\n```npm\nnpm start\n```\nStarts dev server\n### React component\n```typescript jsx\nimport * as React from 'react';\nimport {render} from 'react-dom';\nimport {Repl} from 'waves-repl';\n\nclass App extends React.Component {\n    public consoleRef = React.createRef\u003cRepl\u003e();\n\n    componentDidMount(){\n        // Get console instance\n        const console = this.consoleRef.current!;\n        \n        // Access to console api\n        (global as any)['updateEnv'] = console.updateEnv;\n        (global as any)['API'] = console.API;\n        (global as any)['methods'] = console.methods;\n\n        (global as any)['updateEnv']({\n            SEED: 'abracadabra',\n            API_BASE: 'https://nodes-testnet.wavesnodes.com',\n            CHAIN_ID: 'T',\n            file: () =\u003e 'Placeholder file content'\n        });\n\n    }\n    render(){\n        return \u003cRepl theme=\"dark\" ref={this.consoleRef}/\u003e\n    }\n}\nrender(\u003cApp/\u003e, document.getElementById('root'));\n```\n\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-repl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fwaves-repl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fwaves-repl/lists"}