{"_rev":"3-435ab8cd456fa939354784fd26bca912","time":{"created":"2023-02-24T09:44:44.565Z","1.0.5":"2023-02-24T09:06:00.346Z","modified":"2023-02-24T09:44:45.112Z","1.0.6":"2023-02-24T09:44:44.925Z"},"_id":"@chainup-custody/js-waas-sdk","name":"@chainup-custody/js-waas-sdk","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.6":{"name":"@chainup-custody/js-waas-sdk","version":"1.0.6","description":"wallet as a service, chainup custody waas sdk","main":"index.js","scripts":{"test":"make test"},"repository":{"type":"git","url":"git+https://github.com/HiCoinCom/js-sdk.git"},"keywords":["waas"],"author":{"name":"Chainup Custody"},"license":"MIT","bugs":{"url":"https://github.com/HiCoinCom/js-sdk/issues"},"homepage":"https://github.com/HiCoinCom/js-sdk#readme","dependencies":{"node-rsa":"^1.1.1","request":"^2.88.2","urlsafe-base64":"^1.0.0"},"gitHead":"d740f2a5ca243d574830ba0ddc1d90c15b62799e","_id":"@chainup-custody/js-waas-sdk@1.0.6","_nodeVersion":"16.19.0","_npmVersion":"8.19.3","dist":{"integrity":"sha512-AGoKfYrdwigkNzBYq+w7VZ2PwxUOLREb57oYzOZKSqDugGuMkRxLwaW7JHhkgo0SfJLzE52Pvtbzar5ML2CqRg==","shasum":"5a5fbf6a202ee74548e59d878ddba2559023eecf","tarball":"https://registry.npmjs.org/@chainup-custody/js-waas-sdk/-/js-waas-sdk-1.0.6.tgz","fileCount":11,"unpackedSize":18549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4xgYf2j9SC9Rx44ebT3mhuvwV8mwAPPSjItM6P/dUxAiEAigP8p+16pCpx4HUOZ/0HN2e1zrgo7/9HQEPslWTFmug="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+IcMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHhQ//aHKeaIkSxH6IjfjM5Pgl0SNv5Qfv9sZV6fnUZ/lvWYv+YStk\r\n4Efq53rjYjZTh3sFY/mPq9dRMxG6mFYdIMkrKSZTwQCxOgAHj5JPvUETmhfO\r\nvU1jKD1dzgwQJPtOIm4vgoBE5O2MiUChzUK7boliXjwT8ZA/r+5VbAooZiYe\r\nCLDMhjzMQ0122CZc5zay9rdLjx066lv8FibYiskFypCZSSOFYcl/VHiU+S7F\r\nF+3wHAYXRNpzZVom4Q8Uo6R4Kji70BiNX3VoOgoBc+6+svNzoBFzQgTz8uvo\r\nKyRi0MkdKjczKT+9ap08tsRt6MrCtHpZwArVNil2AbCZtjnmSfqKyfE9rKXf\r\noWL/fCSSnmkT2rx+81lOG+DDq9Jp4k970ajlfrcjseLvqTJOtC2mDiVs7KDP\r\nIxRyXkM0UP3j47Cuizx+PcuA4waQtkQY6BJ62ljsgauAAlKXwJPeFHjrMzf9\r\n2qPQRVjKWed0hU5wLPXhT9YNyNtNFPGBV+BucdnSCp/m7iXuphpzAUwTCDxx\r\nN5xTqgHchkDF8HF7o/ZiXwt5IJC08CaKvenCdV2Tl+xNZNRzGKb/+sQjRuwc\r\nLK6uy6Q0fZtCd0bPsmFOpiNqoKDAia9dvIlZ619hSYftxqFyh+oHJMmETS/B\r\n5jmLCmLS7+Xsg80s8wBZsQS22JDAZCh2jQA=\r\n=8Em4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"custody-admin","email":"zhp12543@gmail.com"},"directories":{},"maintainers":[{"name":"zhangpeizheng","email":"1126074644@qq.com"},{"name":"custody-admin","email":"zhp12543@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-waas-sdk_1.0.6_1677231884630_0.6359040912680134"},"_hasShrinkwrap":false}},"maintainers":[{"name":"zhangpeizheng","email":"1126074644@qq.com"},{"name":"custody-admin","email":"zhp12543@gmail.com"}],"description":"wallet as a service, chainup custody waas sdk","homepage":"https://github.com/HiCoinCom/js-sdk#readme","keywords":["waas"],"repository":{"type":"git","url":"git+https://github.com/HiCoinCom/js-sdk.git"},"author":{"name":"Chainup Custody"},"bugs":{"url":"https://github.com/HiCoinCom/js-sdk/issues"},"license":"MIT","readme":"# js-sdk\nwaas api client sdk\n\nDependency package installation：\n\n```\nnpm install @chainup-custody/js-waas-sdk@1.0.6\n```\n\nHow to use:\n\n```\nconst userApi = require('@chainup-custody/js-waas-sdk/apidao/userApiDao');\nconst accountApi = require('@chainup-custody/js-waas-sdk/apidao/AccountApiDao');\nconst billingApi = require('@chainup-custody/js-waas-sdk/apidao/BillingApiDao');\nconst Cons = require('@chainup-custody/js-waas-sdk/utils/Constants');\nconst asyncApi = require('@chainup-custody/js-waas-sdk/apidao/AsyncNotifyApiDao');\n\n\nCons.setAppId('baaceb1e506e1b5d7d1f0a3b1622583b');// app id\nCons.setHost('http://awstestopenapi.hiwallet.pro');//interface domain name\nCons.setPubKey('wass public key');\nCons.setPrivateKey('Merchant private key');\n//1.Register mobile number\nuserApi.registerByPhone({country: '+86', mobile: '13800000000'}).then(function (data) {\n    console.debug(\"Registered mobile number results：-----\" + JSON.stringify(data));\n});\n//2.register e-mail\nuserApi.registerByEmail({email: \"hicointest.@qq.com\"}).then(function (data) {\n    console.debug(\"Register Email Results：------\" + JSON.stringify(data));\n});\n//3.Get user information\nuserApi.getUserInfo({ country:\"86\" , mobile: \"138880000000\"}).then(function (data) {\n    console.debug(\"Get the result of user information address：------\" + JSON.stringify(data));\n});\n//4.Get a list of the merchant's currency\nuserApi.getCoinList({time: Date.now()}).then(function (data) {\n    console.debug(\"Get merchant's currency list results：------\" + JSON.stringify(data));\n});\n\n//5.Get the address of the user-specified currency account\naccountApi.getDepositAddress({symbol: \"eth\", uid: \"3529218\"}).then(function (data) {\n    console.debug(\"Get the result of the user-specified currency account address：------\" + JSON.stringify(data));\n});\n//6.Get the balance of the merchant collection account\naccountApi.getCompanyBySymbol({symbol: \"eth\"}).then(function (data) {\n    console.debug(\"Get the result of the user-specified currency account address：------\" + JSON.stringify(data));\n});\n//7.Query the user's account according to the currency and user id\naccountApi.getByUidAndSymbol({\"symbol\": \"eth\", \"uid\": 3529218}).then(function (data) {\n    console.debug(\"Query the user's account result based on the currency and user id：------\" + JSON.stringify(data));\n});\n//8.Withdraw\nbillingApi.withdraw({\n    \"request_id\": 12345678,\n    \"from_uid\": \"3529218\",\n    \"to_address\": \"0x754b0c610e011d0d40c810ef857b4dd989a67332\",\n    \"amount\": \"1.00000022\",\n    \"symbol\": \"ETH\"\n}).then(function (data) {\n    console.debug(\"Withdrawal result：------\" + JSON.stringify(data));\n});\n\n//9.Obtain withdrawal records in batches\nbillingApi.getWithdrawList({\"ids\": \"123,345,6778\"}).then(function (data) {\n    console.debug(\"obtainWithdrawalRecordResultsInBatches：------\" + JSON.stringify(data));\n});\n//10.Synchronize withdrawal records, return 100 recharge records greater than id\nbillingApi.syncWithdrawList({\"max_id\": 0}).then(function (data) {\n    console.debug(\"Sync withdrawal record results：------\" + JSON.stringify(data));\n});\n//11.Synchronize miner fee records, and return 100 recharge records greater than id\nbillingApi.syncMinerFeeList({\"max_id\": 0}).then(function (data) {\n    console.debug(\"Sync miner fee record result：------\" + JSON.stringify(data));\n});\n\n//12.Get miner fee records\nbillingApi.minerFeeList({\"ids\": \"123,345,6778\"}).then(function (data) {\n    console.debug(\"Get miner fee record result：------\" + JSON.stringify(data));\n});\n//13.Synchronized recharge record\nbillingApi.syncDepositList({\"max_id\": 0}).then(function (data) {\n    console.debug(\"Synchronous recharge record results：------\" + JSON.stringify(data));\n});\n\n//14.Get recharge records\nbillingApi.getDepositList({\"ids\": \"123,345,6778\"}).then(function (data) {\n    console.debug(\"Get the recharge record result：------\" + JSON.stringify(data));\n});\n\n//15. Decrypt user recharge asynchronous callback notification request parameters\nvar res1 = asyncApi.decodeNotifyRequest('kK506LW2SEsTeGq1t1IcqRuCykbpd-pubm5roRH7WUFDt4NHr6FGmWQ_EH2_V8TZ9m_Ri7r389ZbAPA3Z5YcLFOSWMA-URuw8mKabNu2jGA7yY91270JcIx0_b5y16LdxzqBVS1BF-\nPZBBH3TTc5cv9Xx4i0r-UCvhkTmmlB4hJN1bMCnEeDXHcloLeBpyFvO_-hMBWXymSUp55VVW1m7ua6eImIAoWY1UrTGFoV_xG4ACWbBGBBAVybrFFRXkFTHwat5J7vn4dcPH-Ih4bCoAQofXRhjka8eFR8EfD4TeRN1ZR1x7w8wpJnGdQuazpU6uwKlcVP0RcJCqzIROWqnw');\nconsole.debug(\"Decrypt user recharge asynchronous callback notification request parameters---\" + res1);\n//16. Decryption and withdrawal secondary verification request parameters\nvar res2 = asyncApi.decodeWithdrawRequest('Encrypted request parameters');\nconsole.debug(\"Decryption and withdrawal secondary verification request parameters---\" + res2);\n//17. Encrypted secondary verification withdrawal response data\nvar res3 = asyncApi.encodeWithdrawResponse({\"check_sum\":\"1234\",\"time\":\"12345678\"});\nconsole.debug(\"Encrypted secondary verification withdrawal response data---\" + res3);\n\n//18.WaaS Merchant Transfer\ntransferApi.transfer({request_id: \"1233456778\",symbol:\"usdt\",to:\"10c533a212a795f692db6684d70c95e9\",remark:\"transfer123\",amount:\"1.0000002\"}).then(function (data) {\n    console.debug(\"WaaS Merchant Transfer Results：------\" + JSON.stringify(data));\n});\n\n//19.Batch query transfer records\ntransferApi.getTransferList({ids: \"123\",ids_type:\"request_id\"}).then(function (data) {\n    console.debug(\"Batch query transfer record results：------\" + JSON.stringify(data));\n});\n\n//20.Synchronize all transfer records (pagination)\ntransferApi.getTransferList({max_id:0}).then(function (data) {\n    console.debug(\"Synchronize all transfer records (paginated) results：------\" + JSON.stringify(data));\n});\n```\n","readmeFilename":"README.md"}