{"_id":"@censo-custody/solana-wallet-adapter","name":"@censo-custody/solana-wallet-adapter","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@censo-custody/solana-wallet-adapter","version":"0.1.0","author":{"name":"Censo Developers","email":"developers@censocustody.com"},"repository":{"type":"git","url":"git+https://github.com/CensoCustody/censo-solana-wallet-adapter.git"},"license":"Apache-2.0","type":"module","sideEffects":false,"main":"lib/cjs/index.js","module":"lib/esm/index.js","types":"lib/types/index.d.ts","exports":{"import":"./lib/esm/index.js","require":"./lib/cjs/index.js"},"publishConfig":{"access":"public"},"scripts":{"clean":"shx rm -rf lib/*","build":"yarn clean && tsc -p tsconfig.json && tsc -p tsconfig.cjs.json","postbuild":"echo '{\"type\":\"commonjs\"}' | npx json > lib/cjs/package.json && echo '{\"type\":\"module\"} ' | npx json > lib/esm/package.json"},"dependencies":{"@solana/web3.js":"^1.44.3","bs58":"^4.0.1","eventemitter3":"^4.0.7","uuid":"^8.3.2"},"devDependencies":{"@babel/eslint-parser":"^7.16.5","@types/bs58":"^4.0.1","@types/eslint":"^8.2.1","@types/eslint-plugin-prettier":"^3.1.0","@types/node":"^18.0.0","@types/node-fetch":"^2.6.2","@types/prettier":"^2.4.2","@types/uuid":"^8.3.4","@typescript-eslint/eslint-plugin":"^5.14.0","@typescript-eslint/parser":"^5.14.0","babel-eslint":"^10.1.0","eslint":"^8.11.0","eslint-config-prettier":"^8.5.0","eslint-config-react-app":"^7.0.0","eslint-plugin-prettier":"^4.0.0","gh-pages":"^4.0.0","prettier":"^2.5.1","shx":"^0.3.3","tsc-esm":"^1.0.4","tslib":"^2.3.0","typedoc":"^0.23.1","typescript":"^4.6.2","typescript-esm":"^2.0.0"},"gitHead":"fe26dcec927e4a8bf7893fe53982ad5dfbfb8386","description":"Solana wallet adapter module for [Censo Custody](https://censocustody.com)","bugs":{"url":"https://github.com/CensoCustody/censo-solana-wallet-adapter/issues"},"homepage":"https://github.com/CensoCustody/censo-solana-wallet-adapter#readme","_id":"@censo-custody/solana-wallet-adapter@0.1.0","_nodeVersion":"14.17.1","_npmVersion":"6.14.13","dist":{"integrity":"sha512-iM1jFVzBMfk7iokgUVfA2xvGUegixklUISgMARa/VA2mFIjoi32t4xmD8PtWHht81fmg107aYhLnTV1cM7NkAg==","shasum":"064adae9f216dc4b726c1cc45b6b24cf0c734f07","tarball":"https://registry.npmjs.org/@censo-custody/solana-wallet-adapter/-/solana-wallet-adapter-0.1.0.tgz","fileCount":17,"unpackedSize":84217,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDRWbKNQvMyr6nzrJrMHxF/CgcajgtH4O+Cd0yfRPrYbQIgUlOROmZqghq7LicQIJ6aI3oPWx72mJD3qHCgvFDew/k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh5tSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrc6A/9G8GEDINiLQH7rdd/BtRi8MJs9ak0WYHyeAy8XI4Xexz3jnBA\r\n82WsCp9WifJ6m0EaB/mc1DBbHlU9pgRO/m5wBItgXm5SrpaFwqOeoPGztKmq\r\nfcBOkqrDiUdSQARUnM0fKp0nZ20GoW5Rr40p+jflSsLXyEJ2jpLxTV++E3VD\r\n5s5cXl3e6ZSh7MrlZEw98cSBXJj7ARaD0DcvylT2yH2OEJFiG58/VBrsG4sz\r\nj7AXJm0asjuNn6+KZo6SxaEZOLChETK3xi7fmv6f9yYFNo35bd9HKzVA4bD2\r\nf2RwdEeFeWhEg50jrieglu1JUo1EdkGlQu3IhPsBDf2YaLW8nljB7VjsX0qM\r\nFD7B1L98+9a8fMbW3Pqp3PEISuXNB/QZA6FEHVsA2V1Mat96A5UskVwis/bj\r\niMv0uz+5piYYLOUejkzbnHM9R6CTwxVxF5FLPpCBFRXTx9SLCDVzGdnQIgOq\r\ngmzsxPCzI8LBaDSM+aoQI5biyuaqB9bPeG9EC1XhYhaB+QZWoIjShp38BP2X\r\nWAymjmKOCe1MxGzZ0cZ1ccZBx1YkLMCJa5QauSqLoGtq9F3IAyrOBKUUY8RQ\r\nhbrEmq/8NzlVsm5giNfkf72rgSkQ+FuaWkKxsRIYymCkMgCkYVMbzxbhVa7Q\r\nStXhb5k7z36IwQIdhZqOY1bnK77SLC3ylkE=\r\n=BCuR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"strike-developers","email":"developers@strikeprotocols.com"},"directories":{},"maintainers":[{"name":"strike-developers","email":"developers@strikeprotocols.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solana-wallet-adapter_0.1.0_1669831505953_0.5489048031473858"},"_hasShrinkwrap":false}},"time":{"created":"2022-11-30T18:05:05.824Z","0.1.0":"2022-11-30T18:05:06.123Z","modified":"2022-11-30T18:05:06.311Z"},"maintainers":[{"name":"strike-developers","email":"developers@strikeprotocols.com"}],"description":"Solana wallet adapter module for [Censo Custody](https://censocustody.com)","homepage":"https://github.com/CensoCustody/censo-solana-wallet-adapter#readme","repository":{"type":"git","url":"git+https://github.com/CensoCustody/censo-solana-wallet-adapter.git"},"author":{"name":"Censo Developers","email":"developers@censocustody.com"},"bugs":{"url":"https://github.com/CensoCustody/censo-solana-wallet-adapter/issues"},"license":"Apache-2.0","readme":"# `@censo-custody/censo-solana-wallet`\n\nSolana wallet adapter module for [Censo Custody](https://censocustody.com)\n\n## Integrating Censo Custody to your dApp\n\nAt a high-level, supporting Censo Custody in your dApp is just like\nsupporting any other wallet supported by the solana wallet adapter.\nBut as a program-based multisig wallet, Censo Custody wallets work\na bit differently from other wallets. Because Censo Custody wallets\nare PDAs (program-derived accounts), it is not possible for the\nCenso Custody wallet to physically sign a transaction or a message.\nThere is also some transaction overhead the Censo Custody wallet\nimposes.  We have worked hard to minimize the impact of these\ndifferences, but supporting the Censo Custody wallet may still\nrequire some small modifications from dApp developers.\n\n### How the Censo Custody Wallet works\n\nGiven that Censo Custody wallets are PDAs, it may not be immediately\nclear how we can support dApp transactions at all. To explain how\nwe do it, it will be helpful to first describe how the Censo Custody\nwallet works in general. All transactions on a Censo Custody wallet,\nwhether they are simple transfers, config changes, or dApp transactions,\nare executed in the context of a \"multisig op\" account.\n\nFirst, an \"initiation\" transaction is executed, which creates and\ninitializes the multisig op account. The multisig op account stores\na description of the requested transaction and an \"approval\ndisposition\" record for each of the multisig signers.\n\nSubsequently, separate \"set approval disposition\" transactions\nrecord the disposition status (Approved or Denied) for each signer.\n\nOnce a threshold of approvals or denies have been recorded in the\nmultisig op account, the multisig op may be \"finalized\", which\nexecutes the logic required for that transaction and then removes\nthe multisig op account.\n\n### How the Censo Custody Wallet processes dApp transactions\n\nAs described above, when a dApp asks the Censo Custody wallet to\nsend or sign a transaction, Censo first initiates a multisig op for\nthat dApp transaction. The transaction instructions are serialized\nand persisted in the multisig op account in 1 or more \"supply\ninstruction\" transactions. The multisig op is not considered\n\"initiated\" until all of those supply instruction transactions have\nexecuted.\n\nWhen a threshold of approval dispositions have been received and\nthe finalization transaction is executed, the Censo Custody wallet\nprogram then rehydrates the instructions and executes them using\n`invoke_signed()`.\n\nIf the dApp had called the `signTransaction` or `signAllTransactions`\nmethods in the wallet adapter, then the signed transaction which\nis passed back is not the original transaction the dApp had requested,\nbut rather the finalization transaction. Similarly, if the dApp had\ncalled the `sendTransaction` method in the wallet adapter and\nsupplied 1 or more additional signers, then the Censo Custody wallet\nadapter will wait until it receives the finalization transaction\nfrom the Censo backend, and it is this transaction which the\nadditional signers sign.\n\n### What this means for your dApp\n\nThere are two main impacts of the Censo Custody wallet design on\ndApp integration. The first is that Censo cannot support dApp\ntransactions which are pre-signed before being passed to the wallet\nadapter, and the second is that the finalization transaction imposes\na bit of overhead in terms of transaction size, heap usage, call\ndepth, and compute budget.\n\nIf a dApp pre-signs a transaction before passing it to the wallet\nadapter (whether via `sendTransaction`, `signTransaction`, or\n`signAllTransactions`) then Censo will return this error message:\n`Censo does not support this signing mode`. To work around this\nerror, the dApp simply needs to either wait to sign until the\ntransaction is returned (if `signTransaction` or `signAllTransactions`\nwas called), or use the `signers` option (if `sendTransaction` was\ncalled). Note that it is possible to verify that the returned\nfinalization transaction does actually correspond to the requested\ntransaction by reading the instructions from the multisig op and\ncomparing them.\n\nFor most dApps, the main impact of the finalization transaction\noverhead comes down to how many accounts the dApp transaction uses.\nThe finalization transaction requires 3 additional accounts -- the\ncenso wallet program, the multisig op account and the Censo fee\npayer, which, to fit in the 1232 bytes available for a transaction,\nlimits the maximum number of accounts available to a dApp transaction\nto 31 (when there is a single signer and the dApp transaction uses\nthe wallet account). Note that any instruction parameters are already\npersisted in the multisig op and are not needed in the finalization\ntransaction.\n\nIn terms of compute budget, the finalization overhead is fairly\nminimal, at about 21,500 compute units. The finalization transaction\nconsumes one level of the allowed call depth of 4. Heap usage is\nharder to calculate, but at a minimum the finalization transaction\nneeds to rehydrate the instructions of the dApp transaction in\nmemory.\n","readmeFilename":"README.md"}