{"id":22520869,"url":"https://github.com/augmint/augmint-js","last_synced_at":"2025-08-03T20:30:54.641Z","repository":{"id":34605670,"uuid":"180514592","full_name":"Augmint/augmint-js","owner":"Augmint","description":"Augmint javascript library","archived":false,"fork":false,"pushed_at":"2023-01-16T11:01:59.000Z","size":1668,"stargazers_count":3,"open_issues_count":31,"forks_count":0,"subscribers_count":4,"default_branch":"staging","last_synced_at":"2024-11-18T10:57:34.395Z","etag":null,"topics":["augmint","cryptocurrency","dapp","ethereum-dapp","javascript","javascript-library","stablecoin"],"latest_commit_sha":null,"homepage":"https://docs.augmint.org/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Augmint.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-10T06:15:58.000Z","updated_at":"2020-09-18T14:53:34.000Z","dependencies_parsed_at":"2023-02-10T02:45:35.258Z","dependency_job_id":null,"html_url":"https://github.com/Augmint/augmint-js","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Augmint%2Faugmint-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Augmint%2Faugmint-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Augmint%2Faugmint-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Augmint%2Faugmint-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Augmint","download_url":"https://codeload.github.com/Augmint/augmint-js/tar.gz/refs/heads/staging","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228562177,"owners_count":17937234,"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":["augmint","cryptocurrency","dapp","ethereum-dapp","javascript","javascript-library","stablecoin"],"created_at":"2024-12-07T05:08:47.639Z","updated_at":"2024-12-07T05:08:48.870Z","avatar_url":"https://github.com/Augmint.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cspan style=\"display:block;text-align:center\"\u003e![Augmint](https://www.augmint.org/android-chrome-192x192.png)\n\u003c/span\u003e\n\n# Augmint - Stable Digital Tokens - Javascript Library (WIP)\n\n[![Build Status](https://travis-ci.com/Augmint/augmint-js.svg?branch=staging)](https://travis-ci.com/Augmint/augmint-js)\n[![Discord](https://img.shields.io/discord/407574313810788364.svg)](https://discord.gg/PwDmsnu)\n[![license](https://img.shields.io/github/license/Augmint/augmint-js.svg)](https://github.com/Augmint/augmint-js/blob/master/LICENSE) [![Greenkeeper badge](https://badges.greenkeeper.io/Augmint/augmint-js.svg)](https://greenkeeper.io/)\n\nDecentralised stable cryptocurrency on Ethereum\n\n## Concept\n\nDecentralized stablecoins targeted to fiat currencies built on Ethereum.\n\nThe first Augmint token is AEUR.\n\n**1 AEUR ≈ 1 EUR.**\n\n-   Buy and sell AEUR for ETH or EUR.\n-   Get a loan in AEUR by depositing ETH.\n-   Lock AEUR to earn a premium.\n\nTry it: **[https://www.augmint.org](http://www.augmint.org)**\n\n**[Manifesto](https://www.augmint.org/manifesto)**\n\n**[White Paper](http://bit.ly/augmint-wp)**\n\n### Related repos\n\n-   [Web frontend](https://github.com/Augmint/augmint-web)\n-   [augmint-contracts](https://github.com/Augmint/augmint-contracts)\n\n## augmint-js lib\n\nThis lib is heavily under construction. Anything can happen.\n\n### Install\n\n```\nyarn add @augmint/js\n```\n\nor\n\n```\nnpm install @augmint/js\n```\n\n### Example use\n\n```js\nimport { Augmint } from \"@augmint/js\";\n\nlet web3;\n\n// Modern dapp browsers...\nif (window.ethereum) {\n  web3 = new Web3(window.ethereum);\n  await window.ethereum.enable();\n} else if (typeof window.web3 !== \"undefined\") {\n  // Legacy dapp browsers...\n  web3 = new Web3(window.web3.currentProvider);\n} else {\n   // no web3... augmint-js still can be used via Infura websocket connection\n}\n\nlet connectionConfig;\nif (web3) {\n  // For connection via injected provider:\n  connectionConfig = {\n    givenProvider: web3.currentProvider,\n    // We assume that injected Metamask/Trustwallet/Metacoin etc. provider takes care of reconnections\n    ETHEREUM_CONNECTION_CHECK_INTERVAL: 0\n  };\n} else {\n  // For connection via Infura (not passing givenProvider)\n  connectionConfig = {\n    PROVIDER_URL: \"wss://rinkbey.infura.io/ws/v3/\", // or wss://mainnet.infura.io/ws/v3/ or  ws://localhost:8545\n    PROVIDER_TYPE: \"websocket\",\n    INFURA_PROJECT_ID: \"\" // this should come from env.local or hosting env setting\n  };\n}\n\nconst augmint = await Augmint.create(connectionConfig);\n\n// To catch errors you need to use txHash / confirmation / receipt getters:\ntry {\n\nconst tx = augmint.rates.setRate(CCY, rate)\n  // optionally you can sign with a privatekey\n  // .sign(privatekey, {from: \"0x06012c8cf97BEaD5deAe237070F9587f8E7A266d\"} )\n  //\n  // or send it if provider like MetaMask manages the signature for the given sender address\n  .send([{ from: \"0x06012c8cf97BEaD5deAe237070F9587f8E7A266d\" }]) // {from: 0x..} only needed if it's not signed\n  .onceTxHash( txHash =\u003e {.. })\n  .onceReceipt( receipt =\u003e { ...})\n  .onConfirmation( confirmationNumber =\u003e {...}\n  .onceReceiptConfirmed(5, receipt =\u003e {...})\n  .onceTxRevert( (error, receipt) =\u003e { ....});\n\n\n  const txHash = await tx.getTxHash();\n\n  // receipt as soon as we got it (even with 0 confirmation):\n  const txReceipt = await tx.getReceipt();\n\n  // receipt after x confirmation:\n  const confirmedReceipt = await tx.getConfirmedReceipt(12);\n\n} catch (error) {\n  // .send / sign throwing or rejecting with sending errors but not when tx reverts!\n  // Also, you need to take care of timeouts. E.g. use Augmint.utils.promiseTimeout()\n }\n\n // receipt you need to check for receipt.status if tx was Reverted or not.\nif (confirmedReceipt.status) {\n  // all good\n} else {\n  // this tx was reverted\n}\n```\n\nSpecs: [test/Transaction.test.js](https://github.com/Augmint/augmint-js/blob/tx_reorg/test/Transaction.test.js)\n\n### More examples\n\n-   [test/Rates.setters.test.js](https://github.com/Augmint/augmint-js/blob/tx_reorg/test/Rates.setters.test.js)\n-   [test/Exchange.Matching.onchain.test.js](https://github.com/Augmint/augmint-js/blob/tx_reorg/test/Exchange.Matching.onchain.test.js)\n\n### Web3.js event style\n\nDeprecated and discouraged but kept for backward compatibility with web3js style events:\n\n```js\ntx.on[ce](\"transactionHash\" | \"receipt\" | \"confirmation\" | \"error\");\n// This way it can be easily plugged into dapps which are handling web3js tx objects:\n//   augmint-js Transaction object can be a drop in as an almost direct replacement of webjs transactioObject\n```\n\nSpecs: [test/Transaction.web3jsStyle.test.js](https://github.com/Augmint/augmint-js/blob/tx_reorg/test/Transaction.web3jsStyle.test.js)\n\n### Construct a transaction with [`Transaction`](./src/Transaction.ts) class\n\nIt's likely not needed for ordinary `augmint-js` use\n\n```js\n const web3TxObject = rates.instance.methods.setRate(CCY, 100)\n // you can set the gaslimit here or later at send() too\n const augmintRatesTx = new Transaction(ethereumConnection, web3TxObject, { gasLimit: 200000 } );\n augmintRatesTx.send(...).onTxHash(...)  // or sign().send() etc.\n```\n\n## augmint-cli\n\nFor local development: launch a docker container with test augmint contracts in ganache\n\n```\n$ yarn augmint-cli  # NB: if you are running from within the augmin-js repo then: ./scripts/augmint-cli.sh\n\naugmint-cli : start / stop augmint contracts. Docker image: augmint/contracts:vx.x.x\n\n    Usage: /usr/local/bin/augmint-cli ganache {start | stop | run}\n      start: tries to start container named ganache . If fails then runs (downloads, creates and starts) the container from augmint/contracts:vx.x.x\n      stop: plain docker stop augmint/contracts:vx.x.x (doesn't check if exists)\n      run: stops and removes the ganache container if exists. then runs it\n```\n\nAlso recreates the container if it exists but image is not as expected (ie. there was a version upgrade)\n\n## Publish NPM package\n\nbump the version property in the package.json\nrelease a new version as usual\n  - merge staging into master\n  - create a release in github with the vX.X.X tag on master\n\nbefore npm publish, you need to build the library:\n  - checkout the master(!) branch\n  - `yarn clean`\n  - `yarn build`\nnpm publish from master branch. test it with --dry-run\n\n\n## Contributions\n\nAugmint is an open and transparent project.\n\nWe are looking for great minds to extend our core team. Contributions in any area is much appreciated: development, testing, UX\u0026UI design, legal, marketing, spreading the word etc.\n\n[Code of Conduct](CODE_OF_CONDUCT.md)\n\n## Get in touch\n\n-   [hello@augmint.org](mailto:hello@augmint.org)\n-   [Discord server](https://discord.gg/PwDmsnu) [![Discord](https://img.shields.io/discord/407574313810788364.svg)](https://discord.gg/PwDmsnu)\n-   [Telegram](https://t.me/augmint)\n\n## Authors\n\nSee team on [www.augmint.org](https://www.augmint.org)\n\n\u003cimg src=\"https://github.com/Augmint/augmint-web/raw/staging/src/assets/images/decentlabs.png\" alt=\"Decentlabs\" width=\"60\" height=\"60\"\u003e The project was born at [DECENT Labs](http://www.decent.org)\n\n### Concept, initial version\n\n-   [szerintedmi](https://github.com/szerintedmi)\n-   [Charlie](https://github.com/krosza)\n\n## Licence\n\nThis project is licensed under the GNU Affero General Public License v3.0 license - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugmint%2Faugmint-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faugmint%2Faugmint-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faugmint%2Faugmint-js/lists"}