{"_id":"@cubist-labs/cubesigner-snap","_rev":"8-7e824f8223d3138c1e675221a2171e12","name":"@cubist-labs/cubesigner-snap","dist-tags":{"latest":"0.2.13"},"versions":{"0.1.20230907":{"name":"@cubist-labs/cubesigner-snap","version":"0.1.20230907","author":{"name":"Cubist Inc."},"license":"(MIT-0 OR Apache-2.0)","_id":"@cubist-labs/cubesigner-snap@0.1.20230907","maintainers":[{"name":"noetzli","email":"n@cubist.dev"},{"name":"mlfbrown_cubist","email":"f@cubist.dev"},{"name":"amilicevic","email":"m@cubist.dev"},{"name":"d-cubist-dev","email":"d@cubist.dev"}],"homepage":"https://github.com/cubist-labs/CubeSigner-Snap#readme","bugs":{"url":"https://github.com/cubist-labs/CubeSigner-Snap/issues"},"dist":{"shasum":"d4364d870e01425d573d61b060c0607333fc12de","tarball":"https://registry.npmjs.org/@cubist-labs/cubesigner-snap/-/cubesigner-snap-0.1.20230907.tgz","fileCount":7,"integrity":"sha512-bJMHNebrN+1sDT7FJQt77bQTjyFpIRLnC+PaV1XH0hc0yKGcyJ6kcVpexmY4ODWczskE4+orhfgRn/WIf46uCA==","signatures":[{"sig":"MEYCIQCR4+iFzW3zARr/fdVqZo0EW/6NGK5ujiC+1w2DYV9pMQIhAOn2HpXAOJyrQeUzi4cPUsRUjJu40hKekSWXMZy28zf7","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6996708},"main":"src/index.ts","gitHead":"70b6635fb05a0d64a2650aec44de68698ed9a75e","scripts":{"lint":"npm run lint:eslint && npm run lint:misc --check","test":"jest --maxWorkers=1 --ci","build":"mm-snap build","clean":"rimraf dist","serve":"mm-snap serve","start":"mm-snap watch","lint:fix":"npm run lint:eslint --fix && npm run lint:misc --write","prebuild":"npm install","lint:misc":"prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore","build:clean":"npm run clean && npm run build","build:types":"tsc --emitDeclarationOnly","lint:eslint":"eslint . --cache --ext js,ts"},"_npmUser":{"name":"amilicevic","email":"m@cubist.dev"},"repository":{"url":"git+https://github.com/cubist-labs/CubeSigner-Snap.git","type":"git"},"_npmVersion":"9.6.3","description":"CubeSigner Snap","directories":{},"_nodeVersion":"19.9.0","dependencies":{"buffer":"^6.0.3","@metamask/snaps-ui":"^0.32.2","@metamask/rpc-errors":"^5.1.1","@metamask/snaps-types":"^0.32.2","@cubist-labs/cubesigner-sdk":"0.1.23"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.21.0","rimraf":"^3.0.2","ts-jest":"^29.1.0","prettier":"^2.2.1","through2":"^4.0.2","typescript":"^4.7.4","@jest/globals":"^29.5.0","eslint-plugin-jest":"^26.8.2","eslint-plugin-node":"^11.1.0","@metamask/snaps-cli":"^0.38.2-flask.1","eslint-plugin-jsdoc":"^39.2.9","@metamask/snaps-jest":"^0.37.3-flask.1","eslint-plugin-import":"^2.26.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^4.2.1","@lavamoat/allow-scripts":"^2.0.3","@metamask/eslint-config":"^10.0.0","@metamask/auto-changelog":"^2.6.0","@typescript-eslint/parser":"^5.33.0","prettier-plugin-packagejson":"^2.2.11","@metamask/eslint-config-jest":"^10.0.0","@metamask/eslint-config-nodejs":"^10.0.0","@typescript-eslint/eslint-plugin":"^5.33.0","@metamask/eslint-config-typescript":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cubesigner-snap_0.1.20230907_1694128992286_0.09276950914994297","host":"s3://npm-registry-packages"}},"0.2.1":{"name":"@cubist-labs/cubesigner-snap","version":"0.2.1","author":{"name":"Cubist Inc."},"license":"(MIT-0 OR Apache-2.0)","_id":"@cubist-labs/cubesigner-snap@0.2.1","maintainers":[{"name":"noetzli","email":"n@cubist.dev"},{"name":"mlfbrown_cubist","email":"f@cubist.dev"},{"name":"amilicevic","email":"m@cubist.dev"},{"name":"d-cubist-dev","email":"d@cubist.dev"}],"homepage":"https://github.com/cubist-labs/CubeSigner-Snap#readme","bugs":{"url":"https://github.com/cubist-labs/CubeSigner-Snap/issues"},"dist":{"shasum":"d81a9c4813c4afd0148e28304676754d985d3aca","tarball":"https://registry.npmjs.org/@cubist-labs/cubesigner-snap/-/cubesigner-snap-0.2.1.tgz","fileCount":7,"integrity":"sha512-TnLeNCRoTVsk6lsxpGkL6Gpw64IIv2ByC2SBzJiKT0wYAdvsw46GX1xPJ2J3YAdc4hZHBSQ/kOfDZLF1dnoehQ==","signatures":[{"sig":"MEUCIQDFZa/86R4pNOXhyM9quVeIQZPQ+eTXV0MDJoMJsxsVIAIgQQsn/Sr8CjKKmosa9oXdz8Ymgj6uqPEVpcnpPYBCQWI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6996694},"main":"src/index.ts","gitHead":"d0dcef8866a10ae6ef0c90ac9e44ba69862e5fd0","scripts":{"lint":"npm run lint:eslint && npm run lint:misc --check","test":"jest --maxWorkers=1 --ci","build":"mm-snap build","clean":"rimraf dist","serve":"mm-snap serve","start":"mm-snap watch","lint:fix":"npm run lint:eslint --fix && npm run lint:misc --write","prebuild":"npm install","lint:misc":"prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore","build:clean":"npm run clean && npm run build","build:types":"tsc --emitDeclarationOnly","lint:eslint":"eslint . --cache --ext js,ts"},"_npmUser":{"name":"amilicevic","email":"m@cubist.dev"},"repository":{"url":"git+https://github.com/cubist-labs/CubeSigner-Snap.git","type":"git"},"_npmVersion":"9.6.3","description":"CubeSigner Snap","directories":{},"_nodeVersion":"19.9.0","dependencies":{"buffer":"^6.0.3","@metamask/snaps-ui":"^0.32.2","@metamask/rpc-errors":"^5.1.1","@metamask/snaps-types":"^0.32.2","@cubist-labs/cubesigner-sdk":"0.1.23"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.21.0","rimraf":"^3.0.2","ts-jest":"^29.1.0","prettier":"^2.2.1","through2":"^4.0.2","typescript":"^4.7.4","@jest/globals":"^29.5.0","eslint-plugin-jest":"^26.8.2","eslint-plugin-node":"^11.1.0","@metamask/snaps-cli":"^0.38.2-flask.1","eslint-plugin-jsdoc":"^39.2.9","@metamask/snaps-jest":"^0.37.3-flask.1","eslint-plugin-import":"^2.26.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^4.2.1","@lavamoat/allow-scripts":"^2.0.3","@metamask/eslint-config":"^10.0.0","@metamask/auto-changelog":"^2.6.0","@typescript-eslint/parser":"^5.33.0","prettier-plugin-packagejson":"^2.2.11","@metamask/eslint-config-jest":"^10.0.0","@metamask/eslint-config-nodejs":"^10.0.0","@typescript-eslint/eslint-plugin":"^5.33.0","@metamask/eslint-config-typescript":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cubesigner-snap_0.2.1_1694192503250_0.18708613329925683","host":"s3://npm-registry-packages"}},"0.2.10":{"name":"@cubist-labs/cubesigner-snap","version":"0.2.10","author":{"name":"Cubist Inc."},"license":"(MIT-0 OR Apache-2.0)","_id":"@cubist-labs/cubesigner-snap@0.2.10","maintainers":[{"name":"noetzli","email":"n@cubist.dev"},{"name":"mlfbrown_cubist","email":"f@cubist.dev"},{"name":"amilicevic","email":"m@cubist.dev"},{"name":"d-cubist-dev","email":"d@cubist.dev"}],"homepage":"https://github.com/cubist-labs/CubeSigner-Snap#readme","bugs":{"url":"https://github.com/cubist-labs/CubeSigner-Snap/issues"},"dist":{"shasum":"6a2ed7c1195ef93cfc41934a5fb79063f3991a5b","tarball":"https://registry.npmjs.org/@cubist-labs/cubesigner-snap/-/cubesigner-snap-0.2.10.tgz","fileCount":7,"integrity":"sha512-gpMbJcwXYYRQFYMkS3t7iDHyG5L+OlOHTrJuhPyf0Y4kJLJNf43o6+etFCdjgcSNbqTK1UeHFEjI8v3lRx5vzQ==","signatures":[{"sig":"MEQCIDCJXQxo9B6L55ls2drsjxPKaRo2UJKOmiEASw0CxiSRAiB7QFUiPlJmTHf4inTcrwH6o0ZqkS6aQq/i2sg/MfN/nw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6980772},"main":"src/index.ts","gitHead":"24d1a9a64e5cdf87a51ac440c25cde062a897646","scripts":{"lint":"npm run lint:eslint && npm run lint:misc --check","test":"jest --maxWorkers=1 --ci","build":"mm-snap build","clean":"rimraf dist","serve":"mm-snap serve","start":"mm-snap watch","lint:fix":"npm run lint:eslint --fix && npm run lint:misc --write","prebuild":"npm install","lint:misc":"prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore","build:clean":"npm run clean && npm run build","build:types":"tsc --emitDeclarationOnly","lint:eslint":"eslint . --cache --ext js,ts"},"_npmUser":{"name":"amilicevic","email":"m@cubist.dev"},"repository":{"url":"git+https://github.com/cubist-labs/CubeSigner-Snap.git","type":"git"},"_npmVersion":"8.19.4","description":"CubeSigner Snap","directories":{},"_nodeVersion":"16.20.0","dependencies":{"buffer":"^6.0.3","@metamask/snaps-ui":"^0.32.2","@metamask/rpc-errors":"^5.1.1","@metamask/snaps-types":"^0.32.2","@cubist-labs/cubesigner-sdk":"0.1.23"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.21.0","rimraf":"^3.0.2","ts-jest":"^29.1.0","prettier":"^2.2.1","through2":"^4.0.2","typescript":"^4.7.4","@jest/globals":"^29.5.0","eslint-plugin-jest":"^26.8.2","eslint-plugin-node":"^11.1.0","@metamask/snaps-cli":"^0.38.2-flask.1","eslint-plugin-jsdoc":"^39.2.9","@metamask/snaps-jest":"^0.37.3-flask.1","eslint-plugin-import":"^2.26.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^4.2.1","@lavamoat/allow-scripts":"^2.0.3","@metamask/eslint-config":"^10.0.0","@metamask/auto-changelog":"^2.6.0","@typescript-eslint/parser":"^5.33.0","prettier-plugin-packagejson":"^2.2.11","@metamask/eslint-config-jest":"^10.0.0","@metamask/eslint-config-nodejs":"^10.0.0","@typescript-eslint/eslint-plugin":"^5.33.0","@metamask/eslint-config-typescript":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cubesigner-snap_0.2.10_1694466724959_0.39307860525374605","host":"s3://npm-registry-packages"}},"0.2.13":{"name":"@cubist-labs/cubesigner-snap","version":"0.2.13","author":{"name":"Cubist Inc."},"license":"(MIT-0 OR Apache-2.0)","_id":"@cubist-labs/cubesigner-snap@0.2.13","maintainers":[{"name":"noetzli","email":"n@cubist.dev"},{"name":"mlfbrown_cubist","email":"f@cubist.dev"},{"name":"amilicevic","email":"m@cubist.dev"},{"name":"d-cubist-dev","email":"d@cubist.dev"}],"homepage":"https://github.com/cubist-labs/CubeSigner-Snap#readme","bugs":{"url":"https://github.com/cubist-labs/CubeSigner-Snap/issues"},"dist":{"shasum":"d8792a8f6e199aec64dbd8d2dd37177b597f55bb","tarball":"https://registry.npmjs.org/@cubist-labs/cubesigner-snap/-/cubesigner-snap-0.2.13.tgz","fileCount":7,"integrity":"sha512-qYZ56Yh14lpK3QvaoE1720R7kyLGvaJ7HbZN+wrMJGIs78sLZblQygCtaK9Bgi+ogOjP4B88pqowkzbBi2fs9A==","signatures":[{"sig":"MEUCIQCS6xUniCUzUcNK4iRJgBoRMavXgL9wWx7Rxa6bfRkGkAIgT9muhHoMIgEATalJR8F1xtljclkWx7zSbzNnHKMH184=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":6980768},"main":"src/index.ts","gitHead":"e6f02390817e789c8bd7341c45555cea5d8fe72a","scripts":{"lint":"npm run lint:eslint && npm run lint:misc --check","test":"jest --maxWorkers=1 --ci","build":"mm-snap build","clean":"rimraf dist","serve":"mm-snap serve","start":"mm-snap watch","lint:fix":"npm run lint:eslint --fix && npm run lint:misc --write","prebuild":"npm install","lint:misc":"prettier '**/*.json' '**/*.md' '!CHANGELOG.md' --ignore-path .gitignore","build:clean":"npm run clean && npm run build","build:types":"tsc --emitDeclarationOnly","lint:eslint":"eslint . --cache --ext js,ts"},"_npmUser":{"name":"amilicevic","email":"m@cubist.dev"},"repository":{"url":"git+https://github.com/cubist-labs/CubeSigner-Snap.git","type":"git"},"_npmVersion":"8.19.4","description":"CubeSigner Snap","directories":{},"_nodeVersion":"16.20.0","dependencies":{"buffer":"^6.0.3","@metamask/snaps-ui":"^0.32.2","@metamask/rpc-errors":"^5.1.1","@metamask/snaps-types":"^0.32.2","@cubist-labs/cubesigner-sdk":"0.1.23"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","eslint":"^8.21.0","rimraf":"^3.0.2","ts-jest":"^29.1.0","prettier":"^2.2.1","through2":"^4.0.2","typescript":"^4.7.4","@jest/globals":"^29.5.0","eslint-plugin-jest":"^26.8.2","eslint-plugin-node":"^11.1.0","@metamask/snaps-cli":"^0.38.2-flask.1","eslint-plugin-jsdoc":"^39.2.9","@metamask/snaps-jest":"^0.37.3-flask.1","eslint-plugin-import":"^2.26.0","eslint-config-prettier":"^8.1.0","eslint-plugin-prettier":"^4.2.1","@lavamoat/allow-scripts":"^2.0.3","@metamask/eslint-config":"^10.0.0","@metamask/auto-changelog":"^2.6.0","@typescript-eslint/parser":"^5.33.0","prettier-plugin-packagejson":"^2.2.11","@metamask/eslint-config-jest":"^10.0.0","@metamask/eslint-config-nodejs":"^10.0.0","@typescript-eslint/eslint-plugin":"^5.33.0","@metamask/eslint-config-typescript":"^10.0.0"},"_npmOperationalInternal":{"tmp":"tmp/cubesigner-snap_0.2.13_1694473257230_0.6912291261374894","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-09-07T23:23:12.119Z","modified":"2025-04-11T04:04:48.303Z","0.1.20230907":"2023-09-07T23:23:12.532Z","0.2.1":"2023-09-08T17:01:43.544Z","0.2.10":"2023-09-11T21:12:05.276Z","0.2.13":"2023-09-11T23:00:57.525Z"},"bugs":{"url":"https://github.com/cubist-labs/CubeSigner-Snap/issues"},"author":{"name":"Cubist Inc."},"license":"(MIT-0 OR Apache-2.0)","homepage":"https://github.com/cubist-labs/CubeSigner-Snap#readme","repository":{"url":"git+https://github.com/cubist-labs/CubeSigner-Snap.git","type":"git"},"description":"CubeSigner Snap","maintainers":[{"email":"f@cubist.dev","name":"mlfbrown_cubist"},{"email":"m@cubist.dev","name":"amilicevic"},{"email":"n@cubist.dev","name":"noetzli"}],"readme":"# CubeSigner Snap\n\nThis package provides an interface to CubeSigner's remote services via\nthe MetaMasks's JSON-RPC snap API.\n\nCubeSigner is a hardware-backed, non-custodial platform for securely managing\ncryptographic keys. The CubeSigner Snap uses the [CubeSigner TypeScript\nSDK](https://github.com/cubist-labs/CubeSigner-TypeScript-SDK) to let your\nMetaMask users sign transactions on EVM-based chains like Ethereum, Avalanche,\nand Polygon, and on non-EVM chains like Bitcoin and Solana.\n\n### CubeSigner background\n\n[The Cubist team](https://cubist.dev/about) built CubeSigner to address the key\nsecurity vs key availability tradeoff: right now, many teams are forced to keep\nkeys available in memory and therefore exposed to attackers, or try to keep\nkeys safe—usually only at rest—at serious latency and engineering cost.\nCubeSigner addresses this problem by giving developers low-latency access to\nhardware-backed key generation and signing. During each of these operations,\nCubeSigner safeguards their users' keys in HSM-sealed Nitro Enclaves—combining\ncold wallet security with hot wallet speed and simplicity.\n\nRight now, the CubeSigner Snap supports signing for EVM chains like Ethereum\nand Avalanche, and non-EVM chains Bitcoin and Solana. Support for more chains\nand more features is in the works!\n\n## JSON-RPC methods\n\n### `login`\n\nPrompts the user to log into CubeSigner. A dApp or snap can automatically log\nthe user in by providing the user's API session token (which they can get by\nauthenticating the user server-side); alternatively they can ask the user to\ninput their secret API session token.\n\n> **Warning**\n> The API session token is sensitive and can be used to sign with (some of)\n> your keys. Do NOT share it or paste it anywhere except the CubeSigner Snap\n> dialog.\n\n#### Example (with token)\n\n```typescript\nawait window.ethereum.request<boolean>({\n  method: \"wallet_invokeSnap\",\n  params: {\n    snapId: defaultSnapId,\n    request: {\n      method: \"login\",\n      params: { token_base64: \"ewog...Q===\" },\n    },\n  },\n});\n```\n\n#### Example (without token)\n\n```typescript\nawait window.ethereum.request<boolean>({\n  method: \"wallet_invokeSnap\",\n  params: { snapId: defaultSnapId, request: { method: \"login\" } },\n});\n```\n\n### `logout`\n\nAsks the user for confirmation, then logs out of CubeSigner. If\nsuccessful, notifies the user.\n\n#### Example\n\n```typescript\nawait window.ethereum.request({\n  method: \"wallet_invokeSnap\",\n  params: { snapId: defaultSnapId, request: { method: \"logout\" } },\n});\n```\n\n### `get_keys`\n\nReturns all keys accessible from the current session.\n\n#### Returns\n\nAn array of objects, each of which containing:\n\n- `id: string` - the unique key identifier\n- `enabled: boolean` - whether the key is enabled\n- `type: KeyType` - key type (e.g., \"SecpEthAddr\", \"SecpBtc\", \"BlsPub\", etc.)\n- `materialId: string` - a unique identifier specific to the type of key, such as a public key or an Ethereum address\n- `publicKey: string` - hex-encoded, serialized public key (the format used depends on the key type)\n- `owner: string` - the unique identifier of user who owns the key\n\n#### Example\n\n```typescript\nconst keys = (await window.ethereum.request<Key[]>({\n  method: \"wallet_invokeSnap\",\n  params: { snapId: defaultSnapId, request: { method: \"get_keys\" } },\n})) as Key[];\n\nkeys.forEach((key) => console.log(key.id));\n```\n\n### `sign_blob`\n\nAsks the user for confirmation, then proceeds to sign a raw blob.\n\n#### Parameters\n\n- `keyId: string` - the identifier of the key to use for signing (corresponds to the `KeyInfo.key_id` property)\n- `body: BlobSignRequest` - the request object containing:\n  - `message_base64: string` - the blob to sign, encoded as a base64 string\n\n#### Returns\n\nAn object containing the signature:\n\n- `signature: string` - the signature, encoded as a hex string\n\n#### Example\n\n```typescript\nconst sig = (await window.ethereum.request<BlobSignResponse>({\n  method: \"wallet_invokeSnap\",\n  params: {\n    snapId: defaultSnapId,\n    request: {\n      method: \"sign_blob\",\n      params: {\n        keyId: \"Key#...\",\n        body: { message_base64: \"L1kE9g59xD3fzYQQSR7340BwU9fGrP6EMfIFcyX/YBc=\" },\n      },\n    },\n  },\n})) as BlobSignResponse;\n\nconsole.log(sig.signature);\n```\n\n### `sign_evm`\n\nAsks the user for confirmation, then proceeds to sign an EVM transaction.\n\n#### Parameters\n\n- `pubkey: string` - the material ID of the key to use for signing (corresponds to the `KeyInfo.material_id` property)\n- `body: Eth1SignRequest` - the request object containing:\n  - `chain_id: number` - the ID of the chain\n  - `tx` - [unsigned transaction](https://docs.ethers.org/v5/api/utils/transactions/#UnsignedTransaction)\n\n#### Returns\n\nAn object containing the signature:\n\n- `rlp_signed_tx: string` - hex-encoded RLP encoding of the transaction and its signature\n\n#### Example\n\n```typescript\nconst sig = (await window.ethereum.request<Eth1SignResponse>({\n  method: \"wallet_invokeSnap\",\n  params: {\n    snapId: defaultSnapId,\n    request: {\n      method: \"sign_evm\",\n      params: {\n        pubkey: \"0x...\",\n        body: {\n          chain_id: 1,\n          tx: { ... }\n        }\n      }\n    }\n  },\n})) as Eth1SignResponse;\n\nconsole.log(sig.rlp_signed_tx);\n```\n\n### `sign_solana`\n\nAsks the user for confirmation, then proceeds to sign a Solana transaction.\n\n#### Parameters\n\n- `pubkey: string` - the material ID of the key to use for signing (corresponds to the `KeyInfo.material_id` property)\n- `body: SolanaSignRequest` - the request object containing\n  - `message` - [Solana message](https://docs.rs/solana-program/latest/solana_program/message/legacy/struct.Message.html) to sign\n\n#### Returns\n\nA `SolanaSignResponse` object containing the signature:\n\n- `signature: string` - hex-encoded signature\n\n#### Example\n\n```typescript\nconst sig = (await window.ethereum.request<SolanaSignResponse>({\n  method: \"wallet_invokeSnap\",\n  params: {\n    snapId: defaultSnapId,\n    request: {\n      method: \"sign_solana\",\n      params: {\n        pubkey: \"Solana_...\",\n        body: {\n          message: { ... }\n        }\n      }\n    }\n  },\n})) as SolanaSignResponse;\n\nconsole.log(sig.signature);\n```\n\n### `sign_btc`\n\nAsks the user for confirmation, then proceeds to sign a Bitcoin transaction.\n\n- `pubkey: string` - the material ID of the key to use for signing (corresponds to the `KeyInfo.material_id` property)\n- `body: BtcSignRequest` - the request object\n\n#### Returns\n\nA `BtcSignResponse` object containing the signature:\n\n- `signature: string` - the hex-encoded signature in DER format\n\n#### Example\n\n```typescript\nconst sig = (await window.ethereum.request<BtcSignResponse>({\n  method: \"wallet_invokeSnap\",\n  params: {\n    snapId: defaultSnapId,\n    request: {\n      method: \"sign_btc\",\n      params: {\n        pubkey: \"bc1...\",\n        body: {\n          sig_kind: {\n            Segwit: {\n              input_index: 0,\n              script_code: \"0x76a91479091972186c449eb1ded22b78e40d009bdf008988ac\",\n              value: 1_000_000,\n              sighash_type: \"All\",\n            },\n            tx: {\n              version: 1,\n              lock_time: 1170,\n              input: [\n                {\n                  previous_output:\n                    \"77541aeb3c4dac9260b68f74f44c973081a9d4cb2ebe8038b2d70faa201b6bdb:1\",\n                  script_sig: \"\",\n                  sequence: 4294967294,\n                  witness: [],\n                },\n              ],\n              output: [\n                {\n                  value: 199996600,\n                  script_pubkey: \"76a914a457b684d7f0d539a46a45bbc043f35b59d0d96388ac\",\n                },\n                {\n                  value: 800000000,\n                  script_pubkey: \"76a914fd270b1ee6abcaea97fea7ad0402e8bd8ad6d77c88ac\",\n                },\n              ],\n            },\n          },\n        },\n      },\n    },\n  },\n})) as BtcSignResponse;\n\nconsole.log(sig.signature);\n```\n","readmeFilename":"README.md"}