{"_id":"@acentswap/acent","_rev":"3-f30687c62b931d26ef058e11f0bd3c53","name":"@acentswap/acent","dist-tags":{"latest":"8.0.0"},"versions":{"7.0.0":{"name":"@acentswap/acent","version":"7.0.0","description":"Official Acent JavaScript SDK for bridging crypto assets cross-chain.","repository":{"type":"git","url":"git+https://github.com/acentproject/acent-js.git"},"publishConfig":{"access":"public"},"keywords":["acentvm","acent","bitcoin","dogecoin","web3","ethereum","solana","defi"],"author":{"name":"Acent"},"license":"MIT","bugs":{"url":"https://github.com/acentproject/acent-js/issues"},"main":"./build/main/index.js","typings":"./build/main/index.d.ts","module":"./build/module/index.js","scripts":{"describe":"npm-scripts-info","clean":"yarn rimraf ./build ./node_modules","link":"yarn link","unlink":"yarn unlink","build":"yarn build:main && yarn build:module","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","build:bundled":"cross-env NODE_ENV=production webpack --config ../../webpack.config.js --mode production --progress --color","prettier":"yarn fix:prettier","lint":"run-s lint:*","lint:eslint":"eslint --config ../../.eslintrc.js src","lint:prettier":"prettier --check './(src|test)/**/*.ts*'","fix":"run-s fix:*","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier --write './(src|test)/**/*.ts*'","test":"run-s test:* lint","test-all":"ALL_TESTS=true run-s build:main test:unit lint","test:unit":"nyc ../../node_modules/ts-mocha/bin/ts-mocha --sort --exit --timeout 180000 --paths -p ./tsconfig.json ./test/*.spec.ts ./test/**/*.spec.ts","watch":"run-s build:main && run-s \"build:main -- -w\"","cov":"run-s build:main test:unit cov:html && open-cli coverage/index.html","cov:html":"nyc report --reporter=html","cov:send":"nyc report --reporter=lcov && codecov","cov:check":"nyc report && nyc check-coverage --lines 0 --functions 0 --branches 0","doc":"run-s doc:html && open-cli build/docs/index.html","doc:html-succint":"typedoc src/ --exclude **/*.spec.ts,*.spect.ts --target ES6 --mode file --out build/docs","doc:html":"typedoc --entryPoints $(ls -p ../*/src/*.ts ../*/src/*/*.ts ../chains/*/src/*.ts ../chains/*/src/*/*.ts | xargs echo | sed 's/ /,/g') --exclude \\*\\*/\\*.spec.ts,\\*.spect.ts --out build/docs --excludeExternals --excludePrivate --excludeProtected --name \"AcentJS v2.0.0 Documentation\" --readme ./DOCS.md --theme minimal","doc:json":"typedoc src/ --exclude **/*.spec.ts,*.spect.ts --target ES6 --mode file --json build/docs/typedoc.json","doc:publish":"gh-pages --repo git@github.com:acentproject/acent-js-v3-docs.git -m \"[ci skip] Updates\" -d build/docs","prepare":"yarn build","npmignore":"npmignore -g ../../.gitignore","prepare-release-old":"run-s npmignore build doc:html doc:publish","prepare-release":"run-s npmignore build"},"dependencies":{"@acentswap/provider":"7.0.0","@acentswap/utils":"^7.1.0","@types/bn.js":"^5.1.0","@types/node":">=10","bignumber.js":"^9.0.1","bn.js":"^5.2.0","events":"^3.3.0","immutable":"^4.0.0-rc.14"},"resolutions":{"sha3":"^2.1.2"},"nyc":{"extends":"@istanbuljs/nyc-config-typescript","exclude":["**/*.d.ts","**/*.spec.js"],"include":["src"]},"prettier":{"printWidth":80,"semi":true,"singleQuote":false,"tabWidth":4,"trailingComma":"all","endOfLine":"lf","arrowParens":"always"},"homepage":"https://github.com/acentproject/acent-js#readme","_id":"@acentswap/acent@7.0.0","_nodeVersion":"14.17.4","_npmVersion":"6.14.14","dist":{"integrity":"sha512-kmnZbjYuuew3XqF6nXFURxMwujdedXjf4stZHB4Zpmhmkjom9VwTaiVj9x0DalUWhiIuSXNKaVBM5sJdJLCWGg==","shasum":"706999dfc62e8cb2e05c3e508e2b04a3a5f0a89d","tarball":"https://registry.npmjs.org/@acentswap/acent/-/acent-7.0.0.tgz","fileCount":91,"unpackedSize":345940,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0phRCRA9TVsSAnZWagAAnokP/1gyZ9IZ3+Fr6Cy+ru2n\nTjYsZqdPRBaoCBaZoGekgon/ieMCtm9zHYlkE9SpgXaxh81FgJ0PHv2WBg5/\n9D2jIYwkaRNvroSkoh9qAJ05I3VxZYZFUtCivwzrn0Wk2JPFaQjIocYn1RqL\nXHZs6wgwv4XS8x2wJeaP8efe8EFgyEbGUar6ilfp32XwTwEFvDafD3RflaSk\nGh8FTXtIz8HjIRRsDFpc//MCUD57YOZfl2LVKwEPQrnjGToyAU1WRzVSTNX9\n9Jg6KD7v3hzum8Y7ckArA2DjgfYp8FkU4/9OwjQNRELMc74spEva+yywuRQv\n6PVpPwbsoIZa5JX1ZrecXJVPRVJWxGLbFkpzGJXSOjIFBGsZTeJFGWWDCRef\ntfrpUaXRYVBC9dZcfQMt2i6+5B15WB0g7DTqCbG6E/waxOWyLCC8zmF5VwE4\nRsTRLRUTWnu9t5YEUpTLO8VRIs2NwtL+4ttsPTNtj9CQE26wKRGtrorvqtoK\naIH9pUpcWGpOH7T+N7jxAGfzmXymg9kNZxhqncuEoZoo2tfmew0o1xSaUMyN\n/cSbizjX5LDK+dG41CWva0BxKmZyh0SeVlcH6Ry0k53X9d+8dLkr6hY5Q/ri\nuI1UMyTNKs7fbhHqEae8ek8umTHHWb5tticEBKiNvaU/LGkmrL7yTMvPB80n\nut6P\r\n=baes\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDQWGxkR6kbCMdIb2ha1y4FscfNctY9QD7n1pw7BWDhCAiATyCglTa/gbCmXf/0TyTNcU+RImHy6d1OOAjkcwmBwxg=="}]},"_npmUser":{"name":"webcgi","email":"webcgi@kakao.com"},"directories":{},"maintainers":[{"name":"helloacent","email":"melme890@gmail.com"},{"name":"nara7875","email":"tmdgml7875@gmail.com"},{"name":"webcgi","email":"webcgi@kakao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/acent_7.0.0_1641191505513_0.4735239973333707"},"_hasShrinkwrap":false},"8.0.0":{"name":"@acentswap/acent","version":"8.0.0","description":"Official Acent JavaScript SDK for bridging crypto assets cross-chain.","repository":{"type":"git","url":"git+https://github.com/acentswap/acent-js.git"},"publishConfig":{"access":"public"},"keywords":["acentvm","acent","bitcoin","dogecoin","web3","ethereum","solana","defi"],"author":{"name":"Acent"},"license":"MIT","bugs":{"url":"https://github.com/acentswap/acent-js/issues"},"main":"./build/main/index.js","typings":"./build/main/index.d.ts","module":"./build/module/index.js","scripts":{"describe":"npm-scripts-info","clean":"yarn rimraf ./build ./node_modules","link":"yarn link","unlink":"yarn unlink","build":"yarn build:main && yarn build:module","build:main":"tsc -p tsconfig.json","build:module":"tsc -p tsconfig.module.json","build:bundled":"cross-env NODE_ENV=production webpack --config ../../../webpack.config.js --mode production --progress --color","prettier":"yarn fix:prettier","lint":"run-s lint:*","lint:eslint":"eslint src/**/*.ts","lint:prettier":"prettier --check './(src|test)/**/*.ts*'","fix":"run-s fix:*","fix:eslint":"yarn lint:eslint --fix","fix:prettier":"prettier --write './(src|test)/**/*.ts*'","test":"run-s test:* lint","test-all":"ALL_TESTS=true run-s build:main test:unit lint","test:unit":"nyc ../../../node_modules/ts-mocha/bin/ts-mocha --sort --exit --timeout 180000 --paths -p ./tsconfig.json ./test/*.spec.ts ./test/**/*.spec.ts","watch":"run-s build:main && run-s \"build:main -- -w\"","cov":"run-s build:main test:unit cov:html && open-cli coverage/index.html","cov:html":"nyc report --reporter=html","cov:send":"nyc report --reporter=lcov && codecov","cov:check":"nyc report && nyc check-coverage --lines 0 --functions 0 --branches 0","doc":"run-s doc:html && open-cli build/docs/index.html","doc:html-succint":"typedoc src/ --exclude **/*.spec.ts,*.spect.ts --target ES6 --mode file --out build/docs","doc:html":"typedoc src/,$(ls -p ../*/build/main/*.d.ts ../*/build/main/*/*.d.ts ../multiwallet/*/build/main/*.d.ts ../multiwallet/*/build/main/*/*.d.ts ../chains/*/build/main/*.d.ts ../chains/*/build/main/*/*.d.ts ../../ui/*/dist/*.d.ts ../../ui/*/dist/*/*.d.ts | grep -v \"/acent/\" | xargs echo | sed 's/ /,/g') --exclude \\*\\*/\\*.spec.ts,\\*.spect.ts --target ES6 --mode file --out build/docs --includeDeclarations --excludeExternals --excludeNotExported --excludePrivate --excludeProtected --name \"AcentJS v2.0.0 Documentation\" --readme ./DOCS.md --theme minimal","doc:json":"typedoc src/ --exclude **/*.spec.ts,*.spect.ts --target ES6 --mode file --json build/docs/typedoc.json","doc:publish":"gh-pages --repo git@github.com:acentswap/acent-js-docs.git -m \"[ci skip] Updates\" -d build/docs","prepare":"yarn build","npmignore":"npmignore -g ../../../.gitignore","prepare-release":"run-s npmignore build doc:html doc:publish"},"dependencies":{"@acentswap/interfaces":"8.1.0","@acentswap/provider":"8.0.0","@acentswap/rpc":"8.0.0","@acentswap/utils":"8.0.0","@types/bn.js":"^5.1.0","@types/node":">=10","bignumber.js":"^9.0.1","bn.js":"^5.2.0","ethers":"^5.4.3","immutable":"^4.0.0-rc.14"},"devDependencies":{"gh-pages":"^3.1.0"},"resolutions":{"sha3":"^2.1.2"},"nyc":{"extends":"@istanbuljs/nyc-config-typescript","exclude":["**/*.d.ts","**/*.spec.js"],"include":["src"]},"prettier":{"printWidth":80,"semi":true,"singleQuote":false,"tabWidth":4,"trailingComma":"all","endOfLine":"lf","arrowParens":"always"},"gitHead":"18d6877f16a36888e0f8874affc4cd1160439cad","homepage":"https://github.com/acentswap/acent-js#readme","_id":"@acentswap/acent@8.0.0","_nodeVersion":"16.13.1","_npmVersion":"8.1.2","dist":{"integrity":"sha512-12nSiN8OI78jymIHwx/+1UnArQfhXUsd5CpyEnoLR0cTKgKBxqb3hhrZH9eYxg8YhGMejOmJWgxEmDUg2emSSw==","shasum":"e4ca7c40bd2e021c3ed571e2731888f824f3a56c","tarball":"https://registry.npmjs.org/@acentswap/acent/-/acent-8.0.0.tgz","fileCount":33,"unpackedSize":309429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh0sCICRA9TVsSAnZWagAAKccQAI4hr5ULXYRvN00GsXem\nStmUUfmFnI740MyDmPT6KP5azTPnPLD2ygca79l19Gum7dRLpfWb8oKJ6DG4\nV3VYeR8wa/4duBfQzlLEcuLC2QXNhLqR0Ae94FXyoEt/oTG6YOtfULAsfSbJ\ns13lJPqOQIHMNLtgPDrT3gEaV92+FCc5WEKRjdd7WRoqRuP5I+GmbsJwzO6X\nX+QDnjaOm4hl5EyZi/AJXuueuVdWa+RAPbsknVJP+S9zG8CgMa6BjdXnw4C8\npK+jbLZ0YgrqAgTBQAzC3WfRh/2QY+myAOqKpdCEzNOm3yHIG1ELRwE5kpyp\nCHAcUV/QmUv161Uo9th/rCdWprXbt81fKmcikTgsGWv531dLWBU7MUt5/4kl\nV/cLvKBZHnvCE9lfDsI4SUYWV6OOQlb1QSTOe8W/HyhxVWp4IRsKVXQrgipQ\nU4jy4aGKBuPEh+GSArtNqhj+sxCi8vBchWvDNd736aiGEyhpX/+1t8VomY0+\nH2AnkKoi06BoK6np/g2LDs/QYlQzbTR7ZdVpuh03hXPEZhYWr+l1HZUtjONI\nJtgQpdrtSVLqZLHgtnHugR8aZ+zWVnhRle7wztHl8SOxuLNKTr3PFQ8YWbF9\nBthKRGoKRrnYroiQ5PnDKSXGT+IPGpO6eG5c1qioBwPt6djfq1yPLNg0vJF0\nuFCW\r\n=JSJV\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAniWCPYvoTeq6NnvFccm5O3+qTBCexK2wky4nw4tRIqAiEAgVCWvgdAr1K/YzIwRUpIqhuAtN9pUA8NrdoLGOUdt3c="}]},"_npmUser":{"name":"helloacent","email":"melme890@gmail.com"},"directories":{},"maintainers":[{"name":"helloacent","email":"melme890@gmail.com"},{"name":"nara7875","email":"tmdgml7875@gmail.com"},{"name":"webcgi","email":"webcgi@kakao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/acent_8.0.0_1641201800265_0.3373679156844487"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-03T06:31:45.468Z","7.0.0":"2022-01-03T06:31:45.729Z","modified":"2022-06-03T04:48:12.997Z","8.0.0":"2022-01-03T09:23:20.433Z"},"maintainers":[{"email":"melme890@gmail.com","name":"helloacent"},{"email":"webcgi@kakao.com","name":"webcgi"}],"description":"Official Acent JavaScript SDK for bridging crypto assets cross-chain.","homepage":"https://github.com/acentswap/acent-js#readme","keywords":["acentvm","acent","bitcoin","dogecoin","web3","ethereum","solana","defi"],"repository":{"type":"git","url":"git+https://github.com/acentswap/acent-js.git"},"author":{"name":"Acent"},"bugs":{"url":"https://github.com/acentswap/acent-js/issues"},"license":"MIT","readme":"# `🛠️ AcentJS`\r\n\r\n`AcentJS` is the official Javascript SDK for interacting with [AcentVM](https://acentswap.io). See [github.com/acentswap/acent-js](https://github.com/acentswap/acent-js) for information.\r\n\r\n## Installation\r\n\r\nInstall AcentJS:\r\n\r\n```sh\r\nyarn add @acentswap/acent\r\n# Or\r\nnpm install --save @acentswap/acent\r\n```\r\n\r\n## Usage\r\n\r\nUsage is described in the [Getting Started Tutorial](https://acentswap.github.io/acent-client-docs/acent-js/tutorial/overview).\r\n\r\n### AcentVM network information\r\n\r\n```ts\r\nconst AcentJS = require(\"@acentswap/acent\");\r\nconst acentJS = new AcentJS();\r\n\r\n// Print available methods\r\nconsole.log(acentJS.acentVM);\r\n\r\n// Query fees\r\nacentJS.acentVM.queryFees().then(console.log);\r\n```\r\n\r\n### Bridging BTC to Ethereum\r\n\r\nThis assumes `window.ethereum` is available (e.g. in a browser with MetaMask installed).\r\n\r\nSee [hdwallet-provider](https://github.com/trufflesuite/truffle/tree/develop/packages/hdwallet-provider) and [infura.io](https://infura.io) if you are using AcentJS using Node.js instead of in a browser.\r\n\r\n```typescript\r\nimport { Bitcoin, Ethereum } from \"@acentswap/chains\";\r\nimport AcentJS from \"@acentswap/acent\";\r\nimport ethers from \"ethers\";\r\n\r\nconst mint = async () => {\r\n    await window.ethereum.enable();\r\n    const provider = new ethers.providers.Web3Provider(window.ethereum);\r\n    const signer = provider.getSigner();\r\n    const address = await signer.getAddress();\r\n\r\n    const lockAndMint = await new AcentJS(\"testnet\").lockAndMint({\r\n        asset: \"BTC\",\r\n        from: Bitcoin(),\r\n        to: Ethereum(provider.provider).Address(address),\r\n    });\r\n\r\n    console.log(`Deposit BTC to ${lockAndMint.gatewayAddress}`);\r\n\r\n    lockAndMint.on(\"deposit\", AcentJS.defaultDepositHandler);\r\n};\r\n\r\nmint().catch(console.error);\r\n```\r\n\r\n### Bridging BTC from Ethereum back to the Bitcoin chain\r\n\r\n```typescript\r\nimport { Bitcoin, Ethereum } from \"@acentswap/chains\";\r\nimport AcentJS from \"@acentswap/acent\";\r\nimport ethers from \"ethers\";\r\n\r\nconst burn = async () => {\r\n    await window.ethereum.enable();\r\n    const provider = new ethers.providers.Web3Provider(window.ethereum);\r\n    const value = 2000000; // sats\r\n\r\n    const burnAndRelease = await new AcentJS(\"testnet\").burnAndRelease({\r\n        asset: \"BTC\",\r\n        to: Bitcoin().Address(\"miMi2VET41YV1j6SDNTeZoPBbmH8B4nEx6\"),\r\n        from: Ethereum(provider.provider).Account({ value }),\r\n    });\r\n\r\n    await burnAndRelease.burn();\r\n    await burnAndRelease.release();\r\n};\r\n\r\nburn().catch(console.error);\r\n```\r\n\r\n<br />\r\n<br />\r\n<hr />\r\n<br />\r\n\r\n## Developer notes\r\n\r\n### Building\r\n\r\n```sh\r\nyarn run build\r\n# or watch, to rebuild on new changes:\r\nyarn run watch\r\n```\r\n\r\n### Running tests\r\n\r\nSee [../test](../test).\r\n","readmeFilename":"README.md"}