@ckb-ccc/xverse 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +1 -9
- package/dist/advancedBarrel-C-ThB6-A.d.mts.map +1 -1
- package/dist/advancedBarrel-DIYsVxWE.mjs.map +1 -1
- package/dist.commonjs/advancedBarrel-BCHIO_V8.d.ts.map +1 -1
- package/dist.commonjs/advancedBarrel-DA4O2d7u.js.map +1 -1
- package/package.json +4 -4
- package/src/sat-connect-core/types.advanced.ts +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ckb-ccc/xverse
|
|
2
2
|
|
|
3
|
+
## 1.1.2
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
- [`b9cc002`](https://github.com/ckb-devrel/ccc/commit/b9cc0027121a5a857f13727965ce688440d2a61f) Thanks [@Hanssen0](https://github.com/Hanssen0)! - chore: move tsdown to devDependencies (PR: [#422](https://github.com/ckb-devrel/ccc/issues/422))
|
|
9
|
+
|
|
10
|
+
- Updated dependencies [[`209f332`](https://github.com/ckb-devrel/ccc/commit/209f3322ffc22860b1ad43f31cbf51322493b3d9), [`ac8dba2`](https://github.com/ckb-devrel/ccc/commit/ac8dba21ab899b707e46236aa40b9e12566f9c8a), [`52309a4`](https://github.com/ckb-devrel/ccc/commit/52309a442a48f1c376fa65813ba56bcceb405b90)]:
|
|
11
|
+
- @ckb-ccc/core@1.16.0
|
|
12
|
+
|
|
13
|
+
## 1.1.1
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`98597b5`](https://github.com/ckb-devrel/ccc/commit/98597b56eb6eeb029b72ea963649155dfe1f4215), [`bef9d0a`](https://github.com/ckb-devrel/ccc/commit/bef9d0a037fba045eab24d7ad55400fa26fbbffd), [`8067a08`](https://github.com/ckb-devrel/ccc/commit/8067a08de041ffd7a624adea0b594eb283e2634e), [`7019a1a`](https://github.com/ckb-devrel/ccc/commit/7019a1a7f765dfa7940cdfe51474bcd347f18ec6), [`9beee4d`](https://github.com/ckb-devrel/ccc/commit/9beee4d7f39e4b4b19919c5feb86e1c8be0e089d), [`2d4e701`](https://github.com/ckb-devrel/ccc/commit/2d4e701e54e9bf5247c2363490009acc5606c0ea), [`0eb8435`](https://github.com/ckb-devrel/ccc/commit/0eb8435d9694602fce3b7e6a95f04f793452a88d)]:
|
|
17
|
+
- @ckb-ccc/core@1.15.0
|
|
18
|
+
|
|
3
19
|
## 1.1.0
|
|
4
20
|
### Minor Changes
|
|
5
21
|
|
package/README.md
CHANGED
|
@@ -36,15 +36,7 @@
|
|
|
36
36
|
Fully enabling CKB's Turing completeness and cryptographic freedom power.
|
|
37
37
|
</p>
|
|
38
38
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<p align="center">
|
|
42
|
-
<a href="https://app.ckbccc.com/">
|
|
43
|
-
<img src="https://raw.githubusercontent.com/ckb-devrel/ccc/master/assets/preview.png" width="30%" />
|
|
44
|
-
</a>
|
|
45
|
-
</p>
|
|
46
|
-
|
|
47
|
-
This project is still under active development, and we are looking forward to your feedback. [Try its demo now here](https://app.ckbccc.com/). It showcases how to use CCC for some basic scenarios in CKB.
|
|
39
|
+
Check the [package documentation](https://docs.ckbccc.com/docs/packages/wallet-integrations/xverse) and [API reference](https://api.ckbccc.com/modules/_ckb-ccc_xverse.index) for more details.
|
|
48
40
|
|
|
49
41
|
<h3 align="center">
|
|
50
42
|
Read more about CCC on <a href="https://docs.ckbccc.com">our website</a> or <a href="https://github.com/ckb-devrel/ccc">GitHub Repo</a>.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel-C-ThB6-A.d.mts","names":[],"sources":["../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/requests.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/sat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AA;AAAA,UAErC,QAAA;EACf,IAAA,WAAe,YAAY;EAC3B,OAAA;EACA,IAAA;AAAA;AAAA,UAGe,gBAAA,gBACA,QAAA,GAAW,QAAA,UAClB,OAAA;EACR,KAAA,EAAO,MAAA;AAAA;AAAA,UAGQ,kBAAA,sBACM,QAAA,UACb,OAAA;EACR,MAAA,EAAQ,MAAA,CAAO,MAAA;AAAA;AAAA,KAGL,WAAA,sBAAiC,QAAA,
|
|
1
|
+
{"version":3,"file":"advancedBarrel-C-ThB6-A.d.mts","names":[],"sources":["../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/requests.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/advancedBarrel.ts"],"mappings":";;;cAaa,8BAAA,EAA8B,CAAA,CAAA,eAAA;AAAA,cAC9B,8BAAA,EAA8B,CAAA,CAAA,aAAA;AAAA,KAS/B,kBAAA,GAAqB,qBAAA,CAC/B,CAAA,CAAE,WAAA,QAAmB,8BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,8BAAA;AAAA,cAIV,+BAAA,EAA+B,CAAA,CAAA,eAAA;AAAA,cAC/B,+BAAA,EAA+B,CAAA,CAAA,aAAA;AAAA,KAShC,mBAAA,GAAsB,qBAAA,CAChC,CAAA,CAAE,WAAA,QAAmB,+BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,+BAAA;AAAA,cAIV,yBAAA,EAAyB,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,UAAA;AAAA,cACzB,yBAAA,EAAyB,CAAA,CAAA,cAAA;AAAA,KAQ1B,aAAA,GAAgB,qBAAA,CAC1B,CAAA,CAAE,WAAA,QAAmB,yBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,yBAAA;;;UCzCN,WAAA;EACf,OAAA,EAAS,OAAA;EACT,YAAA,EAAc,YAAA;EACd,WAAA,EAAa,WAAA;EACb,UAAA,EAAY,UAAA;E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IAGH;;;IAAA;;;;;KEkPpB,yBAAA,GAA4B,CAAA,CAAE,WAAW,QAC5C,+BAAA;AAAA,KAEG,WAAA,GAAc,qBAAA,CACxB,CAAA,CAAE,WAAA,QAAmB,uBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,uBAAA;AAAA,cAGV,oBAAA;AAAA,cACA,sBAAA,EAAsB,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,UAAA;AAAA,cACtB,sBAAA,EAAsB,CAAA,CAAA,YAAA;;;AFxPnC;;;;EAA8B;;;;AAAqC;EAArC;EAM5B;;;;;EAAA;;cEwQW,8BAAA,EAA8B,CAAA,CAAA,YAAA;EAAA;;;;;KAO/B,UAAA,GAAa,qBAAA,CACvB,CAAA,CAAE,WAAA,QAAmB,sBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,sBAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel-DIYsVxWE.mjs","names":[],"sources":["../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/advancedBarrel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport type { BtcProvider } from \"./provider.advanced.js\";\nimport type { Requests, Return } from \"./requests.advanced.js\";\n\nexport enum BitcoinNetworkType {\n Mainnet = \"Mainnet\",\n Testnet = \"Testnet\",\n Signet = \"Signet\",\n}\n\nexport interface BitcoinNetwork {\n type: BitcoinNetworkType;\n address?: string;\n}\n\nexport interface RequestPayload {\n network: BitcoinNetwork;\n}\n\nexport interface RequestOptions<Payload extends RequestPayload, Response> {\n onFinish: (response: Response) => void;\n onCancel: () => void;\n payload: Payload;\n getProvider?: () => Promise<BtcProvider | undefined>;\n}\n\n// RPC Request and Response types\n\nexport const RpcIdSchema = v.optional(\n v.union([v.string(), v.number(), v.null()]),\n);\nexport type RpcId = v.InferOutput<typeof RpcIdSchema>;\nexport const rpcRequestMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n method: v.string(),\n params: v.optional(\n v.union([\n v.array(v.unknown()),\n v.looseObject({}),\n // Note: This is to support current incorrect usage of RPC 2.0. Params need\n // to be either an array or an object when provided. Changing this now would\n // be a breaking change, so accepting null values for now. Tracking in\n // https://linear.app/xverseapp/issue/ENG-4538.\n v.null(),\n ]),\n ),\n id: RpcIdSchema,\n});\nexport type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;\n\nexport interface RpcBase {\n jsonrpc: \"2.0\";\n id: RpcId;\n}\nexport interface RpcRequest<T extends string, U> extends RpcBase {\n method: T;\n params: U;\n}\n\nexport interface MethodParamsAndResult<TParams, TResult> {\n params: TParams;\n result: TResult;\n}\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n}\n\nexport const rpcSuccessResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n result: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcSuccessResponseMessage = v.InferOutput<\n typeof rpcSuccessResponseMessageSchema\n>;\n\nexport const rpcErrorResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n error: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcErrorResponseMessage = v.InferOutput<\n typeof rpcErrorResponseMessageSchema\n>;\nexport const rpcResponseMessageSchema = v.union([\n rpcSuccessResponseMessageSchema,\n rpcErrorResponseMessageSchema,\n]);\nexport type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;\n\nexport interface RpcError {\n code: number | RpcErrorCode;\n message: string;\n data?: any;\n}\n\nexport interface RpcErrorResponse<\n TError extends RpcError = RpcError,\n> extends RpcBase {\n error: TError;\n}\n\nexport interface RpcSuccessResponse<\n Method extends keyof Requests,\n> extends RpcBase {\n result: Return<Method>;\n}\n\nexport type RpcResponse<Method extends keyof Requests> =\n | RpcSuccessResponse<Method>\n | RpcErrorResponse;\n\nexport type RpcResult<Method extends keyof Requests> =\n | {\n result: RpcSuccessResponse<Method>[\"result\"];\n status: \"success\";\n }\n | {\n error: RpcErrorResponse[\"error\"];\n status: \"error\";\n };\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\n\nexport const walletTypes = [\"software\", \"ledger\"] as const;\nexport const walletTypeSchema = v.picklist(walletTypes);\nexport type WalletType = v.InferOutput<typeof walletTypeSchema>;\n\nexport const requestPermissionsMethodName = \"wallet_requestPermissions\";\nexport const requestPermissionsParamsSchema = v.undefined();\nexport const requestPermissionsResultSchema = v.literal(true);\nexport const requestPermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(requestPermissionsMethodName),\n params: requestPermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RequestPermissions = MethodParamsAndResult<\n v.InferOutput<typeof requestPermissionsParamsSchema>,\n v.InferOutput<typeof requestPermissionsResultSchema>\n>;\n\nexport const renouncePermissionsMethodName = \"wallet_renouncePermissions\";\nexport const renouncePermissionsParamsSchema = v.undefined();\nexport const renouncePermissionsResultSchema = v.literal(true);\nexport const renouncePermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(renouncePermissionsMethodName),\n params: renouncePermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RenouncePermissions = MethodParamsAndResult<\n v.InferOutput<typeof renouncePermissionsParamsSchema>,\n v.InferOutput<typeof renouncePermissionsResultSchema>\n>;\n\nexport const getWalletTypeMethodName = \"wallet_getWalletType\";\nexport const getWalletTypeParamsSchema = v.nullish(v.null());\nexport const getWalletTypeResultSchema = walletTypeSchema;\nexport const getWalletTypeRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getWalletTypeMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetWalletType = MethodParamsAndResult<\n v.InferOutput<typeof getWalletTypeParamsSchema>,\n v.InferOutput<typeof getWalletTypeResultSchema>\n>;\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\n/**\n * Represents the types and interfaces related to BTC methods.\n */\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\nimport { walletTypeSchema } from \"./walletMethods.advanced.js\";\n\nexport enum AddressPurpose {\n Ordinals = \"ordinals\",\n Payment = \"payment\",\n Stacks = \"stacks\",\n}\n\nexport enum AddressType {\n p2pkh = \"p2pkh\",\n p2sh = \"p2sh\",\n p2wpkh = \"p2wpkh\",\n p2wsh = \"p2wsh\",\n p2tr = \"p2tr\",\n stacks = \"stacks\",\n}\n\nexport const addressSchema = v.object({\n address: v.string(),\n publicKey: v.string(),\n purpose: v.enum(AddressPurpose),\n addressType: v.enum(AddressType),\n});\nexport type Address = v.InferOutput<typeof addressSchema>;\n\nexport const getInfoMethodName = \"getInfo\";\nexport const getInfoParamsSchema = v.nullish(v.null());\nexport type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;\nexport const getInfoResultSchema = v.object({\n /**\n * Version of the wallet.\n */\n version: v.string(),\n\n /**\n * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.\n */\n methods: v.optional(v.array(v.string())),\n\n /**\n * List of WBIP standards supported by the wallet. Not currently used.\n */\n supports: v.array(v.string()),\n});\nexport type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;\nexport const getInfoRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getInfoMethodName),\n params: getInfoParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetInfoRequestMessage = v.InferOutput<\n typeof getInfoRequestMessageSchema\n>;\nexport type GetInfo = MethodParamsAndResult<\n v.InferOutput<typeof getInfoParamsSchema>,\n v.InferOutput<typeof getInfoResultSchema>\n>;\n\nexport const getAddressesMethodName = \"getAddresses\";\nexport const getAddressesParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;\nexport const getAddressesResultSchema = v.object({\n /**\n * The addresses generated for the given purposes.\n */\n addresses: v.array(addressSchema),\n});\nexport type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;\nexport const getAddressesRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAddressesMethodName),\n params: getAddressesParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAddressesRequestMessage = v.InferOutput<\n typeof getAddressesRequestMessageSchema\n>;\nexport type GetAddresses = MethodParamsAndResult<\n v.InferOutput<typeof getAddressesParamsSchema>,\n v.InferOutput<typeof getAddressesResultSchema>\n>;\n\nexport const signMessageMethodName = \"signMessage\";\n\nexport enum MessageSigningProtocols {\n ECDSA = \"ECDSA\",\n BIP322 = \"BIP322\",\n}\n\nexport const signMessageParamsSchema = v.object({\n /**\n * The address used for signing.\n **/\n address: v.string(),\n /**\n * The message to sign.\n **/\n message: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.optional(v.enum(MessageSigningProtocols)),\n});\nexport type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;\nexport const signMessageResultSchema = v.object({\n /**\n * The signature of the message.\n */\n signature: v.string(),\n /**\n * hash of the message.\n */\n messageHash: v.string(),\n /**\n * The address used for signing.\n */\n address: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.enum(MessageSigningProtocols),\n});\nexport type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;\nexport const signMessageRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(signMessageMethodName),\n params: signMessageParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type SignMessageRequestMessage = v.InferOutput<\n typeof signMessageRequestMessageSchema\n>;\nexport type SignMessage = MethodParamsAndResult<\n v.InferOutput<typeof signMessageParamsSchema>,\n v.InferOutput<typeof signMessageResultSchema>\n>;\n\ntype Recipient = {\n /**\n * The recipient's address.\n **/\n address: string;\n /**\n * The amount to send to the recipient in satoshis.\n */\n amount: number;\n};\n\nexport type SendTransferParams = {\n /**\n * Array of recipients to send to.\n * The amount to send to each recipient is in satoshis.\n */\n recipients: Array<Recipient>;\n};\ntype SendTransferResult = {\n /**\n * The transaction id as a hex-encoded string.\n */\n txid: string;\n};\n\nexport type SendTransfer = MethodParamsAndResult<\n SendTransferParams,\n SendTransferResult\n>;\n\nexport type SignPsbtParams = {\n /**\n * The base64 encoded PSBT to sign.\n */\n psbt: string;\n /**\n * The inputs to sign.\n * The key is the address and the value is an array of indexes of the inputs to sign.\n */\n signInputs: Record<string, number[]>;\n /**\n * the sigHash type to use for signing.\n * will default to the sighash type of the input if not provided.\n **/\n allowedSignHash?: number;\n /**\n * Whether to broadcast the transaction after signing.\n **/\n broadcast?: boolean;\n};\n\nexport type SignPsbtResult = {\n /**\n * The base64 encoded PSBT after signing.\n */\n psbt: string;\n /**\n * The transaction id as a hex-encoded string.\n * This is only returned if the transaction was broadcast.\n **/\n txid?: string;\n};\n\nexport type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;\n\nexport const getAccountsMethodName = \"getAccounts\";\nexport const getAccountsParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;\n\nexport const getAccountsResultSchema = v.array(\n v.object({\n ...addressSchema.entries,\n ...v.object({\n walletType: walletTypeSchema,\n }).entries,\n }),\n);\nexport type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;\nexport const getAccountsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAccountsMethodName),\n params: getAccountsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAccountsRequestMessage = v.InferOutput<\n typeof getAccountsRequestMessageSchema\n>;\nexport type GetAccounts = MethodParamsAndResult<\n v.InferOutput<typeof getAccountsParamsSchema>,\n v.InferOutput<typeof getAccountsResultSchema>\n>;\n\nexport const getBalanceMethodName = \"getBalance\";\nexport const getBalanceParamsSchema = v.nullish(v.null());\nexport const getBalanceResultSchema = v.object({\n /**\n * The confirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n confirmed: v.string(),\n\n /**\n * The unconfirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n unconfirmed: v.string(),\n\n /**\n * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in\n * sats. Using a string due to chrome messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n total: v.string(),\n});\nexport const getBalanceRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getBalanceMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetBalance = MethodParamsAndResult<\n v.InferOutput<typeof getBalanceParamsSchema>,\n v.InferOutput<typeof getBalanceResultSchema>\n>;\n","import * as v from \"valibot\";\nimport { Params, Requests } from \"./requests.advanced.js\";\nimport { RpcResponse } from \"./types.advanced.js\";\n\n// accountChange\nexport const accountChangeEventName = \"accountChange\";\nexport const accountChangeSchema = v.object({\n type: v.literal(accountChangeEventName),\n});\nexport type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;\n\n// networkChange\nexport const networkChangeEventName = \"networkChange\";\nexport const networkChangeSchema = v.object({\n type: v.literal(networkChangeEventName),\n});\nexport type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;\n\n// disconnect\nexport const disconnectEventName = \"disconnect\";\nexport const disconnectSchema = v.object({\n type: v.literal(disconnectEventName),\n});\nexport type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;\n\nexport const walletEventSchema = v.variant(\"type\", [\n accountChangeSchema,\n networkChangeSchema,\n disconnectSchema,\n]);\n\nexport type WalletEvent = v.InferOutput<typeof walletEventSchema>;\nexport type AddListener = <const WalletEventName extends WalletEvent[\"type\"]>(\n eventName: WalletEventName,\n cb: (event: Extract<WalletEvent, { type: WalletEventName }>) => void,\n) => () => void;\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n */\nexport interface BtcProvider {\n request: <Method extends keyof Requests>(\n method: Method,\n options: Params<Method>,\n providerId?: string,\n ) => Promise<RpcResponse<Method>>;\n\n addListener: AddListener;\n}\n\nexport interface Provider {\n id: string;\n name: string;\n icon: string;\n webUrl?: string;\n chromeWebStoreUrl?: string;\n mozillaAddOnsUrl?: string;\n googlePlayStoreUrl?: string;\n iOSAppStoreUrl?: string;\n methods?: string[];\n}\n","export * from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E,MACvC,EAAE,OAAO,CACP,GAAG,EAAc,QACjB,GAAG,EAAE,OAAO,CACV,WAAY,CACd,CAAC,CAAC,CAAC,OACL,CAAC,CACH,EAEa,EAAkC,EAAE,OAAO,CACtD,GAAG,EAAwB,QAC3B,GAAG,EAAE,OAAO,CACV,OAAQ,EAAE,QAAQ,CAAqB,EACvC,OAAQ,EACR,GAAI,EAAE,OAAO,CACf,CAAC,CAAC,CAAC,OACL,CAAC,EASY,EAAuB,aACvB,EAAyB,EAAE,QAAQ,EAAE,KAAK,CAAC,EAC3C,EAAyB,EAAE,OAAO,CAM7C,UAAW,EAAE,OAAO,EAOpB,YAAa,EAAE,OAAO,EAOtB,MAAO,EAAE,OAAO,CAClB,CAAC,EACY,EAAiC,EAAE,OAAO,CACrD,GAAG,EAAwB,QAC3B,GAAG,EAAE,OAAO,CACV,OAAQ,EAAE,QAAQ,CAAoB,EACtC,GAAI,EAAE,OAAO,CACf,CAAC,CAAC,CAAC,OACL,CAAC,ECtSY,EAAyB,gBACzB,EAAsB,EAAE,OAAO,CAC1C,KAAM,EAAE,QAAQ,CAAsB,CACxC,CAAC,EAIY,EAAyB,gBACzB,EAAsB,EAAE,OAAO,CAC1C,KAAM,EAAE,QAAQ,CAAsB,CACxC,CAAC,EAIY,EAAsB,aACtB,EAAmB,EAAE,OAAO,CACvC,KAAM,EAAE,QAAQ,CAAmB,CACrC,CAAC,EAGY,EAAoB,EAAE,QAAQ,OAAQ,CACjD,EACA,EACA,CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"advancedBarrel-DIYsVxWE.mjs","names":[],"sources":["../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/advancedBarrel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport type { BtcProvider } from \"./provider.advanced.js\";\nimport type { Requests, Return } from \"./requests.advanced.js\";\n\nexport enum BitcoinNetworkType {\n Mainnet = \"Mainnet\",\n Testnet = \"Testnet\",\n Signet = \"Signet\",\n}\n\nexport interface BitcoinNetwork {\n type: BitcoinNetworkType;\n address?: string;\n}\n\nexport interface RequestPayload {\n network: BitcoinNetwork;\n}\n\nexport interface RequestOptions<Payload extends RequestPayload, Response> {\n onFinish: (response: Response) => void;\n onCancel: () => void;\n payload: Payload;\n getProvider?: () => Promise<BtcProvider | undefined>;\n}\n\n// RPC Request and Response types\n\nexport const RpcIdSchema = v.optional(\n v.union([v.string(), v.number(), v.null()]),\n);\nexport type RpcId = v.InferOutput<typeof RpcIdSchema>;\nexport const rpcRequestMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n method: v.string(),\n params: v.optional(\n v.union([\n v.array(v.unknown()),\n v.looseObject({}),\n // Note: This is to support current incorrect usage of RPC 2.0. Params need\n // to be either an array or an object when provided. Changing this now would\n // be a breaking change, so accepting null values for now. Tracking in\n // https://linear.app/xverseapp/issue/ENG-4538.\n v.null(),\n ]),\n ),\n id: RpcIdSchema,\n});\nexport type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;\n\nexport interface RpcBase {\n jsonrpc: \"2.0\";\n id: RpcId;\n}\nexport interface RpcRequest<T extends string, U> extends RpcBase {\n method: T;\n params: U;\n}\n\nexport interface MethodParamsAndResult<TParams, TResult> {\n params: TParams;\n result: TResult;\n}\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n}\n\nexport const rpcSuccessResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n result: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcSuccessResponseMessage = v.InferOutput<\n typeof rpcSuccessResponseMessageSchema\n>;\n\nexport const rpcErrorResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n error: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcErrorResponseMessage = v.InferOutput<\n typeof rpcErrorResponseMessageSchema\n>;\nexport const rpcResponseMessageSchema = v.union([\n rpcSuccessResponseMessageSchema,\n rpcErrorResponseMessageSchema,\n]);\nexport type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;\n\nexport interface RpcError {\n code: number | RpcErrorCode;\n message: string;\n data?: any;\n}\n\nexport interface RpcErrorResponse<\n TError extends RpcError = RpcError,\n> extends RpcBase {\n error: TError;\n}\n\nexport interface RpcSuccessResponse<\n Method extends keyof Requests,\n> extends RpcBase {\n result: Return<Method>;\n}\n\nexport type RpcResponse<Method extends keyof Requests> =\n RpcSuccessResponse<Method> | RpcErrorResponse;\n\nexport type RpcResult<Method extends keyof Requests> =\n | {\n result: RpcSuccessResponse<Method>[\"result\"];\n status: \"success\";\n }\n | {\n error: RpcErrorResponse[\"error\"];\n status: \"error\";\n };\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\n\nexport const walletTypes = [\"software\", \"ledger\"] as const;\nexport const walletTypeSchema = v.picklist(walletTypes);\nexport type WalletType = v.InferOutput<typeof walletTypeSchema>;\n\nexport const requestPermissionsMethodName = \"wallet_requestPermissions\";\nexport const requestPermissionsParamsSchema = v.undefined();\nexport const requestPermissionsResultSchema = v.literal(true);\nexport const requestPermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(requestPermissionsMethodName),\n params: requestPermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RequestPermissions = MethodParamsAndResult<\n v.InferOutput<typeof requestPermissionsParamsSchema>,\n v.InferOutput<typeof requestPermissionsResultSchema>\n>;\n\nexport const renouncePermissionsMethodName = \"wallet_renouncePermissions\";\nexport const renouncePermissionsParamsSchema = v.undefined();\nexport const renouncePermissionsResultSchema = v.literal(true);\nexport const renouncePermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(renouncePermissionsMethodName),\n params: renouncePermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RenouncePermissions = MethodParamsAndResult<\n v.InferOutput<typeof renouncePermissionsParamsSchema>,\n v.InferOutput<typeof renouncePermissionsResultSchema>\n>;\n\nexport const getWalletTypeMethodName = \"wallet_getWalletType\";\nexport const getWalletTypeParamsSchema = v.nullish(v.null());\nexport const getWalletTypeResultSchema = walletTypeSchema;\nexport const getWalletTypeRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getWalletTypeMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetWalletType = MethodParamsAndResult<\n v.InferOutput<typeof getWalletTypeParamsSchema>,\n v.InferOutput<typeof getWalletTypeResultSchema>\n>;\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\n/**\n * Represents the types and interfaces related to BTC methods.\n */\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\nimport { walletTypeSchema } from \"./walletMethods.advanced.js\";\n\nexport enum AddressPurpose {\n Ordinals = \"ordinals\",\n Payment = \"payment\",\n Stacks = \"stacks\",\n}\n\nexport enum AddressType {\n p2pkh = \"p2pkh\",\n p2sh = \"p2sh\",\n p2wpkh = \"p2wpkh\",\n p2wsh = \"p2wsh\",\n p2tr = \"p2tr\",\n stacks = \"stacks\",\n}\n\nexport const addressSchema = v.object({\n address: v.string(),\n publicKey: v.string(),\n purpose: v.enum(AddressPurpose),\n addressType: v.enum(AddressType),\n});\nexport type Address = v.InferOutput<typeof addressSchema>;\n\nexport const getInfoMethodName = \"getInfo\";\nexport const getInfoParamsSchema = v.nullish(v.null());\nexport type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;\nexport const getInfoResultSchema = v.object({\n /**\n * Version of the wallet.\n */\n version: v.string(),\n\n /**\n * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.\n */\n methods: v.optional(v.array(v.string())),\n\n /**\n * List of WBIP standards supported by the wallet. Not currently used.\n */\n supports: v.array(v.string()),\n});\nexport type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;\nexport const getInfoRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getInfoMethodName),\n params: getInfoParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetInfoRequestMessage = v.InferOutput<\n typeof getInfoRequestMessageSchema\n>;\nexport type GetInfo = MethodParamsAndResult<\n v.InferOutput<typeof getInfoParamsSchema>,\n v.InferOutput<typeof getInfoResultSchema>\n>;\n\nexport const getAddressesMethodName = \"getAddresses\";\nexport const getAddressesParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;\nexport const getAddressesResultSchema = v.object({\n /**\n * The addresses generated for the given purposes.\n */\n addresses: v.array(addressSchema),\n});\nexport type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;\nexport const getAddressesRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAddressesMethodName),\n params: getAddressesParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAddressesRequestMessage = v.InferOutput<\n typeof getAddressesRequestMessageSchema\n>;\nexport type GetAddresses = MethodParamsAndResult<\n v.InferOutput<typeof getAddressesParamsSchema>,\n v.InferOutput<typeof getAddressesResultSchema>\n>;\n\nexport const signMessageMethodName = \"signMessage\";\n\nexport enum MessageSigningProtocols {\n ECDSA = \"ECDSA\",\n BIP322 = \"BIP322\",\n}\n\nexport const signMessageParamsSchema = v.object({\n /**\n * The address used for signing.\n **/\n address: v.string(),\n /**\n * The message to sign.\n **/\n message: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.optional(v.enum(MessageSigningProtocols)),\n});\nexport type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;\nexport const signMessageResultSchema = v.object({\n /**\n * The signature of the message.\n */\n signature: v.string(),\n /**\n * hash of the message.\n */\n messageHash: v.string(),\n /**\n * The address used for signing.\n */\n address: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.enum(MessageSigningProtocols),\n});\nexport type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;\nexport const signMessageRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(signMessageMethodName),\n params: signMessageParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type SignMessageRequestMessage = v.InferOutput<\n typeof signMessageRequestMessageSchema\n>;\nexport type SignMessage = MethodParamsAndResult<\n v.InferOutput<typeof signMessageParamsSchema>,\n v.InferOutput<typeof signMessageResultSchema>\n>;\n\ntype Recipient = {\n /**\n * The recipient's address.\n **/\n address: string;\n /**\n * The amount to send to the recipient in satoshis.\n */\n amount: number;\n};\n\nexport type SendTransferParams = {\n /**\n * Array of recipients to send to.\n * The amount to send to each recipient is in satoshis.\n */\n recipients: Array<Recipient>;\n};\ntype SendTransferResult = {\n /**\n * The transaction id as a hex-encoded string.\n */\n txid: string;\n};\n\nexport type SendTransfer = MethodParamsAndResult<\n SendTransferParams,\n SendTransferResult\n>;\n\nexport type SignPsbtParams = {\n /**\n * The base64 encoded PSBT to sign.\n */\n psbt: string;\n /**\n * The inputs to sign.\n * The key is the address and the value is an array of indexes of the inputs to sign.\n */\n signInputs: Record<string, number[]>;\n /**\n * the sigHash type to use for signing.\n * will default to the sighash type of the input if not provided.\n **/\n allowedSignHash?: number;\n /**\n * Whether to broadcast the transaction after signing.\n **/\n broadcast?: boolean;\n};\n\nexport type SignPsbtResult = {\n /**\n * The base64 encoded PSBT after signing.\n */\n psbt: string;\n /**\n * The transaction id as a hex-encoded string.\n * This is only returned if the transaction was broadcast.\n **/\n txid?: string;\n};\n\nexport type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;\n\nexport const getAccountsMethodName = \"getAccounts\";\nexport const getAccountsParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;\n\nexport const getAccountsResultSchema = v.array(\n v.object({\n ...addressSchema.entries,\n ...v.object({\n walletType: walletTypeSchema,\n }).entries,\n }),\n);\nexport type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;\nexport const getAccountsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAccountsMethodName),\n params: getAccountsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAccountsRequestMessage = v.InferOutput<\n typeof getAccountsRequestMessageSchema\n>;\nexport type GetAccounts = MethodParamsAndResult<\n v.InferOutput<typeof getAccountsParamsSchema>,\n v.InferOutput<typeof getAccountsResultSchema>\n>;\n\nexport const getBalanceMethodName = \"getBalance\";\nexport const getBalanceParamsSchema = v.nullish(v.null());\nexport const getBalanceResultSchema = v.object({\n /**\n * The confirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n confirmed: v.string(),\n\n /**\n * The unconfirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n unconfirmed: v.string(),\n\n /**\n * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in\n * sats. Using a string due to chrome messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n total: v.string(),\n});\nexport const getBalanceRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getBalanceMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetBalance = MethodParamsAndResult<\n v.InferOutput<typeof getBalanceParamsSchema>,\n v.InferOutput<typeof getBalanceResultSchema>\n>;\n","import * as v from \"valibot\";\nimport { Params, Requests } from \"./requests.advanced.js\";\nimport { RpcResponse } from \"./types.advanced.js\";\n\n// accountChange\nexport const accountChangeEventName = \"accountChange\";\nexport const accountChangeSchema = v.object({\n type: v.literal(accountChangeEventName),\n});\nexport type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;\n\n// networkChange\nexport const networkChangeEventName = \"networkChange\";\nexport const networkChangeSchema = v.object({\n type: v.literal(networkChangeEventName),\n});\nexport type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;\n\n// disconnect\nexport const disconnectEventName = \"disconnect\";\nexport const disconnectSchema = v.object({\n type: v.literal(disconnectEventName),\n});\nexport type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;\n\nexport const walletEventSchema = v.variant(\"type\", [\n accountChangeSchema,\n networkChangeSchema,\n disconnectSchema,\n]);\n\nexport type WalletEvent = v.InferOutput<typeof walletEventSchema>;\nexport type AddListener = <const WalletEventName extends WalletEvent[\"type\"]>(\n eventName: WalletEventName,\n cb: (event: Extract<WalletEvent, { type: WalletEventName }>) => void,\n) => () => void;\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n */\nexport interface BtcProvider {\n request: <Method extends keyof Requests>(\n method: Method,\n options: Params<Method>,\n providerId?: string,\n ) => Promise<RpcResponse<Method>>;\n\n addListener: AddListener;\n}\n\nexport interface Provider {\n id: string;\n name: string;\n icon: string;\n webUrl?: string;\n chromeWebStoreUrl?: string;\n mozillaAddOnsUrl?: string;\n googlePlayStoreUrl?: string;\n iOSAppStoreUrl?: string;\n methods?: string[];\n}\n","export * from \"./sat-connect-core/advanced.js\";\n"],"mappings":"8EAOA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,QAAA,UACA,EAAA,OAAA,UACF,EAAA,CAAA,CAAA,EAoBA,MAAa,EAAc,EAAE,SAC3B,EAAE,MAAM,CAAC,EAAE,OAAO,EAAG,EAAE,OAAO,EAAG,EAAE,KAAK,CAAC,CAAC,CAC5C,EAEa,EAA0B,EAAE,OAAO,CAC9C,QAAS,EAAE,QAAQ,KAAK,EACxB,OAAQ,EAAE,OAAO,EACjB,OAAQ,EAAE,SACR,EAAE,MAAM,CACN,EAAE,MAAM,EAAE,QAAQ,CAAC,EACnB,EAAE,YAAY,CAAC,CAAC,EAKhB,EAAE,KAAK,CACT,CAAC,CACH,EACA,GAAI,CACN,CAAC,EAsBD,IAAY,EAAL,SAAA,EAAA,OAIL,GAAA,EAAA,YAAA,QAAA,cAIA,EAAA,EAAA,gBAAA,QAAA,kBAIA,EAAA,EAAA,iBAAA,QAAA,mBAIA,EAAA,EAAA,eAAA,QAAA,iBAKA,EAAA,EAAA,eAAA,QAAA,iBAIA,EAAA,EAAA,eAAA,OAAA,iBAIA,EAAA,EAAA,qBAAA,QAAA,uBAIA,EAAA,EAAA,cAAA,QAAA,iBACF,EAAA,CAAA,CAAA,EAEA,MAAa,EAAkC,EAAE,OAAO,CACtD,QAAS,EAAE,QAAQ,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CAAC,EAGY,EAAoB,EAAE,QAAQ,OAAQ,CACjD,EACA,EACA,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel-BCHIO_V8.d.ts","names":[],"sources":["../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/requests.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/advancedBarrel.ts"],"mappings":";;;;;cAaa,8BAAA,EAA8B,CAAA,CAAA,eAAA;AAAA,cAC9B,8BAAA,EAA8B,CAAA,CAAA,aAAA;AAAA,KAS/B,kBAAA,GAAqB,qBAAA,CAC/B,CAAA,CAAE,WAAA,QAAmB,8BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,8BAAA;AAAA,cAIV,+BAAA,EAA+B,CAAA,CAAA,eAAA;AAAA,cAC/B,+BAAA,EAA+B,CAAA,CAAA,aAAA;AAAA,KAShC,mBAAA,GAAsB,qBAAA,CAChC,CAAA,CAAE,WAAA,QAAmB,+BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,+BAAA;AAAA,cAIV,yBAAA,EAAyB,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,UAAA;AAAA,cACzB,yBAAA,EAAyB,CAAA,CAAA,cAAA;AAAA,KAQ1B,aAAA,GAAgB,qBAAA,CAC1B,CAAA,CAAE,WAAA,QAAmB,yBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,yBAAA;;;UCzCN,WAAA;EACf,OAAA,EAAS,OAAA;EACT,YAAA,EAAc,YAAA;EACd,WAAA,EAAa,WAAA;EACb,UAAA,EAAY,UAAA;EACZ,WAAA,EAAa,WAAA;EACb,YAAA,EAAc,YAAA;EACd,QAAA,EAAU,QAAA;AAAA;AAAA,KAGA,gBAAA,SAAyB,WAAW;AAAA,UAE/B,cAAA;EACf,yBAAA,EAA2B,kBAAA;EAC3B,0BAAA,EAA4B,mBAAA;EAC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5C,+BAAA;AAAA,cAGI,6BAAA,EAA6B,CAAA,CAAA,YAAA;EAAA;;;;KAK9B,uBAAA,GAA0B,CAAA,CAAE,WAAW,QAC1C,6BAAA;AAAA,cAEI,wBAAA,EAAwB,CAAA,CAAA,WAAA,EAAA,CAAA,CAAA,YAAA;EAAA;;;;;;;;KAIzB,kBAAA,GAAqB,CAAA,CAAE,WAAW,QAAQ,wBAAA;AAAA,UAErC,QAAA;EACf,IAAA,WAAe,YAAY;EAC3B,OAAA;EACA,IAAA;AAAA;AAAA,UAGe,gBAAA,gBACA,QAAA,GAAW,QAAA,UAClB,OAAA;EACR,KAAA,EAAO,MAAA;AAAA;AAAA,UAGQ,kBAAA,sBACM,QAAA,UACb,OAAA;EACR,MAAA,EAAQ,MAAA,CAAO,MAAA;AAAA;AAAA,KAGL,WAAA,sBAAiC,QAAA,
|
|
1
|
+
{"version":3,"file":"advancedBarrel-BCHIO_V8.d.ts","names":[],"sources":["../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/requests.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/advancedBarrel.ts"],"mappings":";;;;;cAaa,8BAAA,EAA8B,CAAA,CAAA,eAAA;AAAA,cAC9B,8BAAA,EAA8B,CAAA,CAAA,aAAA;AAAA,KAS/B,kBAAA,GAAqB,qBAAA,CAC/B,CAAA,CAAE,WAAA,QAAmB,8BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,8BAAA;AAAA,cAIV,+BAAA,EAA+B,CAAA,CAAA,eAAA;AAAA,cAC/B,+BAAA,EAA+B,CAAA,CAAA,aAAA;AAAA,KAShC,mBAAA,GAAsB,qBAAA,CAChC,CAAA,CAAE,WAAA,QAAmB,+BAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,+BAAA;AAAA,cAIV,yBAAA,EAAyB,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,UAAA;AAAA,cACzB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A,YAAA;EFjOJ;;;;EAAA;;;;;;KE4OpB,iBAAA,GAAoB,CAAA,CAAE,WAAW,QAAQ,uBAAA;AAAA,cAExC,uBAAA,EAAuB,CAAA,CAAA,WAAA,CAAA,CAAA,CAAA,YAAA;EAAA;;;;;;KAQxB,iBAAA,GAAoB,CAAA,CAAE,WAAW,QAAQ,uBAAA;AAAA,cACxC,+BAAA,EAA+B,CAAA,CAAA,YAAA;EAAA;;IFhP/B;;;;IAAA;IAAmB;;;IAAA;;;;;KEwPpB,yBAAA,GAA4B,CAAA,CAAE,WAAW,QAC5C,+BAAA;AAAA,KAEG,WAAA,GAAc,qBAAA,CACxB,CAAA,CAAE,WAAA,QAAmB,uBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,uBAAA;AAAA,cAGV,oBAAA;AAAA,cACA,sBAAA,EAAsB,CAAA,CAAA,aAAA,CAAA,CAAA,CAAA,UAAA;AAAA,cACtB,sBAAA,EAAsB,CAAA,CAAA,YAAA;EF/PsC;AAAA;AAGzE;;;EAHyE;EAGzC;AAChC;;;;EADgC;EACH;;;;;EAAA;;cEiRhB,8BAAA,EAA8B,CAAA,CAAA,YAAA;EAAA;;;;;KAO/B,UAAA,GAAa,qBAAA,CACvB,CAAA,CAAE,WAAA,QAAmB,sBAAA,GACrB,CAAA,CAAE,WAAA,QAAmB,sBAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"advancedBarrel-DA4O2d7u.js","names":["v","v","v","v"],"sources":["../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/advancedBarrel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport type { BtcProvider } from \"./provider.advanced.js\";\nimport type { Requests, Return } from \"./requests.advanced.js\";\n\nexport enum BitcoinNetworkType {\n Mainnet = \"Mainnet\",\n Testnet = \"Testnet\",\n Signet = \"Signet\",\n}\n\nexport interface BitcoinNetwork {\n type: BitcoinNetworkType;\n address?: string;\n}\n\nexport interface RequestPayload {\n network: BitcoinNetwork;\n}\n\nexport interface RequestOptions<Payload extends RequestPayload, Response> {\n onFinish: (response: Response) => void;\n onCancel: () => void;\n payload: Payload;\n getProvider?: () => Promise<BtcProvider | undefined>;\n}\n\n// RPC Request and Response types\n\nexport const RpcIdSchema = v.optional(\n v.union([v.string(), v.number(), v.null()]),\n);\nexport type RpcId = v.InferOutput<typeof RpcIdSchema>;\nexport const rpcRequestMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n method: v.string(),\n params: v.optional(\n v.union([\n v.array(v.unknown()),\n v.looseObject({}),\n // Note: This is to support current incorrect usage of RPC 2.0. Params need\n // to be either an array or an object when provided. Changing this now would\n // be a breaking change, so accepting null values for now. Tracking in\n // https://linear.app/xverseapp/issue/ENG-4538.\n v.null(),\n ]),\n ),\n id: RpcIdSchema,\n});\nexport type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;\n\nexport interface RpcBase {\n jsonrpc: \"2.0\";\n id: RpcId;\n}\nexport interface RpcRequest<T extends string, U> extends RpcBase {\n method: T;\n params: U;\n}\n\nexport interface MethodParamsAndResult<TParams, TResult> {\n params: TParams;\n result: TResult;\n}\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n}\n\nexport const rpcSuccessResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n result: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcSuccessResponseMessage = v.InferOutput<\n typeof rpcSuccessResponseMessageSchema\n>;\n\nexport const rpcErrorResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n error: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcErrorResponseMessage = v.InferOutput<\n typeof rpcErrorResponseMessageSchema\n>;\nexport const rpcResponseMessageSchema = v.union([\n rpcSuccessResponseMessageSchema,\n rpcErrorResponseMessageSchema,\n]);\nexport type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;\n\nexport interface RpcError {\n code: number | RpcErrorCode;\n message: string;\n data?: any;\n}\n\nexport interface RpcErrorResponse<\n TError extends RpcError = RpcError,\n> extends RpcBase {\n error: TError;\n}\n\nexport interface RpcSuccessResponse<\n Method extends keyof Requests,\n> extends RpcBase {\n result: Return<Method>;\n}\n\nexport type RpcResponse<Method extends keyof Requests> =\n | RpcSuccessResponse<Method>\n | RpcErrorResponse;\n\nexport type RpcResult<Method extends keyof Requests> =\n | {\n result: RpcSuccessResponse<Method>[\"result\"];\n status: \"success\";\n }\n | {\n error: RpcErrorResponse[\"error\"];\n status: \"error\";\n };\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\n\nexport const walletTypes = [\"software\", \"ledger\"] as const;\nexport const walletTypeSchema = v.picklist(walletTypes);\nexport type WalletType = v.InferOutput<typeof walletTypeSchema>;\n\nexport const requestPermissionsMethodName = \"wallet_requestPermissions\";\nexport const requestPermissionsParamsSchema = v.undefined();\nexport const requestPermissionsResultSchema = v.literal(true);\nexport const requestPermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(requestPermissionsMethodName),\n params: requestPermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RequestPermissions = MethodParamsAndResult<\n v.InferOutput<typeof requestPermissionsParamsSchema>,\n v.InferOutput<typeof requestPermissionsResultSchema>\n>;\n\nexport const renouncePermissionsMethodName = \"wallet_renouncePermissions\";\nexport const renouncePermissionsParamsSchema = v.undefined();\nexport const renouncePermissionsResultSchema = v.literal(true);\nexport const renouncePermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(renouncePermissionsMethodName),\n params: renouncePermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RenouncePermissions = MethodParamsAndResult<\n v.InferOutput<typeof renouncePermissionsParamsSchema>,\n v.InferOutput<typeof renouncePermissionsResultSchema>\n>;\n\nexport const getWalletTypeMethodName = \"wallet_getWalletType\";\nexport const getWalletTypeParamsSchema = v.nullish(v.null());\nexport const getWalletTypeResultSchema = walletTypeSchema;\nexport const getWalletTypeRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getWalletTypeMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetWalletType = MethodParamsAndResult<\n v.InferOutput<typeof getWalletTypeParamsSchema>,\n v.InferOutput<typeof getWalletTypeResultSchema>\n>;\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\n/**\n * Represents the types and interfaces related to BTC methods.\n */\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\nimport { walletTypeSchema } from \"./walletMethods.advanced.js\";\n\nexport enum AddressPurpose {\n Ordinals = \"ordinals\",\n Payment = \"payment\",\n Stacks = \"stacks\",\n}\n\nexport enum AddressType {\n p2pkh = \"p2pkh\",\n p2sh = \"p2sh\",\n p2wpkh = \"p2wpkh\",\n p2wsh = \"p2wsh\",\n p2tr = \"p2tr\",\n stacks = \"stacks\",\n}\n\nexport const addressSchema = v.object({\n address: v.string(),\n publicKey: v.string(),\n purpose: v.enum(AddressPurpose),\n addressType: v.enum(AddressType),\n});\nexport type Address = v.InferOutput<typeof addressSchema>;\n\nexport const getInfoMethodName = \"getInfo\";\nexport const getInfoParamsSchema = v.nullish(v.null());\nexport type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;\nexport const getInfoResultSchema = v.object({\n /**\n * Version of the wallet.\n */\n version: v.string(),\n\n /**\n * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.\n */\n methods: v.optional(v.array(v.string())),\n\n /**\n * List of WBIP standards supported by the wallet. Not currently used.\n */\n supports: v.array(v.string()),\n});\nexport type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;\nexport const getInfoRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getInfoMethodName),\n params: getInfoParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetInfoRequestMessage = v.InferOutput<\n typeof getInfoRequestMessageSchema\n>;\nexport type GetInfo = MethodParamsAndResult<\n v.InferOutput<typeof getInfoParamsSchema>,\n v.InferOutput<typeof getInfoResultSchema>\n>;\n\nexport const getAddressesMethodName = \"getAddresses\";\nexport const getAddressesParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;\nexport const getAddressesResultSchema = v.object({\n /**\n * The addresses generated for the given purposes.\n */\n addresses: v.array(addressSchema),\n});\nexport type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;\nexport const getAddressesRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAddressesMethodName),\n params: getAddressesParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAddressesRequestMessage = v.InferOutput<\n typeof getAddressesRequestMessageSchema\n>;\nexport type GetAddresses = MethodParamsAndResult<\n v.InferOutput<typeof getAddressesParamsSchema>,\n v.InferOutput<typeof getAddressesResultSchema>\n>;\n\nexport const signMessageMethodName = \"signMessage\";\n\nexport enum MessageSigningProtocols {\n ECDSA = \"ECDSA\",\n BIP322 = \"BIP322\",\n}\n\nexport const signMessageParamsSchema = v.object({\n /**\n * The address used for signing.\n **/\n address: v.string(),\n /**\n * The message to sign.\n **/\n message: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.optional(v.enum(MessageSigningProtocols)),\n});\nexport type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;\nexport const signMessageResultSchema = v.object({\n /**\n * The signature of the message.\n */\n signature: v.string(),\n /**\n * hash of the message.\n */\n messageHash: v.string(),\n /**\n * The address used for signing.\n */\n address: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.enum(MessageSigningProtocols),\n});\nexport type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;\nexport const signMessageRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(signMessageMethodName),\n params: signMessageParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type SignMessageRequestMessage = v.InferOutput<\n typeof signMessageRequestMessageSchema\n>;\nexport type SignMessage = MethodParamsAndResult<\n v.InferOutput<typeof signMessageParamsSchema>,\n v.InferOutput<typeof signMessageResultSchema>\n>;\n\ntype Recipient = {\n /**\n * The recipient's address.\n **/\n address: string;\n /**\n * The amount to send to the recipient in satoshis.\n */\n amount: number;\n};\n\nexport type SendTransferParams = {\n /**\n * Array of recipients to send to.\n * The amount to send to each recipient is in satoshis.\n */\n recipients: Array<Recipient>;\n};\ntype SendTransferResult = {\n /**\n * The transaction id as a hex-encoded string.\n */\n txid: string;\n};\n\nexport type SendTransfer = MethodParamsAndResult<\n SendTransferParams,\n SendTransferResult\n>;\n\nexport type SignPsbtParams = {\n /**\n * The base64 encoded PSBT to sign.\n */\n psbt: string;\n /**\n * The inputs to sign.\n * The key is the address and the value is an array of indexes of the inputs to sign.\n */\n signInputs: Record<string, number[]>;\n /**\n * the sigHash type to use for signing.\n * will default to the sighash type of the input if not provided.\n **/\n allowedSignHash?: number;\n /**\n * Whether to broadcast the transaction after signing.\n **/\n broadcast?: boolean;\n};\n\nexport type SignPsbtResult = {\n /**\n * The base64 encoded PSBT after signing.\n */\n psbt: string;\n /**\n * The transaction id as a hex-encoded string.\n * This is only returned if the transaction was broadcast.\n **/\n txid?: string;\n};\n\nexport type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;\n\nexport const getAccountsMethodName = \"getAccounts\";\nexport const getAccountsParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;\n\nexport const getAccountsResultSchema = v.array(\n v.object({\n ...addressSchema.entries,\n ...v.object({\n walletType: walletTypeSchema,\n }).entries,\n }),\n);\nexport type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;\nexport const getAccountsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAccountsMethodName),\n params: getAccountsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAccountsRequestMessage = v.InferOutput<\n typeof getAccountsRequestMessageSchema\n>;\nexport type GetAccounts = MethodParamsAndResult<\n v.InferOutput<typeof getAccountsParamsSchema>,\n v.InferOutput<typeof getAccountsResultSchema>\n>;\n\nexport const getBalanceMethodName = \"getBalance\";\nexport const getBalanceParamsSchema = v.nullish(v.null());\nexport const getBalanceResultSchema = v.object({\n /**\n * The confirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n confirmed: v.string(),\n\n /**\n * The unconfirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n unconfirmed: v.string(),\n\n /**\n * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in\n * sats. Using a string due to chrome messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n total: v.string(),\n});\nexport const getBalanceRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getBalanceMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetBalance = MethodParamsAndResult<\n v.InferOutput<typeof getBalanceParamsSchema>,\n v.InferOutput<typeof getBalanceResultSchema>\n>;\n","import * as v from \"valibot\";\nimport { Params, Requests } from \"./requests.advanced.js\";\nimport { RpcResponse } from \"./types.advanced.js\";\n\n// accountChange\nexport const accountChangeEventName = \"accountChange\";\nexport const accountChangeSchema = v.object({\n type: v.literal(accountChangeEventName),\n});\nexport type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;\n\n// networkChange\nexport const networkChangeEventName = \"networkChange\";\nexport const networkChangeSchema = v.object({\n type: v.literal(networkChangeEventName),\n});\nexport type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;\n\n// disconnect\nexport const disconnectEventName = \"disconnect\";\nexport const disconnectSchema = v.object({\n type: v.literal(disconnectEventName),\n});\nexport type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;\n\nexport const walletEventSchema = v.variant(\"type\", [\n accountChangeSchema,\n networkChangeSchema,\n disconnectSchema,\n]);\n\nexport type WalletEvent = v.InferOutput<typeof walletEventSchema>;\nexport type AddListener = <const WalletEventName extends WalletEvent[\"type\"]>(\n eventName: WalletEventName,\n cb: (event: Extract<WalletEvent, { type: WalletEventName }>) => void,\n) => () => void;\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n */\nexport interface BtcProvider {\n request: <Method extends keyof Requests>(\n method: Method,\n options: Params<Method>,\n providerId?: string,\n ) => Promise<RpcResponse<Method>>;\n\n addListener: AddListener;\n}\n\nexport interface Provider {\n id: string;\n name: string;\n icon: string;\n webUrl?: string;\n chromeWebStoreUrl?: string;\n mozillaAddOnsUrl?: string;\n googlePlayStoreUrl?: string;\n iOSAppStoreUrl?: string;\n methods?: string[];\n}\n","export * from \"./sat-connect-core/advanced.js\";\n"],"mappings":"snBAOA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,QAAA,UACA,EAAA,OAAA,UACF,EAAA,CAAA,CAAA,EAoBA,MAAa,EAAcA,EAAE,SAC3BA,EAAE,MAAM,CAACA,EAAE,OAAO,EAAGA,EAAE,OAAO,EAAGA,EAAE,KAAK,CAAC,CAAC,CAC5C,EAEa,EAA0BA,EAAE,OAAO,CAC9C,QAASA,EAAE,QAAQ,KAAK,EACxB,OAAQA,EAAE,OAAO,EACjB,OAAQA,EAAE,SACRA,EAAE,MAAM,CACNA,EAAE,MAAMA,EAAE,QAAQ,CAAC,EACnBA,EAAE,YAAY,CAAC,CAAC,EAKhBA,EAAE,KAAK,CACT,CAAC,CACH,EACA,GAAI,CACN,CAAC,EAsBD,IAAY,EAAL,SAAA,EAAA,OAIL,GAAA,EAAA,YAAA,QAAA,cAIA,EAAA,EAAA,gBAAA,QAAA,kBAIA,EAAA,EAAA,iBAAA,QAAA,mBAIA,EAAA,EAAA,eAAA,QAAA,iBAKA,EAAA,EAAA,eAAA,QAAA,iBAIA,EAAA,EAAA,eAAA,OAAA,iBAIA,EAAA,EAAA,qBAAA,QAAA,uBAIA,EAAA,EAAA,cAAA,QAAA,iBACF,EAAA,CAAA,CAAA,EAEA,MAAa,EAAkCA,EAAE,OAAO,CACtD,QAASA,EAAE,QAAQ,KAAK,EACxB,OAAQA,EAAE,YAAYA,EAAE,QAA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,CACvC,KAAMA,EAAE,QAAQ,CAAmB,CACrC,CAAC,EAGY,EAAoBA,EAAE,QAAQ,OAAQ,CACjD,EACA,EACA,CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"advancedBarrel-DA4O2d7u.js","names":["v","v","v","v"],"sources":["../src/sat-connect-core/types.advanced.ts","../src/sat-connect-core/walletMethods.advanced.ts","../src/sat-connect-core/btcMethods.advanced.ts","../src/sat-connect-core/provider.advanced.ts","../src/advancedBarrel.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-explicit-any */\n// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport type { BtcProvider } from \"./provider.advanced.js\";\nimport type { Requests, Return } from \"./requests.advanced.js\";\n\nexport enum BitcoinNetworkType {\n Mainnet = \"Mainnet\",\n Testnet = \"Testnet\",\n Signet = \"Signet\",\n}\n\nexport interface BitcoinNetwork {\n type: BitcoinNetworkType;\n address?: string;\n}\n\nexport interface RequestPayload {\n network: BitcoinNetwork;\n}\n\nexport interface RequestOptions<Payload extends RequestPayload, Response> {\n onFinish: (response: Response) => void;\n onCancel: () => void;\n payload: Payload;\n getProvider?: () => Promise<BtcProvider | undefined>;\n}\n\n// RPC Request and Response types\n\nexport const RpcIdSchema = v.optional(\n v.union([v.string(), v.number(), v.null()]),\n);\nexport type RpcId = v.InferOutput<typeof RpcIdSchema>;\nexport const rpcRequestMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n method: v.string(),\n params: v.optional(\n v.union([\n v.array(v.unknown()),\n v.looseObject({}),\n // Note: This is to support current incorrect usage of RPC 2.0. Params need\n // to be either an array or an object when provided. Changing this now would\n // be a breaking change, so accepting null values for now. Tracking in\n // https://linear.app/xverseapp/issue/ENG-4538.\n v.null(),\n ]),\n ),\n id: RpcIdSchema,\n});\nexport type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;\n\nexport interface RpcBase {\n jsonrpc: \"2.0\";\n id: RpcId;\n}\nexport interface RpcRequest<T extends string, U> extends RpcBase {\n method: T;\n params: U;\n}\n\nexport interface MethodParamsAndResult<TParams, TResult> {\n params: TParams;\n result: TResult;\n}\n\n/**\n * @enum {number} RpcErrorCode\n * @description JSON-RPC error codes\n * @see https://www.jsonrpc.org/specification#error_object\n */\nexport enum RpcErrorCode {\n /**\n * Parse error Invalid JSON\n **/\n PARSE_ERROR = -32700,\n /**\n * The JSON sent is not a valid Request object.\n **/\n INVALID_REQUEST = -32600,\n /**\n * The method does not exist/is not available.\n **/\n METHOD_NOT_FOUND = -32601,\n /**\n * Invalid method parameter(s).\n */\n INVALID_PARAMS = -32602,\n /**\n * Internal JSON-RPC error.\n * This is a generic error, used when the server encounters an error in performing the request.\n **/\n INTERNAL_ERROR = -32603,\n /**\n * user rejected/canceled the request\n */\n USER_REJECTION = -32000,\n /**\n * method is not supported for the address provided\n */\n METHOD_NOT_SUPPORTED = -32001,\n /**\n * The client does not have permission to access the requested resource.\n */\n ACCESS_DENIED = -32002,\n}\n\nexport const rpcSuccessResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n result: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcSuccessResponseMessage = v.InferOutput<\n typeof rpcSuccessResponseMessageSchema\n>;\n\nexport const rpcErrorResponseMessageSchema = v.object({\n jsonrpc: v.literal(\"2.0\"),\n error: v.nonOptional(v.unknown()),\n id: RpcIdSchema,\n});\nexport type RpcErrorResponseMessage = v.InferOutput<\n typeof rpcErrorResponseMessageSchema\n>;\nexport const rpcResponseMessageSchema = v.union([\n rpcSuccessResponseMessageSchema,\n rpcErrorResponseMessageSchema,\n]);\nexport type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;\n\nexport interface RpcError {\n code: number | RpcErrorCode;\n message: string;\n data?: any;\n}\n\nexport interface RpcErrorResponse<\n TError extends RpcError = RpcError,\n> extends RpcBase {\n error: TError;\n}\n\nexport interface RpcSuccessResponse<\n Method extends keyof Requests,\n> extends RpcBase {\n result: Return<Method>;\n}\n\nexport type RpcResponse<Method extends keyof Requests> =\n RpcSuccessResponse<Method> | RpcErrorResponse;\n\nexport type RpcResult<Method extends keyof Requests> =\n | {\n result: RpcSuccessResponse<Method>[\"result\"];\n status: \"success\";\n }\n | {\n error: RpcErrorResponse[\"error\"];\n status: \"error\";\n };\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\n\nexport const walletTypes = [\"software\", \"ledger\"] as const;\nexport const walletTypeSchema = v.picklist(walletTypes);\nexport type WalletType = v.InferOutput<typeof walletTypeSchema>;\n\nexport const requestPermissionsMethodName = \"wallet_requestPermissions\";\nexport const requestPermissionsParamsSchema = v.undefined();\nexport const requestPermissionsResultSchema = v.literal(true);\nexport const requestPermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(requestPermissionsMethodName),\n params: requestPermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RequestPermissions = MethodParamsAndResult<\n v.InferOutput<typeof requestPermissionsParamsSchema>,\n v.InferOutput<typeof requestPermissionsResultSchema>\n>;\n\nexport const renouncePermissionsMethodName = \"wallet_renouncePermissions\";\nexport const renouncePermissionsParamsSchema = v.undefined();\nexport const renouncePermissionsResultSchema = v.literal(true);\nexport const renouncePermissionsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(renouncePermissionsMethodName),\n params: renouncePermissionsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type RenouncePermissions = MethodParamsAndResult<\n v.InferOutput<typeof renouncePermissionsParamsSchema>,\n v.InferOutput<typeof renouncePermissionsResultSchema>\n>;\n\nexport const getWalletTypeMethodName = \"wallet_getWalletType\";\nexport const getWalletTypeParamsSchema = v.nullish(v.null());\nexport const getWalletTypeResultSchema = walletTypeSchema;\nexport const getWalletTypeRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getWalletTypeMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetWalletType = MethodParamsAndResult<\n v.InferOutput<typeof getWalletTypeParamsSchema>,\n v.InferOutput<typeof getWalletTypeResultSchema>\n>;\n","// From https://github.com/secretkeylabs/sats-connect-core/\n\n/**\n * Represents the types and interfaces related to BTC methods.\n */\n\nimport * as v from \"valibot\";\nimport {\n MethodParamsAndResult,\n rpcRequestMessageSchema,\n} from \"./types.advanced.js\";\nimport { walletTypeSchema } from \"./walletMethods.advanced.js\";\n\nexport enum AddressPurpose {\n Ordinals = \"ordinals\",\n Payment = \"payment\",\n Stacks = \"stacks\",\n}\n\nexport enum AddressType {\n p2pkh = \"p2pkh\",\n p2sh = \"p2sh\",\n p2wpkh = \"p2wpkh\",\n p2wsh = \"p2wsh\",\n p2tr = \"p2tr\",\n stacks = \"stacks\",\n}\n\nexport const addressSchema = v.object({\n address: v.string(),\n publicKey: v.string(),\n purpose: v.enum(AddressPurpose),\n addressType: v.enum(AddressType),\n});\nexport type Address = v.InferOutput<typeof addressSchema>;\n\nexport const getInfoMethodName = \"getInfo\";\nexport const getInfoParamsSchema = v.nullish(v.null());\nexport type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;\nexport const getInfoResultSchema = v.object({\n /**\n * Version of the wallet.\n */\n version: v.string(),\n\n /**\n * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.\n */\n methods: v.optional(v.array(v.string())),\n\n /**\n * List of WBIP standards supported by the wallet. Not currently used.\n */\n supports: v.array(v.string()),\n});\nexport type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;\nexport const getInfoRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getInfoMethodName),\n params: getInfoParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetInfoRequestMessage = v.InferOutput<\n typeof getInfoRequestMessageSchema\n>;\nexport type GetInfo = MethodParamsAndResult<\n v.InferOutput<typeof getInfoParamsSchema>,\n v.InferOutput<typeof getInfoResultSchema>\n>;\n\nexport const getAddressesMethodName = \"getAddresses\";\nexport const getAddressesParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;\nexport const getAddressesResultSchema = v.object({\n /**\n * The addresses generated for the given purposes.\n */\n addresses: v.array(addressSchema),\n});\nexport type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;\nexport const getAddressesRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAddressesMethodName),\n params: getAddressesParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAddressesRequestMessage = v.InferOutput<\n typeof getAddressesRequestMessageSchema\n>;\nexport type GetAddresses = MethodParamsAndResult<\n v.InferOutput<typeof getAddressesParamsSchema>,\n v.InferOutput<typeof getAddressesResultSchema>\n>;\n\nexport const signMessageMethodName = \"signMessage\";\n\nexport enum MessageSigningProtocols {\n ECDSA = \"ECDSA\",\n BIP322 = \"BIP322\",\n}\n\nexport const signMessageParamsSchema = v.object({\n /**\n * The address used for signing.\n **/\n address: v.string(),\n /**\n * The message to sign.\n **/\n message: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.optional(v.enum(MessageSigningProtocols)),\n});\nexport type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;\nexport const signMessageResultSchema = v.object({\n /**\n * The signature of the message.\n */\n signature: v.string(),\n /**\n * hash of the message.\n */\n messageHash: v.string(),\n /**\n * The address used for signing.\n */\n address: v.string(),\n /**\n * The protocol to use for signing the message.\n */\n protocol: v.enum(MessageSigningProtocols),\n});\nexport type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;\nexport const signMessageRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(signMessageMethodName),\n params: signMessageParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type SignMessageRequestMessage = v.InferOutput<\n typeof signMessageRequestMessageSchema\n>;\nexport type SignMessage = MethodParamsAndResult<\n v.InferOutput<typeof signMessageParamsSchema>,\n v.InferOutput<typeof signMessageResultSchema>\n>;\n\ntype Recipient = {\n /**\n * The recipient's address.\n **/\n address: string;\n /**\n * The amount to send to the recipient in satoshis.\n */\n amount: number;\n};\n\nexport type SendTransferParams = {\n /**\n * Array of recipients to send to.\n * The amount to send to each recipient is in satoshis.\n */\n recipients: Array<Recipient>;\n};\ntype SendTransferResult = {\n /**\n * The transaction id as a hex-encoded string.\n */\n txid: string;\n};\n\nexport type SendTransfer = MethodParamsAndResult<\n SendTransferParams,\n SendTransferResult\n>;\n\nexport type SignPsbtParams = {\n /**\n * The base64 encoded PSBT to sign.\n */\n psbt: string;\n /**\n * The inputs to sign.\n * The key is the address and the value is an array of indexes of the inputs to sign.\n */\n signInputs: Record<string, number[]>;\n /**\n * the sigHash type to use for signing.\n * will default to the sighash type of the input if not provided.\n **/\n allowedSignHash?: number;\n /**\n * Whether to broadcast the transaction after signing.\n **/\n broadcast?: boolean;\n};\n\nexport type SignPsbtResult = {\n /**\n * The base64 encoded PSBT after signing.\n */\n psbt: string;\n /**\n * The transaction id as a hex-encoded string.\n * This is only returned if the transaction was broadcast.\n **/\n txid?: string;\n};\n\nexport type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;\n\nexport const getAccountsMethodName = \"getAccounts\";\nexport const getAccountsParamsSchema = v.object({\n /**\n * The purposes for which to generate addresses. See\n * {@linkcode AddressPurpose} for available purposes.\n */\n purposes: v.array(v.enum(AddressPurpose)),\n /**\n * A message to be displayed to the user in the request prompt.\n */\n message: v.optional(v.string()),\n});\nexport type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;\n\nexport const getAccountsResultSchema = v.array(\n v.object({\n ...addressSchema.entries,\n ...v.object({\n walletType: walletTypeSchema,\n }).entries,\n }),\n);\nexport type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;\nexport const getAccountsRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getAccountsMethodName),\n params: getAccountsParamsSchema,\n id: v.string(),\n }).entries,\n});\nexport type GetAccountsRequestMessage = v.InferOutput<\n typeof getAccountsRequestMessageSchema\n>;\nexport type GetAccounts = MethodParamsAndResult<\n v.InferOutput<typeof getAccountsParamsSchema>,\n v.InferOutput<typeof getAccountsResultSchema>\n>;\n\nexport const getBalanceMethodName = \"getBalance\";\nexport const getBalanceParamsSchema = v.nullish(v.null());\nexport const getBalanceResultSchema = v.object({\n /**\n * The confirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n confirmed: v.string(),\n\n /**\n * The unconfirmed balance of the wallet in sats. Using a string due to chrome\n * messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n unconfirmed: v.string(),\n\n /**\n * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in\n * sats. Using a string due to chrome messages not supporting bigint\n * (https://issues.chromium.org/issues/40116184).\n */\n total: v.string(),\n});\nexport const getBalanceRequestMessageSchema = v.object({\n ...rpcRequestMessageSchema.entries,\n ...v.object({\n method: v.literal(getBalanceMethodName),\n id: v.string(),\n }).entries,\n});\nexport type GetBalance = MethodParamsAndResult<\n v.InferOutput<typeof getBalanceParamsSchema>,\n v.InferOutput<typeof getBalanceResultSchema>\n>;\n","import * as v from \"valibot\";\nimport { Params, Requests } from \"./requests.advanced.js\";\nimport { RpcResponse } from \"./types.advanced.js\";\n\n// accountChange\nexport const accountChangeEventName = \"accountChange\";\nexport const accountChangeSchema = v.object({\n type: v.literal(accountChangeEventName),\n});\nexport type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;\n\n// networkChange\nexport const networkChangeEventName = \"networkChange\";\nexport const networkChangeSchema = v.object({\n type: v.literal(networkChangeEventName),\n});\nexport type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;\n\n// disconnect\nexport const disconnectEventName = \"disconnect\";\nexport const disconnectSchema = v.object({\n type: v.literal(disconnectEventName),\n});\nexport type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;\n\nexport const walletEventSchema = v.variant(\"type\", [\n accountChangeSchema,\n networkChangeSchema,\n disconnectSchema,\n]);\n\nexport type WalletEvent = v.InferOutput<typeof walletEventSchema>;\nexport type AddListener = <const WalletEventName extends WalletEvent[\"type\"]>(\n eventName: WalletEventName,\n cb: (event: Extract<WalletEvent, { type: WalletEventName }>) => void,\n) => () => void;\n\n/**\n * Interface representing a provider for interacting with accounts and signing messages.\n */\nexport interface BtcProvider {\n request: <Method extends keyof Requests>(\n method: Method,\n options: Params<Method>,\n providerId?: string,\n ) => Promise<RpcResponse<Method>>;\n\n addListener: AddListener;\n}\n\nexport interface Provider {\n id: string;\n name: string;\n icon: string;\n webUrl?: string;\n chromeWebStoreUrl?: string;\n mozillaAddOnsUrl?: string;\n googlePlayStoreUrl?: string;\n iOSAppStoreUrl?: string;\n methods?: string[];\n}\n","export * from \"./sat-connect-core/advanced.js\";\n"],"mappings":"snBAOA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,QAAA,UACA,EAAA,QAAA,UACA,EAAA,OAAA,UACF,EAAA,CAAA,CAAA,EAoBA,MAAa,EAAcA,EAAE,SAC3BA,EAAE,MAAM,CAACA,EAAE,OAAO,EAAGA,EAAE,OAAO,EAAGA,EAAE,KAAK,CAAC,CAAC,CAC5C,EAEa,EAA0BA,EAAE,OAAO,CAC9C,QAASA,EAAE,QAAQ,KAAK,EACxB,OAAQA,EAAE,OAAO,EACjB,OAAQA,EAAE,SACRA,EAAE,MAAM,CACNA,EAAE,MAAMA,EAAE,QAAQ,CAAC,EACnBA,EAAE,YAAY,C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OAAO,CAM7C,UAAWA,EAAE,OAAO,EAOpB,YAAaA,EAAE,OAAO,EAOtB,MAAOA,EAAE,OAAO,CAClB,CAAC,EACY,EAAiCA,EAAE,OAAO,CACrD,GAAG,EAAwB,QAC3B,GAAGA,EAAE,OAAO,CACV,OAAQA,EAAE,QAAQ,CAAoB,EACtC,GAAIA,EAAE,OAAO,CACf,CAAC,CAAC,CAAC,OACL,CAAC,ECtSY,EAAyB,gBACzB,EAAsBC,EAAE,OAAO,CAC1C,KAAMA,EAAE,QAAQ,CAAsB,CACxC,CAAC,EAIY,EAAyB,gBACzB,EAAsBA,EAAE,OAAO,CAC1C,KAAMA,EAAE,QAAQ,CAAsB,CACxC,CAAC,EAIY,EAAsB,aACtB,EAAmBA,EAAE,OAAO,CACvC,KAAMA,EAAE,QAAQ,CAAmB,CACrC,CAAC,EAGY,EAAoBA,EAAE,QAAQ,OAAQ,CACjD,EACA,EACA,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckb-ccc/xverse",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "CCC - CKBer's Codebase. Common Chains Connector's support for Xverse",
|
|
5
5
|
"author": "Hanssen0 <hanssen0@hanssen0.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"eslint-plugin-prettier": "^5.5.6",
|
|
40
40
|
"prettier": "^3.8.4",
|
|
41
41
|
"prettier-plugin-organize-imports": "^4.3.0",
|
|
42
|
+
"tsdown": "^0.22.3",
|
|
42
43
|
"typescript": "^6.0.3",
|
|
43
44
|
"typescript-eslint": "^8.61.1"
|
|
44
45
|
},
|
|
@@ -47,14 +48,13 @@
|
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
50
|
"bitcoinjs-lib": "^7.0.1",
|
|
50
|
-
"tsdown": "^0.22.3",
|
|
51
51
|
"valibot": "^1.4.1",
|
|
52
|
-
"@ckb-ccc/core": "1.
|
|
52
|
+
"@ckb-ccc/core": "1.16.0"
|
|
53
53
|
},
|
|
54
54
|
"types": "./dist.commonjs/index.d.ts",
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsdown",
|
|
57
|
-
"lint": "eslint ./src",
|
|
57
|
+
"lint": "tsc --noEmit && eslint ./src",
|
|
58
58
|
"format": "prettier --write . && eslint --fix ./src"
|
|
59
59
|
}
|
|
60
60
|
}
|
|
@@ -148,8 +148,7 @@ export interface RpcSuccessResponse<
|
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
export type RpcResponse<Method extends keyof Requests> =
|
|
151
|
-
|
|
152
|
-
| RpcErrorResponse;
|
|
151
|
+
RpcSuccessResponse<Method> | RpcErrorResponse;
|
|
153
152
|
|
|
154
153
|
export type RpcResult<Method extends keyof Requests> =
|
|
155
154
|
| {
|