{"_id":"@d11k-ts/polkadot","_rev":"4-a6510eb7420dca0afb865a9f9ff4f5b8","name":"@d11k-ts/polkadot","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.1":{"name":"@d11k-ts/polkadot","version":"0.1.1","description":"polkadot module for d11k chain","keywords":["d11k","polkadot","dojima"],"author":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"homepage":"https://github.com/dojimanetwork/d11k-ts#readme","license":"ISC","main":"lib/index.js","module":"lib/index.esm.js","typings":"lib/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dojimanetwork/d11k-ts.git"},"scripts":{"clean":"rimraf lib/**","build":"yarn && yarn clean && rollup -c","test":"jest","lint":"eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0","prepublishOnly":"yarn build"},"bugs":{"url":"https://github.com/dojimanetwork/d11k-ts/issues"},"dependencies":{"@d11k-ts/client":"^0.1.3","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","axios":"^1.2.1"},"devDependencies":{},"peerDependencies":{"@d11k-ts/client":"^0.1.3","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1"},"_id":"@d11k-ts/polkadot@0.1.1","dist":{"shasum":"b79106b2b9750ee9b7525c0ba004b875941e9e7a","integrity":"sha512-km9ja8k9u+pThiWEnEsKr66FXpttBWf8uiE4+QfB8nO8lHD23Dz4ABOrkpH0wTGOmBDbA+LIBa+K1OdmuiSbJQ==","tarball":"https://registry.npmjs.org/@d11k-ts/polkadot/-/polkadot-0.1.1.tgz","fileCount":11,"unpackedSize":561983,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC20JwYCAnBpxiNp5PolZPNo/M+O3+kFsGXori+xlTkcwIgPS2rgD1hG1/8dzrpiNSyCyj9T6IK4UVJLqDAcMrLbuM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjkh3pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXKg/9Ec7HJ9xMkmXzCr/0IYUAXDjfSHl50F/iV6hpynYuyC2y++8e\r\nG3+/vU3fh5fJHG0q4eNpiJKmDH4mKEESmAhoZUMvuuiE5vWsiO32cF5hBQ7P\r\nFomiYvXm5WreLCw2VThhv208Mgz9lanKJ1MPf0918MndGJWXLFv71Mxk5PNm\r\nYc+9q5z0oC5Wn7wDG2O+yiOZ2x+eyJYbKfFuctQs63NAd5HoAV6uzGSKKkaz\r\nht6so87U7cdrrAhnSGVNwpMuAVA/kh/N+ajt5qZziSAjtWysT0h+qfizBCMd\r\nha6iAoBndaDCCqbpsZ/cCLF2+fl/FBe9CW7AVrHNLqrD1ObZwlZvb4pe6p0w\r\nRrVHlqH4MQsb1NNTuyIUrtyyr2yUjADcK01/ZwLtewPIH+44iE09GsKtgwxN\r\nGgiPkIC8yAwRZu9lixqRvBhVBZOe25F7Qd2IoLleB1SVCoLP+M6BypXmIXzC\r\nsFxrNiIp2tX+mVpHxsVgK1XQMQEBZRdFSkMsi0/GGi3zf2lucO/6ipLMOIRc\r\nIs42vfBM8gQrflhpqIwb5EL8X56HoZzBx0BIyClmOosfW9vym0mZPJNm7XDw\r\nvX+hdJHc1U3QS/brdf+nW9ODV0V1TVRV5ucPnZAMzddxe4z2iCF+9N7dErDY\r\nlcpOH0x3ywJWAl0Q0h16frisKpTo4byCWxk=\r\n=AomD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dojima-network","email":"dojimanetwork@gmail.com"},"directories":{},"maintainers":[{"name":"dojima-network","email":"dojimanetwork@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polkadot_0.1.1_1670520297699_0.11008038883359017"},"_hasShrinkwrap":false},"0.1.2":{"name":"@d11k-ts/polkadot","version":"0.1.2","description":"polkadot module for d11k chain","keywords":["d11k","polkadot","dojima"],"author":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"homepage":"https://github.com/dojimanetwork/d11k-ts#readme","license":"ISC","main":"lib/index.js","module":"lib/index.esm.js","typings":"lib/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dojimanetwork/d11k-ts.git"},"scripts":{"clean":"rimraf lib/**","build":"yarn && yarn clean && rollup -c","test":"jest","lint":"eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0","prepublishOnly":"yarn build"},"bugs":{"url":"https://github.com/dojimanetwork/d11k-ts/issues"},"dependencies":{"@d11k-ts/client":"^0.1.4","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1"},"devDependencies":{},"peerDependencies":{"@d11k-ts/client":"^0.1.4","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1"},"_id":"@d11k-ts/polkadot@0.1.2","dist":{"shasum":"20bc641eb7c5cde61424c876319fbf907ad5f4e6","integrity":"sha512-Z+H9UyJdAKdubUwEEsbmUWwAV1ECYwOnWUL42xxaE42O8JobJg6TPfdjVcpkyEomtgdUNUvY8B3ECegiRUh7Gg==","tarball":"https://registry.npmjs.org/@d11k-ts/polkadot/-/polkadot-0.1.2.tgz","fileCount":11,"unpackedSize":72420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC02AbCuM7KpmrJgYEXDAFgfyq+Wj8bNT89RsAM4Cp+sAiAeK3wzZ5FPn9px3I8X3Bigzp61O80vRIa0afOoX0PNpQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjm0yBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZRg/6AybP3L2kSYx1XV3aOyBmhpq6R35ylZE7h4889JoMWyX2jxyn\r\n3hVPqU3q791NJSPtRGKzOGkrKxDXQOkhWMsH8px6JGIivsT4sOWPbxu990zg\r\nM59Rf1FqbSJV2Ub5XdiLdJWOq36JcnxY0cOCZUVe+dgKm9kC2UWtePLsC8w8\r\n4qxymCe0SAZt/uZkGT+0GPYq+XmJ0SPe6gd4LmeiL8wc96zPBC6yV3bgmnct\r\nOUAgqWqRLmPlk0p4uGU4tE5dXgIkTVgandARrHqO374zeYGROd9cSWgYTSH1\r\ntmWEbdlt+CBVo7gyt4XdCtmC4QnZ8DqezaETFbJFxOwGfnI0fjCXEqWj+AGo\r\n2OhlKAMjIi24uBKqSijH6FBzBfCobsIq9CTWxMVmR2dgYHRJXVY7+O95Jpug\r\nSAb5ZLj7jEA+kfvvYuO51zu0zYP/psEGa7od6OP1VpT6wNrcz/YiQ2N/PegZ\r\ni5q8VtEmlyZIIImoXJqows0oScP4tu19xVNGNGJXVWnQRRLznqNENstwO1S1\r\nYAxK7LMdqlPwV8gg++NmsonKFMCt4fH0Na+4JWMreutbpJ8VDGVgYp/i3s59\r\nNbdTrW3V2CP2WP69A23rC5kufBHzYwiBf3S3INyKZFCn9eHYq5FNRPSFLTF0\r\nMyE/DmcOjRw7pYvjGoo8rf4R6neU2PeUJZg=\r\n=daUy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dojima-network","email":"dojimanetwork@gmail.com"},"directories":{},"maintainers":[{"name":"dojima-network","email":"dojimanetwork@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polkadot_0.1.2_1671122049033_0.8034049587326579"},"_hasShrinkwrap":false},"0.1.3":{"name":"@d11k-ts/polkadot","version":"0.1.3","description":"polkadot module for d11k chain","keywords":["d11k","polkadot","dojima"],"author":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"homepage":"https://github.com/dojimanetwork/d11k-ts#readme","license":"ISC","main":"lib/index.js","module":"lib/index.esm.js","typings":"lib/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dojimanetwork/d11k-ts.git"},"scripts":{"clean":"rimraf lib/**","build":"yarn && yarn clean && rollup -c","test":"jest","lint":"eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0","prepublishOnly":"yarn build"},"bugs":{"url":"https://github.com/dojimanetwork/d11k-ts/issues"},"dependencies":{"@d11k-ts/client":"^0.1.5","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1","bignumber.js":"^9.1.1"},"devDependencies":{},"peerDependencies":{"@d11k-ts/client":"^0.1.5","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1","bignumber.js":"^9.1.1"},"_id":"@d11k-ts/polkadot@0.1.3","dist":{"shasum":"51ad9dc3032b7ba270ca75152284ec3f9ca7d130","integrity":"sha512-S6+YYO+31I7I6y+JMy76kh2zUq7xSU3oNnzD/HQ71SE75SNnDHGiohr2iE5T5mfieCxwMBYYTNtqU7c7LZqu0g==","tarball":"https://registry.npmjs.org/@d11k-ts/polkadot/-/polkadot-0.1.3.tgz","fileCount":11,"unpackedSize":72812,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjVntxqZb04LScyZ/GIGOCoW8WgqhNNCMEi0A+OtbQDwIhAN/z3ybm7ALpc9+ne4SgwRkRx/WgD2fQbOePUSQaBIGV"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjqxvMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEzA/9FBWY1xHWfIvEfcZGn+vf0CoUtzeuQKwp2wGxg/fJ1w3t3dwE\r\nKZWvQS4wKp16rUwAHtLH80INeoYqkF0gEHYOpwo/aejVZDsLyP9cbX+Rj5JE\r\nyiBAHUTiI/+F2P4L0GnFqF4HplBpugMPvQytbSjPMzquqOeP9Bb5FJp/1Hd1\r\nEQAadv2izx4znbju/PyAFr5lsqLAqJm8K6UGzVNC5pMiiV9i//Jwainz4iMo\r\nRW8Xj011gur7DEq7oIGHFF2uk/5SayFxIMBjk5VzCK1E4mSTHBbRqDgCYIL6\r\n3UAEwZlDWhD3aF9aoSjS50X4o/N0zsL3mdgVc9PNuD9IdRmqH7hA/nqdYuQ4\r\nFAljpiqaSSSTcwuhBFEPNR3ZRdE295imwaKna2biNsnQbhyzVYblIvCzzbq+\r\njMsxO5c/hwzhws1ohh/uvWvR+bBHH5CLbicATrkf3pPnJKeuGOWCP4I9m2Zj\r\n8/Yb7vyo2EpdCDRGgmXM9tdxcMDA8HYKisPuYVuMCFWVOFaHh5JcFs61xL07\r\nekeijMpK6baPFfqRQzqEJcQHG+3pGyAI/9FggwZ30ss3140otMd1Blnm2sGl\r\nXmG8Us3oMKnxRsAPSBwEyg97AGrqX4E03fJYB3CkZYrFfxyGZ0PXSbHUj+j5\r\nDWU9MvjwcghHJvAcim3GaTCTy9KBIPiHE0A=\r\n=BsTK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"dojima-network","email":"dojimanetwork@gmail.com"},"directories":{},"maintainers":[{"name":"dojima-network","email":"dojimanetwork@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polkadot_0.1.3_1672158156104_0.9971775215390086"},"_hasShrinkwrap":false},"0.1.4":{"name":"@d11k-ts/polkadot","version":"0.1.4","description":"polkadot module for d11k chain","keywords":["d11k","polkadot","dojima"],"author":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"homepage":"https://github.com/dojimanetwork/d11k-ts#readme","license":"ISC","main":"lib/index.js","module":"lib/index.esm.js","typings":"lib/index.d.ts","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dojimanetwork/d11k-ts.git"},"scripts":{"clean":"rimraf lib/**","build":"yarn && yarn clean && rollup -c","test":"jest","lint":"eslint \"{src,__tests__}/**/*.ts\" --fix --max-warnings 0","prepublishOnly":"yarn build"},"bugs":{"url":"https://github.com/dojimanetwork/d11k-ts/issues"},"dependencies":{"@d11k-ts/client":"^0.1.6","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1","bignumber.js":"^9.1.1"},"devDependencies":{},"peerDependencies":{"@d11k-ts/client":"^0.1.6","@d11k-ts/crypto":"^0.1.1","@polkadot/api":"^9.9.1","@polkadot/util":"^10.2.1","axios":"^1.2.1","bignumber.js":"^9.1.1"},"_id":"@d11k-ts/polkadot@0.1.4","dist":{"shasum":"a997929685b86c6246585f4e30b29f2245665393","integrity":"sha512-1a0xg+Tg/TAaAeK1WusIA6IShq77ivy12BDzUL4hIyQQ9SbuldKDgFka3VEsO4o4A1UrEArD4t0Y4OOfVQmEZA==","tarball":"https://registry.npmjs.org/@d11k-ts/polkadot/-/polkadot-0.1.4.tgz","fileCount":11,"unpackedSize":77611,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBXU+m9FC/XY3d/ipwICEEdgECUNGjwoFXmhRMAOxPuYAiEA9UG1S6fSanOiPEwloCHRnmKlHhg3C6akNo7998IIH9Y="}]},"_npmUser":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"directories":{},"maintainers":[{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},{"name":"dojima-network","email":"dojimanetwork@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/polkadot_0.1.4_1686201756910_0.16952236700731982"},"_hasShrinkwrap":false}},"time":{"created":"2022-12-08T17:24:57.627Z","0.1.1":"2022-12-08T17:24:57.906Z","modified":"2023-06-08T05:22:37.236Z","0.1.2":"2022-12-15T16:34:09.207Z","0.1.3":"2022-12-27T16:22:36.332Z","0.1.4":"2023-06-08T05:22:37.115Z"},"maintainers":[{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},{"name":"dojima-network","email":"dojimanetwork@gmail.com"}],"description":"polkadot module for d11k chain","homepage":"https://github.com/dojimanetwork/d11k-ts#readme","keywords":["d11k","polkadot","dojima"],"repository":{"type":"git","url":"git+https://github.com/dojimanetwork/d11k-ts.git"},"author":{"name":"yerramreddyuday","email":"uday.prasad@dojima.network"},"bugs":{"url":"https://github.com/dojimanetwork/d11k-ts/issues"},"license":"ISC","readme":"# `@d11k-ts/polkadot`\n\n## Modules\n\n- `client` - Custom client for communicating with polkadot by using [@polkadot/api](https://github.com/polkadot-js/api)\n\n## Installation\n\n```\nyarn add @d11k-ts/polkadot\n```\n\n## Documentation : Basic usage examples\n\n### Connect wallet to new PolkadotClient\n\n- Create new Polkadot client\n- Network default is `Mainnet`\n\n```ts\n// Imports\nimport { Network } from '@d11k-ts/client'\nimport { PolkadotClient } from '@d11k-ts/polkadot'\n\n//Connect wallet, get address and check balance \nconst connectWallet = async () => {\n  let phrase = \"phrase\"\n  // Mainnet\n  const polkaClient = new PolkadotClient({phrase})\n  // DojTestnet\n  // const polkaClient = new PolkadotClient({ \n  //    phrase, \n  //    network: Network.DojTestnet \n  //    provider: 'wss://dotws-test.h4s.dojima.network:9944'\n  // })\n  let address = polkaClient.getAddress()\n  try {\n      const balance = await polkaClient.getBalance(address)\n      console.log(`Adress: ${address} with balance ${balance}`)\n\n    } catch (error) {\n      console.log(`Caught: ${error} `)\n    }\n  process.exit()\n}\n```\n\n### Transfer dot using PolkadotClient\n\n- Create new PolkadotClient instance\n- Build transaction\n- Returns txHash as string\n\n```ts\nconst transferDot = async () => {\n  // First initiate PolkadotClient\n  let amountToTransfer = 0.001\n  let recipient = 'insert address'\n  console.log(\"Building transaction\")\n  try {\n    const txid = await polkaClient.transfer({ \n      recipient,\n      amount: amountToTransfer\n    })\n    console.log(`Transaction sent: ${txid}`)\n    return txid\n  } catch (error) {\n    console.log(`Caught: ${error} `)\n  }\n  process.exit()\n}\n```\n\n### Get transaction Data & transaction History\n\n- No code for retrieving tx data and history in @d11k-ts/polkadot.\n- View tx details in explorer\n- Mainnet : [polkadot-subscan](https://polkadot.subscan.io/)\n\n### Get gas fee for transaction\n\n- Retrieve gas fee for transaction from build tx\n\n```ts\nconst fee = async () => {\n  let amountToTransfer = 0.001\n  let recipient = 'insert address'\n  try {\n    const fees = polkaClient.getFees({\n      recipient,\n      amount: amountToTransfer\n    })\n    console.log(`Fees Fast: ${fees.average} Fastest: ${fees.fast} Average: ${fees.slow}`)\n  } catch (error) {\n    console.log(`Caught ${error}`)\n  }\n  process.exit()\n}\n```\n\n### Get Polkadot Inbound address\n\n- Get Polkadot Inbound address from hermes chain\n- Can be used in adding liquidity pool and swapping\n\n```ts\nconst inboundAddr = async () => {\n  try {\n    const inboundAddress = await polkaClient.getPolkadotInboundAddress()\n    console.log('Inbound Address :: ', inboundAddress)\n  } catch (error) {\n    console.log(`Caught ${error}`)\n  }\n  process.exit()\n}\n```\n\n### Get default liquidity pool gas fee\n\n- Get Polkadot default liquidity pool gas fee from hermes chain\n\n```ts\nconst defaultLPGasFee = async () => {\n  try {\n    const LPDefaultGasFee = await polkaClient.getDefaultLiquidityPoolGasFee()\n    console.log('Liquidity pool default gas fee :: ', LPDefaultGasFee)\n  } catch (error) {\n    console.log(`Caught ${error}`)\n  }\n  process.exit()\n}\n```\n\n### Add DOT token into liquidity pool\n\n- Add DOT tokens into liquidity pool\n- Get Polkadot Inbound address from hermes chain\n\n```ts\nconst addDotToLiquidityPool = async () => {\n  let amountToTransfer = 0.001\n  const inboundAddress = await polkaClient.getPolkadotInboundAddress()\n  try {\n    const liquidityPoolHash = await polkaClient.addLiquidityPool(\n      amountToTransfer,\n      inboundAddress,\n      dojAddress,           // optional dojima address\n    )\n    console.log('Liquidity pool hash : ', liquidityPoolHash)\n  } catch (error) {\n    console.log(`Caught ${error}`)\n  }\n  process.exit()\n}\n```\n\n### Swap DOT tokens\n\n- Swap DOT tokens to required token using receiver address\n- Get Polkadot Inbound address from hermes chain\n- Supported tokens for swapping - 'AR', 'BNB', 'DOJ', 'ETH', 'SOL'\n\n```ts\nimport {SwapAssetList} from '@d11k-ts/utils'\n\nconst swapDOT = async () => {\n  let amountToTransfer = 0.001\n  const inboundAddress = await polkaClient.getPolkadotInboundAddress()\n  try {\n    const swapHash = await polkaClient.swap(\n       amountToTransfer,\n      SwapAssetList,\n      inboundAddress,\n      reciepient                // Respective receiver SwapAssetList token address\n    )\n    console.log('Swap tx hash : ', swapHash)\n  } catch (error) {\n    console.log(`Caught ${error}`)\n  }\n  process.exit()\n}\n```\n\n### Example Code\n\nFor sample code check out example test case in `./examples/test.ts`","readmeFilename":"README.md"}