{"_id":"@decentralizedauthority/nodewallet-sdk","name":"@decentralizedauthority/nodewallet-sdk","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@decentralizedauthority/nodewallet-sdk","version":"0.1.0","main":"./dist/index.js","source":"./src/index.ts","types":"./dist/index.d.ts","jest":{"preset":"jest-presets/jest/node"},"dependencies":{"@decentralizedauthority/nodewallet-constants":"0.1.1","@decentralizedauthority/nodewallet-content":"0.1.0","@decentralizedauthority/nodewallet-content-bridge":"0.1.0","events":"^3.3.0","lodash":"^4.17.21"},"repository":{"type":"git","url":"git+https://github.com/decentralized-authority/pokt-browser-wallet.git"},"gitHead":"095525ebe5db0cff8ce9f760419823675c8e62ba","description":"Provides straightforward, programmatic access to the NodeWallet extension wallet in TypeScript/JavaScript projects.","bugs":{"url":"https://github.com/decentralized-authority/pokt-browser-wallet/issues"},"homepage":"https://github.com/decentralized-authority/pokt-browser-wallet#readme","_id":"@decentralizedauthority/nodewallet-sdk@0.1.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-zsgXReQLaV5lk3K+Dju78Ak5c0KbKqRpiVxKuNoxSGL2qnmrohsLWPEqWTLR5DszTHMkc7Htg+NAiJX5+9ekuQ==","shasum":"54caf4e26c570afe0519dca33e96c6b2335bcb85","tarball":"https://registry.npmjs.org/@decentralizedauthority/nodewallet-sdk/-/nodewallet-sdk-0.1.0.tgz","fileCount":8,"unpackedSize":36231,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCST4KBRKaNWM+9YzUkX9Ptxgc9AfqXbV2YadPClKXkIQIgHLz8sizEKyUZLtdBvntgE/CbdPVLrkEEQsEBzhK52/k="}]},"_npmUser":{"name":"decentralizedauthority","email":"admin@decentralizedauthority.com"},"directories":{},"maintainers":[{"name":"decentralizedauthority","email":"admin@decentralizedauthority.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/nodewallet-sdk_0.1.0_1705644040159_0.33637739347013773"},"_hasShrinkwrap":false}},"time":{"created":"2024-01-19T06:00:40.040Z","0.1.0":"2024-01-19T06:00:40.312Z","modified":"2024-01-19T06:00:40.587Z"},"maintainers":[{"name":"decentralizedauthority","email":"admin@decentralizedauthority.com"}],"description":"Provides straightforward, programmatic access to the NodeWallet extension wallet in TypeScript/JavaScript projects.","homepage":"https://github.com/decentralized-authority/pokt-browser-wallet#readme","repository":{"type":"git","url":"git+https://github.com/decentralized-authority/pokt-browser-wallet.git"},"bugs":{"url":"https://github.com/decentralized-authority/pokt-browser-wallet/issues"},"readme":"# NodeWallet SDK\nProvides straightforward, programmatic access to the NodeWallet extension wallet in TypeScript/JavaScript projects.\n\n## Available Methods\n```ts\nclass NodeWalletSDK {\n  getPocket(): Promise<PocketProvider>\n}\nclass PocketProvider {\n\n  connect(): Promise<{address: string, publicKey: string, chain: ChainType}>\n  \n  checkConnected(): void;\n  isNodeWalletSdkOptimized(): Promise<boolean>\n  isConnected(): Promise<boolean>\n  getConnectedAddress(): string\n  getConnectedPublicKey(): string\n  getConnectedChain(): ChainType\n  \n  wallet: PocketProviderWallet\n  rpc: PocketProviderRpc\n  \n}\n\nclass PocketProviderWallet {\n  balance(address: string): Promise<{balance: number}>\n  height(): Promise<{height: number}>\n  tx(hash: string): Promise<Transaction>\n  sendTransaction(params: {amount: string, to: string, from: string, memo?: string}): Promise<{hash: string}>\n  signMessage(params: {message: string, address: string}): Promise<{signature: string}>\n  stakeNode(params: {amount: string, address: string, operatorPublicKey: string, chains: string[], serviceURL: string}): Promise<{hash: string}>\n}\n\nclass PocketProviderRpc {\n  getBalance(address: string): Promise<bigint>\n  getBlock(blockNumber: number): Promise<Block>\n  getTransaction(transactionHash: string): Promise<Transaction>\n  getBlockNumber(): Promise<number>\n  getNode(params: {address: string, blockHeight?: number}): Promise<Node>\n  getApp(params: {address: string, blockHeight?: number}): Promise<App>\n  getAccount(address: string): Promise<Account>\n}\n```\n\n## Usage\n```ts\n// Construct the SDK\nconst sdk = new NodeWalletSDK({\n  connectTimeout: 30000,\n  requestTimeout: 30000,\n});\n// Get the Pocket Provider\nconst pocket = await sdk.getPocket();\n// Connect to the extension wallet\nconst { address, publicKey, chain } = await pocket.connect();\n// You can now call any of the available methods in pocket.wallet and pocket.rpc\n```\n","readmeFilename":"README.md"}