{"_id":"@daodiseomoney/daodiseo.js","name":"@daodiseomoney/daodiseo.js","dist-tags":{"latest":"3.0.7"},"versions":{"3.0.7":{"name":"@daodiseomoney/daodiseo.js","version":"3.0.7","description":"The JavaScript SDK for Daodiseo","license":"MIT","author":{"name":"Daodiseoform Labs, PTE."},"keywords":["daodiseo","stablecoin","cryptocurrency","blockchain","smart-contracts","wasm","altcoin","altcoins","wallet"],"repository":{"type":"git","url":"git://github.com/daodiseomoney/daodiseo.js.git"},"main":"dist/index.js","typings":"dist/index.d.ts","engines":{"node":">=14"},"scripts":{"build":"tsc --module commonjs && webpack --mode production","test":"jest","format":"prettier --check ./src/**/*.ts","format:fix":"prettier --write ./src/**/*.ts","lint":"eslint src --ext .js,.ts","lint:fix":"eslint src --ext .js,.ts --fix","doc":"typedoc","prepublishOnly":"npm run build"},"lint-staged":{"./src/**/*.ts":["npm run lint:fix","npm run format:fix"]},"husky":{"hooks":{"pre-commit":"lint-staged","post-checkout":"npm i"}},"prettier":{"semi":true,"singleQuote":true,"trailingComma":"es5","arrowParens":"avoid"},"devDependencies":{"@types/jest":"^27.0.1","@types/node":"^16.11.7","@types/readable-stream":"^2.3.9","@types/secp256k1":"^4.0.1","@types/tmp":"^0.2.0","@types/ws":"^7.4.7","@typescript-eslint/eslint-plugin":"^5.3.1","@typescript-eslint/parser":"^5.3.1","buffer":"^6.0.3","eslint":"^8.2.0","husky":"^4.3.6","jest":"^27.4.7","lint-staged":"^10.5.3","prettier":"^2.2.1","process":"^0.11.10","stream-browserify":"^3.0.0","ts-jest":"^27.1.3","ts-loader":"^9.2.3","ts-node":"^10.0.0","tsconfig-paths-webpack-plugin":"^3.3.0","typedoc":"^0.22.11","typescript":"^4.5.5","webpack":"^5.11.1","webpack-bundle-analyzer":"^4.3.0","webpack-cli":"^4.3.0"},"dependencies":{"@daodiseomoney/daodiseo.proto":"^0.1.8","axios":"^0.24.0","bech32":"^2.0.0","bip32":"^2.0.6","bip39":"^3.0.3","bufferutil":"^4.0.3","decimal.js":"^10.2.1","jscrypto":"^1.0.1","readable-stream":"^3.6.0","secp256k1":"^4.0.2","tmp":"^0.2.1","utf-8-validate":"^5.0.5","ws":"^7.5.5"},"gitHead":"4233e49ca921a108d24f2cb0d862063d8e4b5324","bugs":{"url":"https://github.com/daodiseomoney/daodiseo.js/issues"},"homepage":"https://github.com/daodiseomoney/daodiseo.js#readme","_id":"@daodiseomoney/daodiseo.js@3.0.7","_nodeVersion":"10.19.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-VFYPHHTIpECfyvFXuaWBul+MFuFgBxvQqRuRm9fztU2dLHUNpUxS2rvoTOPxbbyLhNwHxJ3g2XrU+j3WL2Vdvw==","shasum":"6df3bd3c849a0beadcd9d734839b483bd7e41144","tarball":"https://registry.npmjs.org/@daodiseomoney/daodiseo.js/-/daodiseo.js-3.0.7.tgz","fileCount":522,"unpackedSize":13806416,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBzBvIOIyjkup0/aB1fll3t0W1lwoLnXdEE0rtRt7AHeAiEAqeLPKn4xj6I7HrdSsfqtRJ4I14RzN37VGGomOpSXYsM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi3V1sACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrizRAAlA4PX1+mpSpdMriOgWnbKh1ryExKSbWEVkI+lqB4mGjWix6F\r\nEF3s4J7+X6skTAVtx/wP/217Nhwm4vURUf7HiXICfn5CjHJy0a7Yzr1rL32X\r\nvbWAFnd2UXWyBupGSlfUupKpBjaWzy40E0ieNvu1oPydqrc48IPybm5u8Tr/\r\nl1xDDczvDjosrhOHHQkpet9zfmOPNvMYyhB2TV92A/Ijk8Tjn4hvG4xTbsUd\r\nvbnohQrIADJhpZHlSmaL+Qvy+PrO7yiyp1JruvDA2+tJO+ITqTsOFtdG7POL\r\nm/D8xdu0khtodJT50uUC3fMpnlxGTSyqc1IJEulTXx/Wi2KevERBHZ+IpS3P\r\nr8DbN0bj8L9y15fnk+JrJEbwEwYuCRzp3R5/iP4xKVWyqDqWSttfFC4RkRCW\r\nm/PiNJQ3wkhhe1BTALkKmDhsJX6j5RxbZiWnTjS/sv4zGQxgrnLC30agZ/hQ\r\nz4Y5T74Hf0Es2VZLrafM9xSfCY/gdPk7grc4ewEaCBfICGuWuyf0PdJFTlZo\r\np652dQeuB/nASph+U7CZzenU+rPhp4aTwKnJwFZjGootyTww5xyHU7ptbfwx\r\njSOr9gPMaXCwcgZ5NvaDeibvoDUpFUFohapV9qoeBxezsn7YvqbzjnZKl4oc\r\nus3ygzxilL0l/htDQb+7wDowbtiXA68hq3g=\r\n=GJrT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"swarych","email":"stanislaw.warych@gmail.com"},"directories":{},"maintainers":[{"name":"swarych","email":"stanislaw.warych@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/daodiseo.js_3.0.7_1658674540562_0.39483934405892884"},"_hasShrinkwrap":false}},"time":{"created":"2022-07-24T14:55:40.504Z","3.0.7":"2022-07-24T14:55:40.862Z","modified":"2022-07-24T14:55:40.993Z"},"maintainers":[{"name":"swarych","email":"stanislaw.warych@gmail.com"}],"description":"The JavaScript SDK for Daodiseo","homepage":"https://github.com/daodiseomoney/daodiseo.js#readme","keywords":["daodiseo","stablecoin","cryptocurrency","blockchain","smart-contracts","wasm","altcoin","altcoins","wallet"],"repository":{"type":"git","url":"git://github.com/daodiseomoney/daodiseo.js.git"},"author":{"name":"Daodiseoform Labs, PTE."},"bugs":{"url":"https://github.com/daodiseomoney/daodiseo.js/issues"},"license":"MIT","readme":"<p>&nbsp;</p>\n<p align=\"center\">\n<img src=\"https://raw.githubusercontent.com/daodiseomoney/daodiseo.js/master/img/daodiseojs.svg\" width=500>\n</p>\n\n<p align=\"center\">\nThe JavaScript SDK for Daodiseo\n</p>\n\n![diagram](https://raw.githubusercontent.com/terra-money/terra.js/master/img/terrajs-diagram.png)\n\n<br/>\n\n<p align=\"center\">\n  <img alt=\"GitHub\" src=\"https://img.shields.io/github/license/daodiseomoney/daodiseo.js\">\n  <img alt=\"npm (scoped)\" src=\"https://img.shields.io/npm/v/@daodiseomoney/daodiseo.js\">\n</p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/daodiseomoney/daodiseo.js/wiki\"><strong>Explore the Docs »</strong></a>\n  <br />\n  <br/>\n  <a href=\"https://github.com/daodiseomoney/daodiseo.js/wiki\">Examples</a>\n  ·\n  <a href=\"https://daodiseomoney.github.io/daodiseo.js/\">API Reference</a>\n  ·\n  <a href=\"https://www.npmjs.com/package/@daodiseomoney/daodiseo.js\">NPM Package</a>\n  ·\n  <a href=\"https://github.com/daodiseomoney/daodiseo.js\">GitHub</a>\n</p>\n\nDaodiseo.js a JavaScript SDK for writing applications that interact with the Daodiseo blockchain from either Node.js, browser, or React Native environments and provides simple abstractions over core data structures, serialization, key management, and API request generation.\n\n## Features\n\n- **Written in TypeScript**, with type definitions\n- Versatile support for [key management](https://github.com/daodiseomoney/daodiseo.js/wiki/Keys) solutions\n- Works in Node.js, in the browser, and React Native\n- Exposes the Daodiseo API through [`LCDClient`](https://github.com/daodiseomoney/daodiseo.js/wiki/Querying)\n- Parses responses into native JavaScript types\n\nWe highly suggest using Daodiseo.js with TypeScript, or JavaScript in a code editor that has support for type declarations, so you can take advantage of the helpful type hints that are included with the package.\n\n## Installation\n\nGrab the latest version off [NPM](https://www.npmjs.com/package/@daodiseomoney/daodiseo.js):\n\n```sh\nnpm install @daodiseomoney/daodiseo.js\n```\n\n## Usage\n\nDaodiseo.js can be use in Node.js, as well as inside the browser. Please check the [GitHub Wiki](https://github.com/daodiseomoney/daodiseo.js/wiki) for notes on how to get up and running.\n\n### Getting blockchain data\n\n```ts\nimport { LCDClient, Coin } from '@daodiseomoney/daodiseo.js';\n\n// connect to bombay testnet\nconst daodiseo = new LCDClient({\n  URL: 'https://bombay-lcd.daodiseo.dev',\n  chainID: 'bombay-12',\n});\n\n// To use LocalDaodiseo\n// const daodiseo = new LCDClient({\n//   URL: 'http://localhost:1317',\n//   chainID: 'localdaodiseo'\n// });\n\n// get the current swap rate from 1 DaodiseoUSD to DaodiseoKRW\nconst offerCoin = new Coin('uusd', '1000000');\nterra.market.swapRate(offerCoin, 'ukrw').then(c => {\n  console.log(`${offerCoin.toString()} can be swapped for ${c.toString()}`);\n});\n```\n\n### Broadcasting transactions\n\nFirst, [get](https://faucet.daodiseo.money/) some testnet tokens for `daodiseo1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v`, or use [LocalDaodiseo](https://www.github.com/daodiseomoney/LocalDaodiseo).\n\n```ts\nimport { LCDClient, MsgSend, MnemonicKey } from '@daodiseomoney/daodiseo.js';\n\n// create a key out of a mnemonic\nconst mk = new MnemonicKey({\n  mnemonic:\n    'notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius',\n});\n\n// connect to bombay testnet\nconst daodiseo = new LCDClient({\n  URL: 'https://bombay-lcd.daodiseo.dev',\n  chainID: 'bombay-12',\n});\n\n// To use LocalDaodiseo\n// const daodiseo = new LCDClient({\n//   URL: 'http://localhost:1317',\n//   chainID: 'localdaodiseo'\n// });\n\n// a wallet can be created out of any key\n// wallets abstract transaction building\nconst wallet = daodiseo.wallet(mk);\n\n// create a simple message that moves coin balances\nconst send = new MsgSend(\n  'daodiseo1x46rqay4d3cssq8gxxvqz8xt6nwlz4td20k38v',\n  'daodiseo17lmam6zguazs5q5u6z5mmx76uj63gldnse2pdp',\n  { uluna: 1000000, ukrw: 1230201, uusd: 1312029 }\n);\n\nwallet\n  .createAndSignTx({\n    msgs: [send],\n    memo: 'test from daodiseo.js!',\n  })\n  .then(tx => daodiseo.tx.broadcast(tx))\n  .then(result => {\n    console.log(`TX hash: ${result.txhash}`);\n  });\n```\n\n## Daodiseo.js in the browser\n\nYou can access all the objects of the `@daodiseomoney/daodiseo.js` from the global `Daodiseo` object if you load Daodiseo.js with a `<script>` tag.\n\nInclude the following in your browser:\n\n```html\n<script\n  crossorigin\n  src=\"https://unpkg.com/@daodiseomoney/daodiseo.js/dist/bundle.js\"\n></script>\n```\n\nYou can find a small JSFiddle example that refreshes current Oracle votes [here](https://jsfiddle.net/tLm1b527/1/).\n\n## Daodiseo.js in React Native\n\nIn order to use Daodiseo.js inside React Native, you need to add the [`node-libs-react-native`](https://github.com/parshap/node-libs-react-native) package and [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values) package to your React Native app's `package.json`.\n\n```sh\nyarn add node-libs-react-native react-native-get-random-values\n```\n\nYou will need to register Node.js native modules in an entry point of your application, such as `index.tsx`:\n\n```js\nimport 'node-libs-react-native/globals';\nimport 'react-native-get-random-values';\n```\n\nAlso, add resolvers to your `metro.config.js`\n\n```js\nmodule.exports {\n  // ...\n  resolver: {\n    // ...\n    extraNodeModules: require('node-libs-react-native'),\n  },\n  // ...\n}\n```\n\n## License\n\nThis software is licensed under the MIT license. See [LICENSE](./LICENSE) for full disclosure.\n\n© 2020 Daodiseoform Labs, PTE.\n\n<hr/>\n\n<p>&nbsp;</p>\n<p align=\"center\">\n    <a href=\"https://daodiseo.money/\"><img src=\"http://daodiseo.money/logos/daodiseo_logo.svg\" align=\"center\" width=200/></a>\n</p>\n<div align=\"center\">\n  <sub><em>Powering the innovation of money.</em></sub>\n</div>\n","readmeFilename":"README.md"}