{"id":15659890,"url":"https://github.com/brunobar79/eth-commerce","last_synced_at":"2025-05-05T03:23:17.485Z","repository":{"id":47371484,"uuid":"121818026","full_name":"brunobar79/eth-commerce","owner":"brunobar79","description":"Javascript library to accept ethereum payments on any website","archived":false,"fork":false,"pushed_at":"2022-12-04T23:26:43.000Z","size":3788,"stargazers_count":22,"open_issues_count":6,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-19T09:58:36.936Z","etag":null,"topics":["blockchain","crypto","cryptocurrency","dapp","ethereum","javascript","metamask","payments","web3"],"latest_commit_sha":null,"homepage":"https://www.eth-commerce.com","language":"CSS","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brunobar79.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-17T01:24:00.000Z","updated_at":"2024-10-04T16:10:20.000Z","dependencies_parsed_at":"2023-01-23T16:45:16.243Z","dependency_job_id":null,"html_url":"https://github.com/brunobar79/eth-commerce","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobar79%2Feth-commerce","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobar79%2Feth-commerce/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobar79%2Feth-commerce/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brunobar79%2Feth-commerce/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brunobar79","download_url":"https://codeload.github.com/brunobar79/eth-commerce/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252430485,"owners_count":21746667,"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":["blockchain","crypto","cryptocurrency","dapp","ethereum","javascript","metamask","payments","web3"],"created_at":"2024-10-03T13:19:32.083Z","updated_at":"2025-05-05T03:23:17.452Z","avatar_url":"https://github.com/brunobar79.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"http://www.eth-commerce.com/images/logo-big.png\" width=\"280\"\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eETHcommerce\u003c/h1\u003e\n\nPeer to Peer (P2P) transactions between you and your customers.\nThis means that you pay ZERO FEES, all this powered by a lightweight (~30kb) and easy to integrate Javascript library\n\nYou can find usage examples [here](http://www.eth-commerce.com/example/) \n\n[Available on NPM](https://www.npmjs.com/package/eth-commerce)\n\n## Installation\n\n```\nnpm install eth-commerce --save\n```\n\n## Usage\n\n```js\nconst ethCommerce = new EthCommerce();\nethCommerce.render(\n    {\n        targetElement: 'pay-button',\n        type: 'PAY',\n        amount: 10,\n        currency: 'USD',\n        address: '0x11A7Ca870700f284e4647E55DeD9040f0F86D4D4'\n    }, (e)=\u003e{\n        console.log('error callback', e);\n    },(tx)=\u003e{\n        console.log('success callback', tx);\n    }\n);\n```\n\n## Methods\n\n### render(options, errorCallback, successCallback)\n\noptions, errorCallback and successCallback are required\n\nRenders a button based on the options and executes the corresponding callbacks after placing and confirm transaction\n\n### getEtherPriceIn(currency)\n\nReturns a promise with the current ethereum value in the corresponding currency.\nExample values for currency are (USD, EUR, CNY, JPY, etc.)\n\n### sendTransaction(account, address, amount)\n\nReturns a promise after sending a transaction from the available account in web3 (account) to address with the corresponding amount\n\n### waitForConfirmation(tx, minConfirmations, interval)\n\nKeeps polling the current block every ${interval} seconds until receiving ${minConfirmations}\nThen executes the success callback\n\n## TODO LIST:\n\n- [ ] Add support for React Native\n- [ ] Add tests\n- [ ] Store the current state in localStorage to be able to restore it in case of page reload\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobar79%2Feth-commerce","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrunobar79%2Feth-commerce","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrunobar79%2Feth-commerce/lists"}