{"id":15678043,"url":"https://github.com/austintgriffith/burner-provider","last_synced_at":"2025-10-15T02:16:05.915Z","repository":{"id":35047896,"uuid":"199687441","full_name":"austintgriffith/burner-provider","owner":"austintgriffith","description":"Ephemeral key pair web3 provider","archived":false,"fork":false,"pushed_at":"2022-12-09T20:29:56.000Z","size":256,"stargazers_count":12,"open_issues_count":5,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-02T23:16:11.892Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/austintgriffith.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-07-30T16:19:16.000Z","updated_at":"2023-08-29T08:40:37.000Z","dependencies_parsed_at":"2023-01-15T12:43:46.818Z","dependency_job_id":null,"html_url":"https://github.com/austintgriffith/burner-provider","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fburner-provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fburner-provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fburner-provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/austintgriffith%2Fburner-provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/austintgriffith","download_url":"https://codeload.github.com/austintgriffith/burner-provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252798832,"owners_count":21805882,"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-10-03T16:15:32.675Z","updated_at":"2025-10-15T02:16:00.881Z","avatar_url":"https://github.com/austintgriffith.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# burner-provider\n\nEphemeral key pair web3 provider\n\nHere is an [example React app](https://github.com/austintgriffith/burner-provider-example) that uses the burner-provider!\n\n```\nnpm install burner-provider\n```\n\nPass `BurnerProvider` into Web() to initialize:\n```javascript\nimport BurnerProvider from 'burner-provider';\nimport Web3 from 'web3';\nvar web3 = new Web3(new BurnerProvider('http://localhost:8545'));\n```\n\nOR using old `require()` method:\n```javascript\nconst BurnerProvider = require('burner-provider');\nconst Web3 = require('web3');\nvar web3 = new Web3(new BurnerProvider('http://localhost:8545'));\n```\n\nOR using `ethers.js`:\n```javascript\nconst BurnerProvider = require('burner-provider');\nconst ethers = require('ethers');\nlet provider = new ethers.providers.Web3Provider(new BurnerProvider('http://localhost:8545'));\n```\n\nYou can get your address with:\n```javascript\nlet accounts = await web3.eth.getAccounts()\n```\n\nNow your transactions will automatically sign and send:\n```javascript\nvar tx = {\n  to: this.state.to,\n  from: this.state.accounts[0],\n  value: this.state.value,\n  data: '0x00'\n}\n\nweb3.eth.sendTransaction(tx).then((receipt)=\u003e{\n  console.log(\"receipt\",receipt)\n  this.setState({receipt:receipt})\n});\n```\n\nYou also can access the private key directly with:\n```javascript\nlocalStorage.getItem('metaPrivateKey')\n```\n\nOptional Parameters:\n```javascript\nvar web3 = new Web3(new BurnerProvider({\n  rpcUrl: 'http://localhost:8545',\n  namespace: 'YourCoolUrl'\n}));\n```\n\nWebsockets work too:\n```javascript\nvar web3 = new Web3(new BurnerProvider('wss://mainnet.infura.io/ws'));\n```\n\nYou can generate your wallet from a mnemonic and optional index too:\n```javascript\nvar web3 = new Web3(new BurnerProvider({\n    rpcUrl: 'http://localhost:8545',\n    mnemonic: 'the bear is sticky with honey'\n}));\n```\n\n-----------------------------------\n\nFull CLI Example:\n`index.js`:\n```javascript\nvar Web3 = require('web3');\nvar BurnerProvider = require('./index.js')\n\n// you can pass in just the RPC endpoint:\n//var web3 = new Web3(new BurnerProvider('http://localhost:8545'));\n//\n//or you can even pass in a pk:\n//var web3 = new Web3(new BurnerProvider({\n//    rpcUrl: 'wss://mainnet.infura.io/ws',\n//    privateKey: '0xc0745ca88cdcb802a30ba467850e19019f8e7354eecc5ab674d78452e4feab84'\n//}));\n//or you can pass it a websocket:\nvar web3 = new Web3(new BurnerProvider('wss://mainnet.infura.io/ws'));\n\n\nconsole.log(web3.version)\nweb3.eth.getBlockNumber().then(console.log);\nweb3.eth.getAccounts().then((accounts)=\u003e{\n    console.log(\"Accounts:\",accounts)\n    web3.eth.getBalance(accounts[0]).then((balance)=\u003e{\n        console.log(\"balance:\",balance)\n        web3.eth.sign(web3.utils.utf8ToHex(\"Hello world\"),accounts[0]).then((sig)=\u003e{\n            console.log(\"SIG:\",sig)\n            web3.currentProvider.stop()\n        });\n    })\n});\n```\n\n```bash\nnpm install web3 burner-provider\nnode index.js\n```\n\n![image](https://user-images.githubusercontent.com/2653167/62563225-cb9c9d80-b83f-11e9-8496-b590226ef192.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustintgriffith%2Fburner-provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faustintgriffith%2Fburner-provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faustintgriffith%2Fburner-provider/lists"}