@sats-connect/core 0.8.1-b5b5706 → 0.8.1-c2412c4

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/dist/index.d.mts CHANGED
@@ -1,637 +1,447 @@
1
1
  import * as v from 'valibot';
2
2
 
3
- declare enum ProviderPlatform {
4
- Web = "web",
5
- Mobile = "mobile"
3
+ declare enum BitcoinNetworkType {
4
+ Mainnet = "Mainnet",
5
+ Testnet = "Testnet",
6
+ Testnet4 = "Testnet4",
7
+ Signet = "Signet",
8
+ Regtest = "Regtest"
6
9
  }
7
- declare const getInfoMethodName = "getInfo";
8
- declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
9
- type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
10
- declare const getInfoResultSchema: v.ObjectSchema<{
11
- /**
12
- * Version of the wallet.
13
- */
14
- readonly version: v.StringSchema<undefined>;
15
- /**
16
- * The platform the wallet is running on (web or mobile).
17
- */
18
- readonly platform: v.OptionalSchema<v.EnumSchema<typeof ProviderPlatform, undefined>, undefined>;
19
- /**
20
- * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
21
- */
22
- readonly methods: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
23
- /**
24
- * List of WBIP standards supported by the wallet. Not currently used.
25
- */
26
- readonly supports: v.ArraySchema<v.StringSchema<undefined>, undefined>;
27
- }, undefined>;
28
- type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;
29
- declare const getInfoRequestMessageSchema: v.ObjectSchema<{
30
- readonly method: v.LiteralSchema<"getInfo", undefined>;
31
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
32
- readonly id: v.StringSchema<undefined>;
33
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
34
- }, undefined>;
35
- type GetInfoRequestMessage = v.InferOutput<typeof getInfoRequestMessageSchema>;
36
- type GetInfo = MethodParamsAndResult<v.InferOutput<typeof getInfoParamsSchema>, v.InferOutput<typeof getInfoResultSchema>>;
37
- declare const getAddressesMethodName = "getAddresses";
38
- declare const getAddressesParamsSchema: v.ObjectSchema<{
39
- /**
40
- * The purposes for which to generate addresses. See
41
- * {@linkcode AddressPurpose} for available purposes.
42
- */
43
- readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
44
- /**
45
- * A message to be displayed to the user in the request prompt.
46
- */
47
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
48
- }, undefined>;
49
- type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;
50
- declare const getAddressesResultSchema: v.ObjectSchema<{
51
- /**
52
- * The addresses generated for the given purposes.
53
- */
54
- readonly addresses: v.ArraySchema<v.ObjectSchema<{
55
- readonly address: v.StringSchema<undefined>;
56
- readonly publicKey: v.StringSchema<undefined>;
57
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
58
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
59
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
60
- }, undefined>, undefined>;
61
- readonly network: v.ObjectSchema<{
62
- readonly bitcoin: v.ObjectSchema<{
63
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
64
- }, undefined>;
65
- readonly stacks: v.ObjectSchema<{
66
- readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
67
- }, undefined>;
68
- readonly spark: v.ObjectSchema<{
69
- readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
70
- }, undefined>;
71
- }, undefined>;
72
- }, undefined>;
73
- type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;
74
- declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
75
- readonly method: v.LiteralSchema<"getAddresses", undefined>;
76
- readonly params: v.ObjectSchema<{
77
- /**
78
- * The purposes for which to generate addresses. See
79
- * {@linkcode AddressPurpose} for available purposes.
80
- */
81
- readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
82
- /**
83
- * A message to be displayed to the user in the request prompt.
84
- */
85
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
86
- }, undefined>;
87
- readonly id: v.StringSchema<undefined>;
10
+ declare enum StacksNetworkType {
11
+ Mainnet = "mainnet",
12
+ Testnet = "testnet"
13
+ }
14
+ declare enum StarknetNetworkType {
15
+ Mainnet = "mainnet",
16
+ Sepolia = "sepolia"
17
+ }
18
+ declare enum SparkNetworkType {
19
+ Mainnet = "mainnet",
20
+ Regtest = "regtest"
21
+ }
22
+ interface BitcoinNetwork {
23
+ type: BitcoinNetworkType;
24
+ address?: string;
25
+ }
26
+ interface RequestPayload {
27
+ network: BitcoinNetwork;
28
+ }
29
+ interface RequestOptions<Payload extends RequestPayload, Response> {
30
+ onFinish: (response: Response) => void;
31
+ onCancel: () => void;
32
+ payload: Payload;
33
+ getProvider?: () => Promise<BitcoinProvider | undefined>;
34
+ }
35
+ declare const RpcIdSchema: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
36
+ type RpcId = v.InferOutput<typeof RpcIdSchema>;
37
+ declare const rpcRequestMessageSchema: v.ObjectSchema<{
88
38
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
39
+ readonly method: v.StringSchema<undefined>;
40
+ readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, undefined>;
41
+ readonly id: v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>;
89
42
  }, undefined>;
90
- type GetAddressesRequestMessage = v.InferOutput<typeof getAddressesRequestMessageSchema>;
91
- type GetAddresses = MethodParamsAndResult<v.InferOutput<typeof getAddressesParamsSchema>, v.InferOutput<typeof getAddressesResultSchema>>;
92
- declare const signMessageMethodName = "signMessage";
93
- declare enum MessageSigningProtocols {
94
- ECDSA = "ECDSA",
95
- BIP322 = "BIP322"
43
+ type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;
44
+ interface RpcBase {
45
+ jsonrpc: '2.0';
46
+ id: RpcId;
96
47
  }
97
- declare const signMessageParamsSchema: v.ObjectSchema<{
48
+ interface RpcRequest<T extends string, U> extends RpcBase {
49
+ method: T;
50
+ params: U;
51
+ }
52
+ interface MethodParamsAndResult<TParams, TResult> {
53
+ params: TParams;
54
+ result: TResult;
55
+ }
56
+ /**
57
+ * @enum {number} RpcErrorCode
58
+ * @description JSON-RPC error codes
59
+ * @see https://www.jsonrpc.org/specification#error_object
60
+ */
61
+ declare enum RpcErrorCode {
98
62
  /**
99
- * The address used for signing.
63
+ * Parse error Invalid JSON
100
64
  **/
101
- readonly address: v.StringSchema<undefined>;
65
+ PARSE_ERROR = -32700,
102
66
  /**
103
- * The message to sign.
67
+ * The JSON sent is not a valid Request object.
104
68
  **/
105
- readonly message: v.StringSchema<undefined>;
106
- /**
107
- * The protocol to use for signing the message.
108
- */
109
- readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, undefined>;
110
- }, undefined>;
111
- type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;
112
- declare const signMessageResultSchema: v.ObjectSchema<{
69
+ INVALID_REQUEST = -32600,
113
70
  /**
114
- * The signature of the message.
115
- */
116
- readonly signature: v.StringSchema<undefined>;
71
+ * The method does not exist/is not available.
72
+ **/
73
+ METHOD_NOT_FOUND = -32601,
117
74
  /**
118
- * hash of the message.
75
+ * Invalid method parameter(s).
119
76
  */
120
- readonly messageHash: v.StringSchema<undefined>;
77
+ INVALID_PARAMS = -32602,
121
78
  /**
122
- * The address used for signing.
123
- */
124
- readonly address: v.StringSchema<undefined>;
79
+ * Internal JSON-RPC error.
80
+ * This is a generic error, used when the server encounters an error in performing the request.
81
+ **/
82
+ INTERNAL_ERROR = -32603,
125
83
  /**
126
- * The protocol to use for signing the message.
84
+ * user rejected/canceled the request
127
85
  */
128
- readonly protocol: v.EnumSchema<typeof MessageSigningProtocols, undefined>;
129
- }, undefined>;
130
- type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;
131
- declare const signMessageRequestMessageSchema: v.ObjectSchema<{
132
- readonly method: v.LiteralSchema<"signMessage", undefined>;
133
- readonly params: v.ObjectSchema<{
134
- /**
135
- * The address used for signing.
136
- **/
137
- readonly address: v.StringSchema<undefined>;
138
- /**
139
- * The message to sign.
140
- **/
141
- readonly message: v.StringSchema<undefined>;
142
- /**
143
- * The protocol to use for signing the message.
144
- */
145
- readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, undefined>;
146
- }, undefined>;
147
- readonly id: v.StringSchema<undefined>;
148
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
149
- }, undefined>;
150
- type SignMessageRequestMessage = v.InferOutput<typeof signMessageRequestMessageSchema>;
151
- type SignMessage = MethodParamsAndResult<v.InferOutput<typeof signMessageParamsSchema>, v.InferOutput<typeof signMessageResultSchema>>;
152
- declare const sendTransferMethodName = "sendTransfer";
153
- declare const sendTransferParamsSchema: v.ObjectSchema<{
86
+ USER_REJECTION = -32000,
154
87
  /**
155
- * Array of recipients to send to.
156
- * The amount to send to each recipient is in satoshis.
88
+ * method is not supported for the address provided
157
89
  */
158
- readonly recipients: v.ArraySchema<v.ObjectSchema<{
159
- readonly address: v.StringSchema<undefined>;
160
- readonly amount: v.NumberSchema<undefined>;
161
- }, undefined>, undefined>;
162
- }, undefined>;
163
- type SendTransferParams = v.InferOutput<typeof sendTransferParamsSchema>;
164
- declare const sendTransferResultSchema: v.ObjectSchema<{
90
+ METHOD_NOT_SUPPORTED = -32001,
165
91
  /**
166
- * The transaction id as a hex-encoded string.
92
+ * The client does not have permission to access the requested resource.
167
93
  */
168
- readonly txid: v.StringSchema<undefined>;
94
+ ACCESS_DENIED = -32002
95
+ }
96
+ declare const rpcSuccessResponseMessageSchema: v.ObjectSchema<{
97
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
98
+ readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
99
+ readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
169
100
  }, undefined>;
170
- type SendTransferResult = v.InferOutput<typeof sendTransferResultSchema>;
171
- declare const sendTransferRequestMessageSchema: v.ObjectSchema<{
172
- readonly method: v.LiteralSchema<"sendTransfer", undefined>;
173
- readonly params: v.ObjectSchema<{
174
- /**
175
- * Array of recipients to send to.
176
- * The amount to send to each recipient is in satoshis.
177
- */
178
- readonly recipients: v.ArraySchema<v.ObjectSchema<{
179
- readonly address: v.StringSchema<undefined>;
180
- readonly amount: v.NumberSchema<undefined>;
181
- }, undefined>, undefined>;
182
- }, undefined>;
183
- readonly id: v.StringSchema<undefined>;
101
+ type RpcSuccessResponseMessage = v.InferOutput<typeof rpcSuccessResponseMessageSchema>;
102
+ declare const rpcErrorResponseMessageSchema: v.ObjectSchema<{
184
103
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
104
+ readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
105
+ readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
185
106
  }, undefined>;
186
- type SendTransferRequestMessage = v.InferOutput<typeof sendTransferRequestMessageSchema>;
187
- type SendTransfer = MethodParamsAndResult<SendTransferParams, SendTransferResult>;
188
- declare const signPsbtMethodName = "signPsbt";
189
- declare const signPsbtParamsSchema: v.ObjectSchema<{
190
- /**
191
- * The base64 encoded PSBT to sign.
192
- */
193
- readonly psbt: v.StringSchema<undefined>;
194
- /**
195
- * The inputs to sign.
196
- * The key is the address and the value is an array of indexes of the inputs to sign.
197
- */
198
- readonly signInputs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>, undefined>;
199
- /**
200
- * Whether to broadcast the transaction after signing.
201
- **/
202
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
203
- }, undefined>;
204
- type SignPsbtParams = v.InferOutput<typeof signPsbtParamsSchema>;
205
- declare const signPsbtResultSchema: v.ObjectSchema<{
206
- /**
207
- * The base64 encoded PSBT after signing.
208
- */
209
- readonly psbt: v.StringSchema<undefined>;
210
- /**
211
- * The transaction id as a hex-encoded string.
212
- * This is only returned if the transaction was broadcast.
213
- **/
214
- readonly txid: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
215
- }, undefined>;
216
- type SignPsbtResult = v.InferOutput<typeof signPsbtResultSchema>;
217
- declare const signPsbtRequestMessageSchema: v.ObjectSchema<{
218
- readonly method: v.LiteralSchema<"signPsbt", undefined>;
219
- readonly params: v.ObjectSchema<{
220
- /**
221
- * The base64 encoded PSBT to sign.
222
- */
223
- readonly psbt: v.StringSchema<undefined>;
224
- /**
225
- * The inputs to sign.
226
- * The key is the address and the value is an array of indexes of the inputs to sign.
227
- */
228
- readonly signInputs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>, undefined>;
229
- /**
230
- * Whether to broadcast the transaction after signing.
231
- **/
232
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
233
- }, undefined>;
234
- readonly id: v.StringSchema<undefined>;
107
+ type RpcErrorResponseMessage = v.InferOutput<typeof rpcErrorResponseMessageSchema>;
108
+ declare const rpcResponseMessageSchema: v.UnionSchema<[v.ObjectSchema<{
235
109
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
236
- }, undefined>;
237
- type SignPsbtRequestMessage = v.InferOutput<typeof signPsbtRequestMessageSchema>;
238
- type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
239
- declare const getAccountsMethodName = "getAccounts";
240
- declare const getAccountsParamsSchema: v.ObjectSchema<{
241
- /**
242
- * The purposes for which to generate addresses. See
243
- * {@linkcode AddressPurpose} for available purposes.
244
- */
245
- readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
246
- /**
247
- * A message to be displayed to the user in the request prompt.
248
- */
249
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
250
- }, undefined>;
251
- type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
252
- declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
253
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
110
+ readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
111
+ readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
112
+ }, undefined>, v.ObjectSchema<{
113
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
114
+ readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
115
+ readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
116
+ }, undefined>], undefined>;
117
+ type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;
118
+ interface RpcError {
119
+ code: number | RpcErrorCode;
120
+ message: string;
121
+ data?: any;
122
+ }
123
+ interface RpcErrorResponse<TError extends RpcError = RpcError> extends RpcBase {
124
+ error: TError;
125
+ }
126
+ interface RpcSuccessResponse<Method extends keyof Requests> extends RpcBase {
127
+ result: Return<Method>;
128
+ }
129
+ type RpcResponse<Method extends keyof Requests> = RpcSuccessResponse<Method> | RpcErrorResponse;
130
+ type RpcResult<Method extends keyof Requests> = {
131
+ result: RpcSuccessResponse<Method>['result'];
132
+ status: 'success';
133
+ } | {
134
+ error: RpcErrorResponse['error'];
135
+ status: 'error';
136
+ };
137
+
138
+ declare enum AddressPurpose {
139
+ Ordinals = "ordinals",
140
+ Payment = "payment",
141
+ Stacks = "stacks",
142
+ Starknet = "starknet",
143
+ Spark = "spark"
144
+ }
145
+ interface GetAddressPayload extends RequestPayload {
146
+ purposes: AddressPurpose[];
147
+ message: string;
148
+ }
149
+ declare enum AddressType {
150
+ p2pkh = "p2pkh",
151
+ p2sh = "p2sh",
152
+ p2wpkh = "p2wpkh",
153
+ p2wsh = "p2wsh",
154
+ p2tr = "p2tr",
155
+ stacks = "stacks",
156
+ starknet = "starknet",
157
+ spark = "spark"
158
+ }
159
+ declare const addressSchema: v.ObjectSchema<{
254
160
  readonly address: v.StringSchema<undefined>;
255
161
  readonly publicKey: v.StringSchema<undefined>;
256
162
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
257
163
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
258
- }, undefined>, undefined>;
259
- type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
260
- declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
261
- readonly method: v.LiteralSchema<"getAccounts", undefined>;
262
- readonly params: v.ObjectSchema<{
263
- /**
264
- * The purposes for which to generate addresses. See
265
- * {@linkcode AddressPurpose} for available purposes.
266
- */
267
- readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
268
- /**
269
- * A message to be displayed to the user in the request prompt.
270
- */
271
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
272
- }, undefined>;
273
- readonly id: v.StringSchema<undefined>;
274
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
275
- }, undefined>;
276
- type GetAccountsRequestMessage = v.InferOutput<typeof getAccountsRequestMessageSchema>;
277
- type GetAccounts = MethodParamsAndResult<v.InferOutput<typeof getAccountsParamsSchema>, v.InferOutput<typeof getAccountsResultSchema>>;
278
- declare const getBalanceMethodName = "getBalance";
279
- declare const getBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
280
- type GetBalanceParams = v.InferOutput<typeof getBalanceParamsSchema>;
281
- declare const getBalanceResultSchema: v.ObjectSchema<{
282
- /**
283
- * The confirmed balance of the wallet in sats. Using a string due to chrome
284
- * messages not supporting bigint
285
- * (https://issues.chromium.org/issues/40116184).
286
- */
287
- readonly confirmed: v.StringSchema<undefined>;
288
- /**
289
- * The unconfirmed balance of the wallet in sats. Using a string due to chrome
290
- * messages not supporting bigint
291
- * (https://issues.chromium.org/issues/40116184).
292
- */
293
- readonly unconfirmed: v.StringSchema<undefined>;
294
- /**
295
- * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
296
- * sats. Using a string due to chrome messages not supporting bigint
297
- * (https://issues.chromium.org/issues/40116184).
298
- */
299
- readonly total: v.StringSchema<undefined>;
300
- }, undefined>;
301
- type GetBalanceResult = v.InferOutput<typeof getBalanceResultSchema>;
302
- declare const getBalanceRequestMessageSchema: v.ObjectSchema<{
303
- readonly method: v.LiteralSchema<"getBalance", undefined>;
304
- readonly id: v.StringSchema<undefined>;
305
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
306
- readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, undefined>;
164
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
307
165
  }, undefined>;
308
- type GetBalanceRequestMessage = v.InferOutput<typeof getBalanceRequestMessageSchema>;
309
- type GetBalance = MethodParamsAndResult<GetBalanceParams, GetBalanceResult>;
166
+ type Address = v.InferOutput<typeof addressSchema>;
167
+ interface GetAddressResponse {
168
+ addresses: Address[];
169
+ }
170
+ type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
310
171
 
311
- declare const getInscriptionsMethodName = "ord_getInscriptions";
312
- declare const getInscriptionsParamsSchema: v.ObjectSchema<{
313
- readonly offset: v.NumberSchema<undefined>;
314
- readonly limit: v.NumberSchema<undefined>;
315
- }, undefined>;
316
- type GetInscriptionsParams = v.InferOutput<typeof getInscriptionsParamsSchema>;
317
- declare const getInscriptionsResultSchema: v.ObjectSchema<{
318
- readonly total: v.NumberSchema<undefined>;
319
- readonly limit: v.NumberSchema<undefined>;
320
- readonly offset: v.NumberSchema<undefined>;
321
- readonly inscriptions: v.ArraySchema<v.ObjectSchema<{
322
- readonly inscriptionId: v.StringSchema<undefined>;
323
- readonly inscriptionNumber: v.StringSchema<undefined>;
324
- readonly address: v.StringSchema<undefined>;
325
- readonly collectionName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
326
- readonly postage: v.StringSchema<undefined>;
327
- readonly contentLength: v.StringSchema<undefined>;
328
- readonly contentType: v.StringSchema<undefined>;
329
- readonly timestamp: v.NumberSchema<undefined>;
330
- readonly offset: v.NumberSchema<undefined>;
331
- readonly genesisTransaction: v.StringSchema<undefined>;
332
- readonly output: v.StringSchema<undefined>;
333
- }, undefined>, undefined>;
334
- }, undefined>;
335
- type GetInscriptionsResult = v.InferOutput<typeof getInscriptionsResultSchema>;
336
- declare const getInscriptionsRequestMessageSchema: v.ObjectSchema<{
337
- readonly method: v.LiteralSchema<"ord_getInscriptions", undefined>;
338
- readonly params: v.ObjectSchema<{
339
- readonly offset: v.NumberSchema<undefined>;
340
- readonly limit: v.NumberSchema<undefined>;
341
- }, undefined>;
342
- readonly id: v.StringSchema<undefined>;
343
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
344
- }, undefined>;
345
- type GetInscriptionsRequestMessage = v.InferOutput<typeof getInscriptionsRequestMessageSchema>;
346
- type GetInscriptions = MethodParamsAndResult<GetInscriptionsParams, GetInscriptionsResult>;
347
- declare const sendInscriptionsMethodName = "ord_sendInscriptions";
348
- declare const sendInscriptionsParamsSchema: v.ObjectSchema<{
349
- readonly transfers: v.ArraySchema<v.ObjectSchema<{
350
- readonly address: v.StringSchema<undefined>;
351
- readonly inscriptionId: v.StringSchema<undefined>;
352
- }, undefined>, undefined>;
353
- }, undefined>;
354
- type SendInscriptionsParams = v.InferOutput<typeof sendInscriptionsParamsSchema>;
355
- declare const sendInscriptionsResultSchema: v.ObjectSchema<{
356
- readonly txid: v.StringSchema<undefined>;
357
- }, undefined>;
358
- type SendInscriptionsResult = v.InferOutput<typeof sendInscriptionsResultSchema>;
359
- declare const sendInscriptionsRequestMessageSchema: v.ObjectSchema<{
360
- readonly method: v.LiteralSchema<"ord_sendInscriptions", undefined>;
361
- readonly params: v.ObjectSchema<{
362
- readonly transfers: v.ArraySchema<v.ObjectSchema<{
363
- readonly address: v.StringSchema<undefined>;
364
- readonly inscriptionId: v.StringSchema<undefined>;
365
- }, undefined>, undefined>;
366
- }, undefined>;
367
- readonly id: v.StringSchema<undefined>;
368
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
369
- }, undefined>;
370
- type SendInscriptionsRequestMessage = v.InferOutput<typeof sendInscriptionsRequestMessageSchema>;
371
- type SendInscriptions = MethodParamsAndResult<SendInscriptionsParams, SendInscriptionsResult>;
172
+ /**
173
+ * @deprecated Use `request()` instead
174
+ */
175
+ declare const getAddress: (options: GetAddressOptions) => Promise<void>;
372
176
 
373
- type CreateMintOrderRequest = {
374
- runeName: string;
375
- repeats: number;
376
- refundAddress: string;
377
- destinationAddress: string;
378
- feeRate: number;
379
- appServiceFee?: number;
380
- appServiceFeeAddress?: string;
381
- };
382
- type EstimateMintOrderRequest = Omit<CreateMintOrderRequest, 'refundAddress'>;
383
- type EstimateOrderResponse = {
384
- totalSize: number;
385
- totalCost: number;
386
- costBreakdown: {
387
- postage: number;
388
- networkFee: number;
389
- serviceFee: number;
390
- appServiceFee: number;
391
- };
392
- };
393
- type CreateEtchOrderRequest = {
394
- runeName: string;
395
- divisibility?: number;
396
- symbol?: string;
397
- premine?: string;
398
- isMintable: boolean;
399
- terms?: {
400
- amount?: string;
401
- cap?: string;
402
- heightStart?: string;
403
- heightEnd?: string;
404
- offsetStart?: string;
405
- offsetEnd?: string;
406
- };
407
- inscriptionDetails?: {
408
- contentType: string;
409
- contentBase64: string;
410
- };
411
- delegateInscriptionId?: string;
412
- destinationAddress: string;
413
- refundAddress: string;
414
- feeRate: number;
415
- appServiceFee?: number;
416
- appServiceFeeAddress?: string;
177
+ interface GetCapabilitiesPayload extends RequestPayload {
178
+ }
179
+ type GetCapabilitiesResponse = Capability[];
180
+ type GetCapabilitiesOptions = RequestOptions<GetCapabilitiesPayload, GetCapabilitiesResponse>;
181
+
182
+ declare const getCapabilities: (options: GetCapabilitiesOptions) => Promise<void>;
183
+
184
+ interface CreateInscriptionPayload extends RequestPayload {
185
+ contentType: string;
186
+ content: string;
187
+ payloadType: 'PLAIN_TEXT' | 'BASE_64';
188
+ appFee?: number;
189
+ appFeeAddress?: string;
190
+ suggestedMinerFeeRate?: number;
191
+ token?: string;
192
+ }
193
+ interface CreateRepeatInscriptionsPayload extends CreateInscriptionPayload {
194
+ repeat: number;
195
+ }
196
+ type CreateInscriptionResponse = {
197
+ txId: string;
417
198
  };
418
- type EstimateEtchOrderRequest = Omit<CreateEtchOrderRequest, 'refundAddress'>;
419
- type GetOrderRequest = {
420
- id: string;
199
+ type CreateRepeatInscriptionsResponse = {
200
+ txId: string;
421
201
  };
422
- type GetOrderResponse = {
423
- id: string;
424
- orderType: 'rune_mint' | 'rune_etch';
425
- state: 'new' | 'pending' | 'executing' | 'complete' | 'failed' | 'refunded' | 'stale';
426
- fundingAddress: string;
427
- reason?: string;
428
- createdAt: string;
202
+ type CreateInscriptionOptions = RequestOptions<CreateInscriptionPayload, CreateInscriptionResponse>;
203
+ type CreateRepeatInscriptionsOptions = RequestOptions<CreateRepeatInscriptionsPayload, CreateRepeatInscriptionsResponse>;
204
+
205
+ declare const createInscription: (options: CreateInscriptionOptions) => Promise<void>;
206
+
207
+ declare const createRepeatInscriptions: (options: CreateRepeatInscriptionsOptions) => Promise<void>;
208
+
209
+ interface SignMessagePayload extends RequestPayload {
210
+ address: string;
211
+ message: string;
212
+ protocol?: MessageSigningProtocols;
213
+ }
214
+ type SignMessageResponse = string;
215
+ type SignMessageOptions = RequestOptions<SignMessagePayload, SignMessageResponse>;
216
+
217
+ declare const signMessage: (options: SignMessageOptions) => Promise<void>;
218
+
219
+ interface Recipient {
220
+ address: string;
221
+ amountSats: bigint;
222
+ }
223
+ type SerializedRecipient = Omit<Recipient, 'amountSats'> & {
224
+ amountSats: string;
429
225
  };
430
- type RBFOrderRequest = {
431
- orderId: string;
432
- newFeeRate: number;
226
+ interface SendBtcTransactionPayload extends RequestPayload {
227
+ recipients: Recipient[];
228
+ senderAddress: string;
229
+ message?: string;
230
+ }
231
+ type SerializedSendBtcTransactionPayload = Omit<SendBtcTransactionPayload, 'recipients'> & {
232
+ recipients: SerializedRecipient[];
433
233
  };
434
- type RBFOrderResponse = {
435
- rbfCost: number;
436
- fundingAddress: string;
234
+ type SendBtcTransactionResponse = string;
235
+ type SendBtcTransactionOptions = RequestOptions<SendBtcTransactionPayload, SendBtcTransactionResponse>;
236
+ interface InputToSign {
237
+ address: string;
238
+ signingIndexes: number[];
239
+ sigHash?: number;
240
+ }
241
+ type PsbtPayload = {
242
+ psbtBase64: string;
243
+ inputsToSign?: InputToSign[];
244
+ broadcast?: boolean;
437
245
  };
438
-
439
- interface RunesEstimateEtchParams extends EstimateEtchOrderRequest {
440
- network?: BitcoinNetworkType;
246
+ type SignMultiplePsbtPayload = {
247
+ psbtBase64: string;
248
+ inputsToSign?: InputToSign[];
249
+ };
250
+ interface SignTransactionPayload extends RequestPayload, PsbtPayload {
251
+ message: string;
441
252
  }
442
- type RunesEstimateEtchResult = EstimateOrderResponse;
443
- type RunesEstimateEtch = MethodParamsAndResult<RunesEstimateEtchParams, RunesEstimateEtchResult>;
444
-
445
- interface runesEstimateMintParams extends EstimateMintOrderRequest {
446
- network?: BitcoinNetworkType;
253
+ interface SignTransactionResponse {
254
+ psbtBase64: string;
255
+ txId?: string;
447
256
  }
448
- type runesEstimateMintResult = EstimateOrderResponse;
449
- type RunesEstimateMint = MethodParamsAndResult<runesEstimateMintParams, runesEstimateMintResult>;
450
-
451
- interface RunesEstimateRbfOrderParams extends RBFOrderRequest {
452
- network?: BitcoinNetworkType;
257
+ type SignTransactionOptions = RequestOptions<SignTransactionPayload, SignTransactionResponse>;
258
+ interface SignMultipleTransactionsPayload extends RequestPayload {
259
+ message: string;
260
+ psbts: SignMultiplePsbtPayload[];
453
261
  }
454
- type RunesEstimateRbfOrder = MethodParamsAndResult<RunesEstimateRbfOrderParams, RBFOrderResponse>;
262
+ type SignMultipleTransactionsResponse = SignTransactionResponse[];
263
+ type SignMultipleTransactionOptions = RequestOptions<SignMultipleTransactionsPayload, SignMultipleTransactionsResponse>;
455
264
 
456
- declare const runesEtchMethodName = "runes_etch";
457
- declare const runesEtchParamsSchema: v.ObjectSchema<{
458
- readonly runeName: v.StringSchema<undefined>;
459
- readonly divisibility: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
460
- readonly symbol: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
461
- readonly premine: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
462
- readonly isMintable: v.BooleanSchema<undefined>;
463
- readonly delegateInscriptionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
464
- readonly destinationAddress: v.StringSchema<undefined>;
465
- readonly refundAddress: v.StringSchema<undefined>;
466
- readonly feeRate: v.NumberSchema<undefined>;
467
- readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
468
- readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
469
- readonly terms: v.OptionalSchema<v.ObjectSchema<{
470
- readonly amount: v.StringSchema<undefined>;
471
- readonly cap: v.StringSchema<undefined>;
472
- readonly heightStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
473
- readonly heightEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
474
- readonly offsetStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
475
- readonly offsetEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
476
- }, undefined>, undefined>;
477
- readonly inscriptionDetails: v.OptionalSchema<v.ObjectSchema<{
478
- readonly contentType: v.StringSchema<undefined>;
479
- readonly contentBase64: v.StringSchema<undefined>;
480
- }, undefined>, undefined>;
481
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
482
- }, undefined>;
483
- type RunesEtchParams = v.InferOutput<typeof runesEtchParamsSchema>;
484
- declare const runesEtchResultSchema: v.ObjectSchema<{
485
- readonly orderId: v.StringSchema<undefined>;
486
- readonly fundTransactionId: v.StringSchema<undefined>;
487
- readonly fundingAddress: v.StringSchema<undefined>;
488
- }, undefined>;
489
- type RunesEtchResult = v.InferOutput<typeof runesEtchResultSchema>;
490
- declare const runesEtchRequestMessageSchema: v.ObjectSchema<{
491
- readonly method: v.LiteralSchema<"runes_etch", undefined>;
492
- readonly params: v.ObjectSchema<{
493
- readonly runeName: v.StringSchema<undefined>;
494
- readonly divisibility: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
495
- readonly symbol: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
496
- readonly premine: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
497
- readonly isMintable: v.BooleanSchema<undefined>;
498
- readonly delegateInscriptionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
499
- readonly destinationAddress: v.StringSchema<undefined>;
500
- readonly refundAddress: v.StringSchema<undefined>;
501
- readonly feeRate: v.NumberSchema<undefined>;
502
- readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
503
- readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
504
- readonly terms: v.OptionalSchema<v.ObjectSchema<{
505
- readonly amount: v.StringSchema<undefined>;
506
- readonly cap: v.StringSchema<undefined>;
507
- readonly heightStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
508
- readonly heightEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
509
- readonly offsetStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
510
- readonly offsetEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
511
- }, undefined>, undefined>;
512
- readonly inscriptionDetails: v.OptionalSchema<v.ObjectSchema<{
513
- readonly contentType: v.StringSchema<undefined>;
514
- readonly contentBase64: v.StringSchema<undefined>;
515
- }, undefined>, undefined>;
516
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
517
- }, undefined>;
518
- readonly id: v.StringSchema<undefined>;
519
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
520
- }, undefined>;
521
- type RunesEtchRequestMessage = v.InferOutput<typeof runesEtchRequestMessageSchema>;
522
- type RunesEtch = MethodParamsAndResult<v.InferOutput<typeof runesEtchParamsSchema>, v.InferOutput<typeof runesEtchResultSchema>>;
265
+ declare const sendBtcTransaction: (options: SendBtcTransactionOptions) => Promise<void>;
523
266
 
524
- declare const runesGetBalanceMethodName = "runes_getBalance";
525
- declare const runesGetBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
526
- type RunesGetBalanceParams = v.InferOutput<typeof runesGetBalanceParamsSchema>;
527
- declare const runesGetBalanceResultSchema: v.ObjectSchema<{
528
- readonly balances: v.ArraySchema<v.ObjectSchema<{
529
- readonly runeName: v.StringSchema<undefined>;
530
- readonly amount: v.StringSchema<undefined>;
531
- readonly divisibility: v.NumberSchema<undefined>;
532
- readonly symbol: v.StringSchema<undefined>;
533
- readonly inscriptionId: v.NullishSchema<v.StringSchema<undefined>, undefined>;
534
- readonly spendableBalance: v.StringSchema<undefined>;
535
- }, undefined>, undefined>;
536
- }, undefined>;
537
- type RunesGetBalanceResult = v.InferOutput<typeof runesGetBalanceResultSchema>;
538
- declare const runesGetBalanceRequestMessageSchema: v.ObjectSchema<{
539
- readonly method: v.LiteralSchema<"runes_getBalance", undefined>;
540
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
541
- readonly id: v.StringSchema<undefined>;
542
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
543
- }, undefined>;
544
- type runesGetBalanceRequestMessage = v.InferOutput<typeof runesGetBalanceRequestMessageSchema>;
545
- type RunesGetBalance = MethodParamsAndResult<RunesGetBalanceParams, RunesGetBalanceResult>;
267
+ declare const signTransaction: (options: SignTransactionOptions) => Promise<void>;
546
268
 
547
- interface RunesGetOrderParams extends GetOrderRequest {
548
- network?: BitcoinNetworkType;
549
- }
550
- type RunesGetOrder = MethodParamsAndResult<RunesGetOrderParams, GetOrderResponse>;
269
+ declare const signMultipleTransactions: (options: SignMultipleTransactionOptions) => Promise<void>;
551
270
 
552
- declare const runesMintMethodName = "runes_mint";
553
- declare const runesMintParamsSchema: v.ObjectSchema<{
554
- readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
555
- readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
556
- readonly destinationAddress: v.StringSchema<undefined>;
557
- readonly feeRate: v.NumberSchema<undefined>;
558
- readonly refundAddress: v.StringSchema<undefined>;
559
- readonly repeats: v.NumberSchema<undefined>;
560
- readonly runeName: v.StringSchema<undefined>;
561
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
562
- }, undefined>;
563
- type RunesMintParams = v.InferOutput<typeof runesMintParamsSchema>;
564
- declare const runesMintResultSchema: v.ObjectSchema<{
565
- readonly orderId: v.StringSchema<undefined>;
566
- readonly fundTransactionId: v.StringSchema<undefined>;
567
- readonly fundingAddress: v.StringSchema<undefined>;
271
+ declare const accountChangeEventName = "accountChange";
272
+ declare const accountChangeSchema: v.ObjectSchema<{
273
+ readonly type: v.LiteralSchema<"accountChange", undefined>;
274
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
275
+ readonly address: v.StringSchema<undefined>;
276
+ readonly publicKey: v.StringSchema<undefined>;
277
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
278
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
279
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
280
+ }, undefined>, undefined>, undefined>;
568
281
  }, undefined>;
569
- type RunesMintResult = v.InferOutput<typeof runesMintResultSchema>;
570
- declare const runesMintRequestMessageSchema: v.ObjectSchema<{
571
- readonly method: v.LiteralSchema<"runes_mint", undefined>;
572
- readonly params: v.ObjectSchema<{
573
- readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
574
- readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
575
- readonly destinationAddress: v.StringSchema<undefined>;
576
- readonly feeRate: v.NumberSchema<undefined>;
577
- readonly refundAddress: v.StringSchema<undefined>;
578
- readonly repeats: v.NumberSchema<undefined>;
579
- readonly runeName: v.StringSchema<undefined>;
580
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
282
+ type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;
283
+ declare const networkChangeEventName = "networkChange";
284
+ declare const networkChangeSchema: v.ObjectSchema<{
285
+ readonly type: v.LiteralSchema<"networkChange", undefined>;
286
+ readonly bitcoin: v.ObjectSchema<{
287
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
581
288
  }, undefined>;
582
- readonly id: v.StringSchema<undefined>;
583
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
289
+ readonly stacks: v.ObjectSchema<{
290
+ readonly name: v.StringSchema<undefined>;
291
+ }, undefined>;
292
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
293
+ readonly address: v.StringSchema<undefined>;
294
+ readonly publicKey: v.StringSchema<undefined>;
295
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
296
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
297
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
298
+ }, undefined>, undefined>, undefined>;
584
299
  }, undefined>;
585
- type RunesMintRequestMessage = v.InferOutput<typeof runesMintRequestMessageSchema>;
586
- type RunesMint = MethodParamsAndResult<v.InferOutput<typeof runesMintParamsSchema>, v.InferOutput<typeof runesMintResultSchema>>;
587
-
588
- interface RunesRbfOrderParams extends RBFOrderRequest {
589
- network?: BitcoinNetworkType;
300
+ type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
301
+ declare const disconnectEventName = "disconnect";
302
+ declare const disconnectSchema: v.ObjectSchema<{
303
+ readonly type: v.LiteralSchema<"disconnect", undefined>;
304
+ }, undefined>;
305
+ type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;
306
+ declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
307
+ readonly type: v.LiteralSchema<"accountChange", undefined>;
308
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
309
+ readonly address: v.StringSchema<undefined>;
310
+ readonly publicKey: v.StringSchema<undefined>;
311
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
312
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
313
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
314
+ }, undefined>, undefined>, undefined>;
315
+ }, undefined>, v.ObjectSchema<{
316
+ readonly type: v.LiteralSchema<"networkChange", undefined>;
317
+ readonly bitcoin: v.ObjectSchema<{
318
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
319
+ }, undefined>;
320
+ readonly stacks: v.ObjectSchema<{
321
+ readonly name: v.StringSchema<undefined>;
322
+ }, undefined>;
323
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
324
+ readonly address: v.StringSchema<undefined>;
325
+ readonly publicKey: v.StringSchema<undefined>;
326
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
327
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
328
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
329
+ }, undefined>, undefined>, undefined>;
330
+ }, undefined>, v.ObjectSchema<{
331
+ readonly type: v.LiteralSchema<"disconnect", undefined>;
332
+ }, undefined>], undefined>;
333
+ type WalletEvent = v.InferOutput<typeof walletEventSchema>;
334
+ type AccountChangeCallback = (e: AccountChangeEvent) => void;
335
+ type DisconnectCallback = (e: DisconnectEvent) => void;
336
+ type NetworkChangeCallback = (e: NetworkChangeEvent) => void;
337
+ type ListenerInfo = {
338
+ eventName: typeof accountChangeEventName;
339
+ cb: AccountChangeCallback;
340
+ } | {
341
+ eventName: typeof disconnectEventName;
342
+ cb: DisconnectCallback;
343
+ } | {
344
+ eventName: typeof networkChangeEventName;
345
+ cb: NetworkChangeCallback;
346
+ };
347
+ type AddListener = (arg: ListenerInfo) => () => void;
348
+ interface BaseBitcoinProvider {
349
+ request: <Method extends keyof Requests>(method: Method, options: Params<Method>, providerId?: string) => Promise<RpcResponse<Method>>;
350
+ connect: (request: string) => Promise<GetAddressResponse>;
351
+ signMessage: (request: string) => Promise<SignMessageResponse>;
352
+ signTransaction: (request: string) => Promise<SignTransactionResponse>;
353
+ sendBtcTransaction: (request: string) => Promise<SendBtcTransactionResponse>;
354
+ createInscription: (request: string) => Promise<CreateInscriptionResponse>;
355
+ createRepeatInscriptions: (request: string) => Promise<CreateRepeatInscriptionsResponse>;
356
+ signMultipleTransactions: (request: string) => Promise<SignMultipleTransactionsResponse>;
357
+ addListener: AddListener;
590
358
  }
591
- interface RunesRbfOrderResult {
592
- orderId: string;
593
- fundRBFTransactionId: string;
594
- fundingAddress: string;
359
+ type Capability = keyof BaseBitcoinProvider;
360
+ interface BitcoinProvider extends BaseBitcoinProvider {
361
+ getCapabilities?: (request: string) => Promise<GetCapabilitiesResponse>;
362
+ }
363
+ interface Provider {
364
+ id: string;
365
+ name: string;
366
+ icon: string;
367
+ webUrl?: string;
368
+ chromeWebStoreUrl?: string;
369
+ mozillaAddOnsUrl?: string;
370
+ googlePlayStoreUrl?: string;
371
+ iOSAppStoreUrl?: string;
372
+ methods?: (StxRequestMethod | BtcRequestMethod | RunesRequestMethod | OrdinalsRequestMethod)[];
373
+ }
374
+ interface SupportedWallet extends Provider {
375
+ isInstalled: boolean;
376
+ }
377
+ declare global {
378
+ interface XverseProviders {
379
+ BitcoinProvider?: BitcoinProvider;
380
+ }
381
+ interface Window {
382
+ BitcoinProvider?: BitcoinProvider;
383
+ XverseProviders?: XverseProviders;
384
+ btc_providers?: Provider[];
385
+ }
595
386
  }
596
- type RunesRbfOrder = MethodParamsAndResult<RunesRbfOrderParams, RunesRbfOrderResult>;
597
387
 
598
- declare const runesTransferMethodName = "runes_transfer";
599
- declare const runesTransferParamsSchema: v.ObjectSchema<{
600
- readonly recipients: v.ArraySchema<v.ObjectSchema<{
601
- readonly runeName: v.StringSchema<undefined>;
602
- readonly amount: v.StringSchema<undefined>;
603
- readonly address: v.StringSchema<undefined>;
604
- }, undefined>, undefined>;
605
- }, undefined>;
606
- type TransferRunesParams = v.InferOutput<typeof runesTransferParamsSchema>;
607
- declare const runesTransferResultSchema: v.ObjectSchema<{
608
- readonly txid: v.StringSchema<undefined>;
388
+ declare function getProviderOrThrow(getProvider?: () => Promise<BitcoinProvider | undefined>): Promise<BitcoinProvider>;
389
+ declare function getProviders(): Provider[];
390
+ declare function getProviderById(providerId: string): any;
391
+ declare function isProviderInstalled(providerId: string): boolean;
392
+ declare function setDefaultProvider(providerId: string): void;
393
+ declare function getDefaultProvider(): string | null;
394
+ declare function removeDefaultProvider(): void;
395
+ declare function getSupportedWallets(): SupportedWallet[];
396
+
397
+ declare enum ProviderPlatform {
398
+ Web = "web",
399
+ Mobile = "mobile"
400
+ }
401
+ declare const getInfoMethodName = "getInfo";
402
+ declare const getInfoParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
403
+ type GetInfoParams = v.InferOutput<typeof getInfoParamsSchema>;
404
+ declare const getInfoResultSchema: v.ObjectSchema<{
405
+ /**
406
+ * Version of the wallet.
407
+ */
408
+ readonly version: v.StringSchema<undefined>;
409
+ /**
410
+ * The platform the wallet is running on (web or mobile).
411
+ */
412
+ readonly platform: v.OptionalSchema<v.EnumSchema<typeof ProviderPlatform, undefined>, undefined>;
413
+ /**
414
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
415
+ */
416
+ readonly methods: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
417
+ /**
418
+ * List of WBIP standards supported by the wallet. Not currently used.
419
+ */
420
+ readonly supports: v.ArraySchema<v.StringSchema<undefined>, undefined>;
609
421
  }, undefined>;
610
- type RunesTransferResult = v.InferOutput<typeof runesTransferResultSchema>;
611
- declare const runesTransferRequestMessageSchema: v.ObjectSchema<{
612
- readonly method: v.LiteralSchema<"runes_transfer", undefined>;
613
- readonly params: v.ObjectSchema<{
614
- readonly recipients: v.ArraySchema<v.ObjectSchema<{
615
- readonly runeName: v.StringSchema<undefined>;
616
- readonly amount: v.StringSchema<undefined>;
617
- readonly address: v.StringSchema<undefined>;
618
- }, undefined>, undefined>;
619
- }, undefined>;
422
+ type GetInfoResult = v.InferOutput<typeof getInfoResultSchema>;
423
+ declare const getInfoRequestMessageSchema: v.ObjectSchema<{
424
+ readonly method: v.LiteralSchema<"getInfo", undefined>;
425
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
620
426
  readonly id: v.StringSchema<undefined>;
621
427
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
622
428
  }, undefined>;
623
- type RunesTransferRequestMessage = v.InferOutput<typeof runesTransferRequestMessageSchema>;
624
- type RunesTransfer = MethodParamsAndResult<TransferRunesParams, RunesTransferResult>;
625
-
626
- declare const sparkGetAddressesMethodName = "spark_getAddresses";
627
- declare const sparkGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
429
+ type GetInfoRequestMessage = v.InferOutput<typeof getInfoRequestMessageSchema>;
430
+ type GetInfo = MethodParamsAndResult<v.InferOutput<typeof getInfoParamsSchema>, v.InferOutput<typeof getInfoResultSchema>>;
431
+ declare const getAddressesMethodName = "getAddresses";
432
+ declare const getAddressesParamsSchema: v.ObjectSchema<{
433
+ /**
434
+ * The purposes for which to generate addresses. See
435
+ * {@linkcode AddressPurpose} for available purposes.
436
+ */
437
+ readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
628
438
  /**
629
439
  * A message to be displayed to the user in the request prompt.
630
440
  */
631
441
  readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
632
- }, undefined>, undefined>;
633
- type SparkGetAddressesParams = v.InferOutput<typeof sparkGetAddressesParamsSchema>;
634
- declare const sparkGetAddressesResultSchema: v.ObjectSchema<{
442
+ }, undefined>;
443
+ type GetAddressesParams = v.InferOutput<typeof getAddressesParamsSchema>;
444
+ declare const getAddressesResultSchema: v.ObjectSchema<{
635
445
  /**
636
446
  * The addresses generated for the given purposes.
637
447
  */
@@ -654,901 +464,899 @@ declare const sparkGetAddressesResultSchema: v.ObjectSchema<{
654
464
  }, undefined>;
655
465
  }, undefined>;
656
466
  }, undefined>;
657
- type SparkGetAddressesResult = v.InferOutput<typeof sparkGetAddressesResultSchema>;
658
- declare const sparkGetAddressesRequestMessageSchema: v.ObjectSchema<{
659
- readonly method: v.LiteralSchema<"spark_getAddresses", undefined>;
660
- readonly params: v.NullishSchema<v.ObjectSchema<{
467
+ type GetAddressesResult = v.InferOutput<typeof getAddressesResultSchema>;
468
+ declare const getAddressesRequestMessageSchema: v.ObjectSchema<{
469
+ readonly method: v.LiteralSchema<"getAddresses", undefined>;
470
+ readonly params: v.ObjectSchema<{
471
+ /**
472
+ * The purposes for which to generate addresses. See
473
+ * {@linkcode AddressPurpose} for available purposes.
474
+ */
475
+ readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
661
476
  /**
662
477
  * A message to be displayed to the user in the request prompt.
663
478
  */
664
479
  readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
665
- }, undefined>, undefined>;
480
+ }, undefined>;
666
481
  readonly id: v.StringSchema<undefined>;
667
482
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
668
483
  }, undefined>;
669
- type SparkGetAddressesRequestMessage = v.InferOutput<typeof sparkGetAddressesRequestMessageSchema>;
670
- type SparkGetAddresses = MethodParamsAndResult<v.InferOutput<typeof sparkGetAddressesParamsSchema>, v.InferOutput<typeof sparkGetAddressesResultSchema>>;
671
-
672
- declare const sparkGetBalanceMethodName = "spark_getBalance";
673
- declare const sparkGetBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
674
- type SparkGetBalanceParams = v.InferOutput<typeof sparkGetBalanceParamsSchema>;
675
- declare const sparkGetBalanceResultSchema: v.ObjectSchema<{
484
+ type GetAddressesRequestMessage = v.InferOutput<typeof getAddressesRequestMessageSchema>;
485
+ type GetAddresses = MethodParamsAndResult<v.InferOutput<typeof getAddressesParamsSchema>, v.InferOutput<typeof getAddressesResultSchema>>;
486
+ declare const signMessageMethodName = "signMessage";
487
+ declare enum MessageSigningProtocols {
488
+ ECDSA = "ECDSA",
489
+ BIP322 = "BIP322"
490
+ }
491
+ declare const signMessageParamsSchema: v.ObjectSchema<{
676
492
  /**
677
- * The Spark Bitcoin address balance in sats in string form.
493
+ * The address used for signing.
494
+ **/
495
+ readonly address: v.StringSchema<undefined>;
496
+ /**
497
+ * The message to sign.
498
+ **/
499
+ readonly message: v.StringSchema<undefined>;
500
+ /**
501
+ * The protocol to use for signing the message.
678
502
  */
679
- readonly balance: v.StringSchema<undefined>;
680
- readonly tokenBalances: v.ArraySchema<v.ObjectSchema<{
681
- readonly balance: v.StringSchema<undefined>;
682
- readonly tokenMetadata: v.ObjectSchema<{
683
- readonly tokenIdentifier: v.StringSchema<undefined>;
684
- readonly tokenName: v.StringSchema<undefined>;
685
- readonly tokenTicker: v.StringSchema<undefined>;
686
- readonly decimals: v.NumberSchema<undefined>;
687
- readonly maxSupply: v.StringSchema<undefined>;
688
- }, undefined>;
689
- }, undefined>, undefined>;
690
- }, undefined>;
691
- type SparkGetBalanceResult = v.InferOutput<typeof sparkGetBalanceResultSchema>;
692
- declare const sparkGetBalanceRequestMessageSchema: v.ObjectSchema<{
693
- readonly method: v.LiteralSchema<"spark_getBalance", undefined>;
694
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
695
- readonly id: v.StringSchema<undefined>;
696
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
503
+ readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, undefined>;
697
504
  }, undefined>;
698
- type SparkGetBalanceRequestMessage = v.InferOutput<typeof sparkGetBalanceRequestMessageSchema>;
699
- type SparkGetBalance = MethodParamsAndResult<SparkGetBalanceParams, SparkGetBalanceResult>;
700
-
701
- declare const sparkTransferMethodName = "spark_transfer";
702
- declare const sparkTransferParamsSchema: v.ObjectSchema<{
505
+ type SignMessageParams = v.InferOutput<typeof signMessageParamsSchema>;
506
+ declare const signMessageResultSchema: v.ObjectSchema<{
703
507
  /**
704
- * Amount of SATS to transfer as a string or number.
508
+ * The signature of the message.
705
509
  */
706
- readonly amountSats: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
510
+ readonly signature: v.StringSchema<undefined>;
707
511
  /**
708
- * The recipient's spark address.
512
+ * hash of the message.
709
513
  */
710
- readonly receiverSparkAddress: v.StringSchema<undefined>;
711
- }, undefined>;
712
- type SparkTransferParams = v.InferOutput<typeof sparkTransferParamsSchema>;
713
- declare const sparkTransferResultSchema: v.ObjectSchema<{
514
+ readonly messageHash: v.StringSchema<undefined>;
714
515
  /**
715
- * The ID of the transaction.
516
+ * The address used for signing.
716
517
  */
717
- readonly id: v.StringSchema<undefined>;
518
+ readonly address: v.StringSchema<undefined>;
519
+ /**
520
+ * The protocol to use for signing the message.
521
+ */
522
+ readonly protocol: v.EnumSchema<typeof MessageSigningProtocols, undefined>;
718
523
  }, undefined>;
719
- type SparkTransferResult = v.InferOutput<typeof sparkTransferResultSchema>;
720
- declare const sparkTransferRequestMessageSchema: v.ObjectSchema<{
721
- readonly method: v.LiteralSchema<"spark_transfer", undefined>;
524
+ type SignMessageResult = v.InferOutput<typeof signMessageResultSchema>;
525
+ declare const signMessageRequestMessageSchema: v.ObjectSchema<{
526
+ readonly method: v.LiteralSchema<"signMessage", undefined>;
722
527
  readonly params: v.ObjectSchema<{
723
528
  /**
724
- * Amount of SATS to transfer as a string or number.
725
- */
726
- readonly amountSats: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
529
+ * The address used for signing.
530
+ **/
531
+ readonly address: v.StringSchema<undefined>;
727
532
  /**
728
- * The recipient's spark address.
533
+ * The message to sign.
534
+ **/
535
+ readonly message: v.StringSchema<undefined>;
536
+ /**
537
+ * The protocol to use for signing the message.
729
538
  */
730
- readonly receiverSparkAddress: v.StringSchema<undefined>;
539
+ readonly protocol: v.OptionalSchema<v.EnumSchema<typeof MessageSigningProtocols, undefined>, undefined>;
731
540
  }, undefined>;
732
541
  readonly id: v.StringSchema<undefined>;
733
542
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
734
543
  }, undefined>;
735
- type SparkTransferRequestMessage = v.InferOutput<typeof sparkTransferRequestMessageSchema>;
736
- type SparkTransfer = MethodParamsAndResult<SparkTransferParams, SparkTransferResult>;
737
-
738
- declare const sparkTransferTokenMethodName = "spark_transferToken";
739
- declare const sparkTransferTokenParamsSchema: v.ObjectSchema<{
740
- /**
741
- * Amount of units of the token to transfer as a string or number.
742
- */
743
- readonly tokenAmount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
744
- /**
745
- * The Bech32m token identifier.
746
- */
747
- readonly tokenIdentifier: v.StringSchema<undefined>;
544
+ type SignMessageRequestMessage = v.InferOutput<typeof signMessageRequestMessageSchema>;
545
+ type SignMessage = MethodParamsAndResult<v.InferOutput<typeof signMessageParamsSchema>, v.InferOutput<typeof signMessageResultSchema>>;
546
+ declare const sendTransferMethodName = "sendTransfer";
547
+ declare const sendTransferParamsSchema: v.ObjectSchema<{
748
548
  /**
749
- * The recipient's spark address.
549
+ * Array of recipients to send to.
550
+ * The amount to send to each recipient is in satoshis.
750
551
  */
751
- readonly receiverSparkAddress: v.StringSchema<undefined>;
552
+ readonly recipients: v.ArraySchema<v.ObjectSchema<{
553
+ readonly address: v.StringSchema<undefined>;
554
+ readonly amount: v.NumberSchema<undefined>;
555
+ }, undefined>, undefined>;
752
556
  }, undefined>;
753
- type SparkTransferTokenParams = v.InferOutput<typeof sparkTransferTokenParamsSchema>;
754
- declare const sparkTransferTokenResultSchema: v.ObjectSchema<{
557
+ type SendTransferParams = v.InferOutput<typeof sendTransferParamsSchema>;
558
+ declare const sendTransferResultSchema: v.ObjectSchema<{
755
559
  /**
756
- * The ID of the transaction.
560
+ * The transaction id as a hex-encoded string.
757
561
  */
758
- readonly id: v.StringSchema<undefined>;
562
+ readonly txid: v.StringSchema<undefined>;
759
563
  }, undefined>;
760
- type SparkTransferTokenResult = v.InferOutput<typeof sparkTransferTokenResultSchema>;
761
- declare const sparkTransferTokenRequestMessageSchema: v.ObjectSchema<{
762
- readonly method: v.LiteralSchema<"spark_transferToken", undefined>;
564
+ type SendTransferResult = v.InferOutput<typeof sendTransferResultSchema>;
565
+ declare const sendTransferRequestMessageSchema: v.ObjectSchema<{
566
+ readonly method: v.LiteralSchema<"sendTransfer", undefined>;
763
567
  readonly params: v.ObjectSchema<{
764
568
  /**
765
- * Amount of units of the token to transfer as a string or number.
766
- */
767
- readonly tokenAmount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
768
- /**
769
- * The Bech32m token identifier.
770
- */
771
- readonly tokenIdentifier: v.StringSchema<undefined>;
772
- /**
773
- * The recipient's spark address.
569
+ * Array of recipients to send to.
570
+ * The amount to send to each recipient is in satoshis.
774
571
  */
775
- readonly receiverSparkAddress: v.StringSchema<undefined>;
572
+ readonly recipients: v.ArraySchema<v.ObjectSchema<{
573
+ readonly address: v.StringSchema<undefined>;
574
+ readonly amount: v.NumberSchema<undefined>;
575
+ }, undefined>, undefined>;
776
576
  }, undefined>;
777
577
  readonly id: v.StringSchema<undefined>;
778
578
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
779
579
  }, undefined>;
780
- type SparkTransferTokenRequestMessage = v.InferOutput<typeof sparkTransferTokenRequestMessageSchema>;
781
- type SparkTransferToken = MethodParamsAndResult<SparkTransferTokenParams, SparkTransferTokenResult>;
782
-
783
- declare const stxCallContractMethodName = "stx_callContract";
784
- declare const stxCallContractParamsSchema: v.ObjectSchema<{
785
- /**
786
- * The contract principal.
787
- *
788
- * E.g. `"SPKE...GD5C.my-contract"`
789
- */
790
- readonly contract: v.StringSchema<undefined>;
791
- /**
792
- * The name of the function to call.
793
- *
794
- * Note: spec changes ongoing,
795
- * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
796
- */
797
- readonly functionName: v.StringSchema<undefined>;
798
- /**
799
- * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
800
- */
801
- readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
580
+ type SendTransferRequestMessage = v.InferOutput<typeof sendTransferRequestMessageSchema>;
581
+ type SendTransfer = MethodParamsAndResult<SendTransferParams, SendTransferResult>;
582
+ declare const signPsbtMethodName = "signPsbt";
583
+ declare const signPsbtParamsSchema: v.ObjectSchema<{
802
584
  /**
803
- * The function's arguments. The arguments are expected to be hex-encoded
804
- * strings of Clarity values.
805
- *
806
- * To convert Clarity values to their hex representation, the `cvToHex`
807
- * helper from the `@stacks/transactions` package may be helpful.
808
- *
809
- * ```js
810
- * import { cvToHex } from '@stacks/transactions';
811
- *
812
- * const functionArgs = [someClarityValue1, someClarityValue2];
813
- * const hexArgs = functionArgs.map(cvToHex);
814
- * ```
585
+ * The base64 encoded PSBT to sign.
815
586
  */
816
- readonly functionArgs: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
587
+ readonly psbt: v.StringSchema<undefined>;
817
588
  /**
818
- * The post conditions to apply to the contract call.
589
+ * The inputs to sign.
590
+ * The key is the address and the value is an array of indexes of the inputs to sign.
819
591
  */
820
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
592
+ readonly signInputs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>, undefined>;
821
593
  /**
822
- * The mode to apply to the post conditions.
823
- */
824
- readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
594
+ * Whether to broadcast the transaction after signing.
595
+ **/
596
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
825
597
  }, undefined>;
826
- type StxCallContractParams = v.InferOutput<typeof stxCallContractParamsSchema>;
827
- declare const stxCallContractResultSchema: v.ObjectSchema<{
598
+ type SignPsbtParams = v.InferOutput<typeof signPsbtParamsSchema>;
599
+ declare const signPsbtResultSchema: v.ObjectSchema<{
828
600
  /**
829
- * The ID of the transaction.
601
+ * The base64 encoded PSBT after signing.
830
602
  */
831
- readonly txid: v.StringSchema<undefined>;
603
+ readonly psbt: v.StringSchema<undefined>;
832
604
  /**
833
- * A Stacks transaction as a hex-encoded string.
834
- */
835
- readonly transaction: v.StringSchema<undefined>;
605
+ * The transaction id as a hex-encoded string.
606
+ * This is only returned if the transaction was broadcast.
607
+ **/
608
+ readonly txid: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
836
609
  }, undefined>;
837
- type StxCallContractResult = v.InferOutput<typeof stxCallContractResultSchema>;
838
- declare const stxCallContractRequestMessageSchema: v.ObjectSchema<{
839
- readonly method: v.LiteralSchema<"stx_callContract", undefined>;
610
+ type SignPsbtResult = v.InferOutput<typeof signPsbtResultSchema>;
611
+ declare const signPsbtRequestMessageSchema: v.ObjectSchema<{
612
+ readonly method: v.LiteralSchema<"signPsbt", undefined>;
840
613
  readonly params: v.ObjectSchema<{
841
614
  /**
842
- * The contract principal.
843
- *
844
- * E.g. `"SPKE...GD5C.my-contract"`
845
- */
846
- readonly contract: v.StringSchema<undefined>;
847
- /**
848
- * The name of the function to call.
849
- *
850
- * Note: spec changes ongoing,
851
- * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
852
- */
853
- readonly functionName: v.StringSchema<undefined>;
854
- /**
855
- * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
856
- */
857
- readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
858
- /**
859
- * The function's arguments. The arguments are expected to be hex-encoded
860
- * strings of Clarity values.
861
- *
862
- * To convert Clarity values to their hex representation, the `cvToHex`
863
- * helper from the `@stacks/transactions` package may be helpful.
864
- *
865
- * ```js
866
- * import { cvToHex } from '@stacks/transactions';
867
- *
868
- * const functionArgs = [someClarityValue1, someClarityValue2];
869
- * const hexArgs = functionArgs.map(cvToHex);
870
- * ```
615
+ * The base64 encoded PSBT to sign.
871
616
  */
872
- readonly functionArgs: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
617
+ readonly psbt: v.StringSchema<undefined>;
873
618
  /**
874
- * The post conditions to apply to the contract call.
619
+ * The inputs to sign.
620
+ * The key is the address and the value is an array of indexes of the inputs to sign.
875
621
  */
876
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
622
+ readonly signInputs: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.ArraySchema<v.NumberSchema<undefined>, undefined>, undefined>, undefined>;
877
623
  /**
878
- * The mode to apply to the post conditions.
879
- */
880
- readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
624
+ * Whether to broadcast the transaction after signing.
625
+ **/
626
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
881
627
  }, undefined>;
882
628
  readonly id: v.StringSchema<undefined>;
883
629
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
884
630
  }, undefined>;
885
- type StxCallContractRequestMessage = v.InferOutput<typeof stxCallContractRequestMessageSchema>;
886
- type StxCallContract = MethodParamsAndResult<StxCallContractParams, StxCallContractResult>;
887
-
888
- declare const stxDeployContractMethodName = "stx_deployContract";
889
- declare const stxDeployContractParamsSchema: v.ObjectSchema<{
890
- /**
891
- * Name of the contract.
892
- */
893
- readonly name: v.StringSchema<undefined>;
894
- /**
895
- * The source code of the Clarity contract.
896
- */
897
- readonly clarityCode: v.StringSchema<undefined>;
898
- /**
899
- * The version of the Clarity contract.
900
- */
901
- readonly clarityVersion: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
631
+ type SignPsbtRequestMessage = v.InferOutput<typeof signPsbtRequestMessageSchema>;
632
+ type SignPsbt = MethodParamsAndResult<SignPsbtParams, SignPsbtResult>;
633
+ declare const getAccountsMethodName = "getAccounts";
634
+ declare const getAccountsParamsSchema: v.ObjectSchema<{
902
635
  /**
903
- * The post conditions to apply to the contract call.
636
+ * The purposes for which to generate addresses. See
637
+ * {@linkcode AddressPurpose} for available purposes.
904
638
  */
905
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
639
+ readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
906
640
  /**
907
- * The mode to apply to the post conditions.
641
+ * A message to be displayed to the user in the request prompt.
908
642
  */
909
- readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
643
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
910
644
  }, undefined>;
911
- type StxDeployContractParams = v.InferOutput<typeof stxDeployContractParamsSchema>;
912
- declare const stxDeployContractResultSchema: v.ObjectSchema<{
913
- /**
914
- * The ID of the transaction.
915
- */
916
- readonly txid: v.StringSchema<undefined>;
917
- /**
918
- * A Stacks transaction as a hex-encoded string.
919
- */
920
- readonly transaction: v.StringSchema<undefined>;
921
- }, undefined>;
922
- type StxDeployContractResult = v.InferOutput<typeof stxDeployContractResultSchema>;
923
- declare const stxDeployContractRequestMessageSchema: v.ObjectSchema<{
924
- readonly method: v.LiteralSchema<"stx_deployContract", undefined>;
645
+ type GetAccountsParams = v.InferOutput<typeof getAccountsParamsSchema>;
646
+ declare const getAccountsResultSchema: v.ArraySchema<v.ObjectSchema<{
647
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
648
+ readonly address: v.StringSchema<undefined>;
649
+ readonly publicKey: v.StringSchema<undefined>;
650
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
651
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
652
+ }, undefined>, undefined>;
653
+ type GetAccountsResult = v.InferOutput<typeof getAccountsResultSchema>;
654
+ declare const getAccountsRequestMessageSchema: v.ObjectSchema<{
655
+ readonly method: v.LiteralSchema<"getAccounts", undefined>;
925
656
  readonly params: v.ObjectSchema<{
926
657
  /**
927
- * Name of the contract.
928
- */
929
- readonly name: v.StringSchema<undefined>;
930
- /**
931
- * The source code of the Clarity contract.
932
- */
933
- readonly clarityCode: v.StringSchema<undefined>;
934
- /**
935
- * The version of the Clarity contract.
936
- */
937
- readonly clarityVersion: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
938
- /**
939
- * The post conditions to apply to the contract call.
658
+ * The purposes for which to generate addresses. See
659
+ * {@linkcode AddressPurpose} for available purposes.
940
660
  */
941
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
661
+ readonly purposes: v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>;
942
662
  /**
943
- * The mode to apply to the post conditions.
663
+ * A message to be displayed to the user in the request prompt.
944
664
  */
945
- readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
665
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
946
666
  }, undefined>;
947
667
  readonly id: v.StringSchema<undefined>;
948
668
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
949
669
  }, undefined>;
950
- type StxDeployContractRequestMessage = v.InferOutput<typeof stxDeployContractRequestMessageSchema>;
951
- type StxDeployContract = MethodParamsAndResult<StxDeployContractParams, StxDeployContractResult>;
952
-
953
- declare const stxGetAccountsMethodName = "stx_getAccounts";
954
- declare const stxGetAccountsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
955
- type StxGetAccountsParams = v.InferOutput<typeof stxGetAccountsParamsSchema>;
956
- declare const stxGetAccountsResultSchema: v.ObjectSchema<{
670
+ type GetAccountsRequestMessage = v.InferOutput<typeof getAccountsRequestMessageSchema>;
671
+ type GetAccounts = MethodParamsAndResult<v.InferOutput<typeof getAccountsParamsSchema>, v.InferOutput<typeof getAccountsResultSchema>>;
672
+ declare const getBalanceMethodName = "getBalance";
673
+ declare const getBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
674
+ type GetBalanceParams = v.InferOutput<typeof getBalanceParamsSchema>;
675
+ declare const getBalanceResultSchema: v.ObjectSchema<{
957
676
  /**
958
- * The addresses generated for the given purposes.
677
+ * The confirmed balance of the wallet in sats. Using a string due to chrome
678
+ * messages not supporting bigint
679
+ * (https://issues.chromium.org/issues/40116184).
959
680
  */
960
- readonly addresses: v.ArraySchema<v.ObjectSchema<{
961
- readonly address: v.StringSchema<undefined>;
962
- readonly publicKey: v.StringSchema<undefined>;
963
- readonly gaiaHubUrl: v.StringSchema<undefined>;
964
- readonly gaiaAppKey: v.StringSchema<undefined>;
965
- }, undefined>, undefined>;
966
- readonly network: v.ObjectSchema<{
967
- readonly bitcoin: v.ObjectSchema<{
968
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
969
- }, undefined>;
970
- readonly stacks: v.ObjectSchema<{
971
- readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
972
- }, undefined>;
973
- readonly spark: v.ObjectSchema<{
974
- readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
975
- }, undefined>;
976
- }, undefined>;
977
- }, undefined>;
978
- type StxGetAccountsResult = v.InferOutput<typeof stxGetAccountsResultSchema>;
979
- declare const stxGetAccountsRequestMessageSchema: v.ObjectSchema<{
980
- readonly method: v.LiteralSchema<"stx_getAccounts", undefined>;
981
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
982
- readonly id: v.StringSchema<undefined>;
983
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
984
- }, undefined>;
985
- type StxGetAccountsRequestMessage = v.InferOutput<typeof stxGetAccountsRequestMessageSchema>;
986
- type StxGetAccounts = MethodParamsAndResult<StxGetAccountsParams, StxGetAccountsResult>;
987
-
988
- declare const stxGetAddressesMethodName = "stx_getAddresses";
989
- declare const stxGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
681
+ readonly confirmed: v.StringSchema<undefined>;
990
682
  /**
991
- * A message to be displayed to the user in the request prompt.
683
+ * The unconfirmed balance of the wallet in sats. Using a string due to chrome
684
+ * messages not supporting bigint
685
+ * (https://issues.chromium.org/issues/40116184).
992
686
  */
993
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
994
- }, undefined>, undefined>;
995
- type StxGetAddressesParams = v.InferOutput<typeof stxGetAddressesParamsSchema>;
996
- declare const stxGetAddressesResultSchema: v.ObjectSchema<{
687
+ readonly unconfirmed: v.StringSchema<undefined>;
997
688
  /**
998
- * The addresses generated for the given purposes.
689
+ * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
690
+ * sats. Using a string due to chrome messages not supporting bigint
691
+ * (https://issues.chromium.org/issues/40116184).
999
692
  */
1000
- readonly addresses: v.ArraySchema<v.ObjectSchema<{
1001
- readonly address: v.StringSchema<undefined>;
1002
- readonly publicKey: v.StringSchema<undefined>;
1003
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1004
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1005
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1006
- }, undefined>, undefined>;
1007
- readonly network: v.ObjectSchema<{
1008
- readonly bitcoin: v.ObjectSchema<{
1009
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1010
- }, undefined>;
1011
- readonly stacks: v.ObjectSchema<{
1012
- readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
1013
- }, undefined>;
1014
- readonly spark: v.ObjectSchema<{
1015
- readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
1016
- }, undefined>;
1017
- }, undefined>;
693
+ readonly total: v.StringSchema<undefined>;
1018
694
  }, undefined>;
1019
- type StxGetAddressesResult = v.InferOutput<typeof stxGetAddressesResultSchema>;
1020
- declare const stxGetAddressesRequestMessageSchema: v.ObjectSchema<{
1021
- readonly method: v.LiteralSchema<"stx_getAddresses", undefined>;
1022
- readonly params: v.NullishSchema<v.ObjectSchema<{
1023
- /**
1024
- * A message to be displayed to the user in the request prompt.
1025
- */
1026
- readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1027
- }, undefined>, undefined>;
695
+ type GetBalanceResult = v.InferOutput<typeof getBalanceResultSchema>;
696
+ declare const getBalanceRequestMessageSchema: v.ObjectSchema<{
697
+ readonly method: v.LiteralSchema<"getBalance", undefined>;
1028
698
  readonly id: v.StringSchema<undefined>;
1029
699
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
700
+ readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1030
701
  }, undefined>;
1031
- type StxGetAddressesRequestMessage = v.InferOutput<typeof stxGetAddressesRequestMessageSchema>;
1032
- type StxGetAddresses = MethodParamsAndResult<v.InferOutput<typeof stxGetAddressesParamsSchema>, v.InferOutput<typeof stxGetAddressesResultSchema>>;
702
+ type GetBalanceRequestMessage = v.InferOutput<typeof getBalanceRequestMessageSchema>;
703
+ type GetBalance = MethodParamsAndResult<GetBalanceParams, GetBalanceResult>;
1033
704
 
1034
- declare const stxSignMessageMethodName = "stx_signMessage";
1035
- declare const stxSignMessageParamsSchema: v.ObjectSchema<{
1036
- /**
1037
- * The message to sign.
1038
- */
1039
- readonly message: v.StringSchema<undefined>;
705
+ declare const getInscriptionsMethodName = "ord_getInscriptions";
706
+ declare const getInscriptionsParamsSchema: v.ObjectSchema<{
707
+ readonly offset: v.NumberSchema<undefined>;
708
+ readonly limit: v.NumberSchema<undefined>;
1040
709
  }, undefined>;
1041
- type StxSignMessageParams = v.InferOutput<typeof stxSignMessageParamsSchema>;
1042
- declare const stxSignMessageResultSchema: v.ObjectSchema<{
1043
- /**
1044
- * The signature of the message.
1045
- */
1046
- readonly signature: v.StringSchema<undefined>;
1047
- /**
1048
- * The public key used to sign the message.
1049
- */
1050
- readonly publicKey: v.StringSchema<undefined>;
710
+ type GetInscriptionsParams = v.InferOutput<typeof getInscriptionsParamsSchema>;
711
+ declare const getInscriptionsResultSchema: v.ObjectSchema<{
712
+ readonly total: v.NumberSchema<undefined>;
713
+ readonly limit: v.NumberSchema<undefined>;
714
+ readonly offset: v.NumberSchema<undefined>;
715
+ readonly inscriptions: v.ArraySchema<v.ObjectSchema<{
716
+ readonly inscriptionId: v.StringSchema<undefined>;
717
+ readonly inscriptionNumber: v.StringSchema<undefined>;
718
+ readonly address: v.StringSchema<undefined>;
719
+ readonly collectionName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
720
+ readonly postage: v.StringSchema<undefined>;
721
+ readonly contentLength: v.StringSchema<undefined>;
722
+ readonly contentType: v.StringSchema<undefined>;
723
+ readonly timestamp: v.NumberSchema<undefined>;
724
+ readonly offset: v.NumberSchema<undefined>;
725
+ readonly genesisTransaction: v.StringSchema<undefined>;
726
+ readonly output: v.StringSchema<undefined>;
727
+ }, undefined>, undefined>;
1051
728
  }, undefined>;
1052
- type StxSignMessageResult = v.InferOutput<typeof stxSignMessageResultSchema>;
1053
- declare const stxSignMessageRequestMessageSchema: v.ObjectSchema<{
1054
- readonly method: v.LiteralSchema<"stx_signMessage", undefined>;
729
+ type GetInscriptionsResult = v.InferOutput<typeof getInscriptionsResultSchema>;
730
+ declare const getInscriptionsRequestMessageSchema: v.ObjectSchema<{
731
+ readonly method: v.LiteralSchema<"ord_getInscriptions", undefined>;
1055
732
  readonly params: v.ObjectSchema<{
1056
- /**
1057
- * The message to sign.
1058
- */
1059
- readonly message: v.StringSchema<undefined>;
733
+ readonly offset: v.NumberSchema<undefined>;
734
+ readonly limit: v.NumberSchema<undefined>;
1060
735
  }, undefined>;
1061
736
  readonly id: v.StringSchema<undefined>;
1062
737
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1063
738
  }, undefined>;
1064
- type StxSignMessageRequestMessage = v.InferOutput<typeof stxSignMessageRequestMessageSchema>;
1065
- type StxSignMessage = MethodParamsAndResult<StxSignMessageParams, StxSignMessageResult>;
1066
-
1067
- declare const stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1068
- declare const stxSignStructuredMessageParamsSchema: v.ObjectSchema<{
1069
- /**
1070
- * The domain to be signed.
1071
- */
1072
- readonly domain: v.StringSchema<undefined>;
1073
- /**
1074
- * Message payload to be signed.
1075
- */
1076
- readonly message: v.StringSchema<undefined>;
1077
- /**
1078
- * The public key to sign the message with.
1079
- */
1080
- readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
739
+ type GetInscriptionsRequestMessage = v.InferOutput<typeof getInscriptionsRequestMessageSchema>;
740
+ type GetInscriptions = MethodParamsAndResult<GetInscriptionsParams, GetInscriptionsResult>;
741
+ declare const sendInscriptionsMethodName = "ord_sendInscriptions";
742
+ declare const sendInscriptionsParamsSchema: v.ObjectSchema<{
743
+ readonly transfers: v.ArraySchema<v.ObjectSchema<{
744
+ readonly address: v.StringSchema<undefined>;
745
+ readonly inscriptionId: v.StringSchema<undefined>;
746
+ }, undefined>, undefined>;
1081
747
  }, undefined>;
1082
- type StxSignStructuredMessageParams = v.InferOutput<typeof stxSignStructuredMessageParamsSchema>;
1083
- declare const stxSignStructuredMessageResultSchema: v.ObjectSchema<{
1084
- /**
1085
- * Signature of the message.
1086
- */
1087
- readonly signature: v.StringSchema<undefined>;
1088
- /**
1089
- * Public key as hex-encoded string.
1090
- */
1091
- readonly publicKey: v.StringSchema<undefined>;
748
+ type SendInscriptionsParams = v.InferOutput<typeof sendInscriptionsParamsSchema>;
749
+ declare const sendInscriptionsResultSchema: v.ObjectSchema<{
750
+ readonly txid: v.StringSchema<undefined>;
1092
751
  }, undefined>;
1093
- type StxSignStructuredMessageResult = v.InferOutput<typeof stxSignStructuredMessageResultSchema>;
1094
- declare const stxSignStructuredMessageRequestMessageSchema: v.ObjectSchema<{
1095
- readonly method: v.LiteralSchema<"stx_signStructuredMessage", undefined>;
752
+ type SendInscriptionsResult = v.InferOutput<typeof sendInscriptionsResultSchema>;
753
+ declare const sendInscriptionsRequestMessageSchema: v.ObjectSchema<{
754
+ readonly method: v.LiteralSchema<"ord_sendInscriptions", undefined>;
1096
755
  readonly params: v.ObjectSchema<{
1097
- /**
1098
- * The domain to be signed.
1099
- */
1100
- readonly domain: v.StringSchema<undefined>;
1101
- /**
1102
- * Message payload to be signed.
1103
- */
1104
- readonly message: v.StringSchema<undefined>;
1105
- /**
1106
- * The public key to sign the message with.
1107
- */
1108
- readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
756
+ readonly transfers: v.ArraySchema<v.ObjectSchema<{
757
+ readonly address: v.StringSchema<undefined>;
758
+ readonly inscriptionId: v.StringSchema<undefined>;
759
+ }, undefined>, undefined>;
1109
760
  }, undefined>;
1110
761
  readonly id: v.StringSchema<undefined>;
1111
762
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1112
763
  }, undefined>;
1113
- type StxSignStructuredMessageRequestMessage = v.InferOutput<typeof stxSignStructuredMessageRequestMessageSchema>;
1114
- type StxSignStructuredMessage = MethodParamsAndResult<StxSignStructuredMessageParams, StxSignStructuredMessageResult>;
764
+ type SendInscriptionsRequestMessage = v.InferOutput<typeof sendInscriptionsRequestMessageSchema>;
765
+ type SendInscriptions = MethodParamsAndResult<SendInscriptionsParams, SendInscriptionsResult>;
1115
766
 
1116
- declare const stxSignTransactionMethodName = "stx_signTransaction";
1117
- declare const stxSignTransactionParamsSchema: v.ObjectSchema<{
1118
- /**
1119
- * The transaction to sign as a hex-encoded string.
1120
- */
1121
- readonly transaction: v.StringSchema<undefined>;
1122
- /**
1123
- * The public key to sign the transaction with. The wallet may use any key
1124
- * when not provided.
1125
- */
1126
- readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1127
- /**
1128
- * Whether to broadcast the transaction after signing. Defaults to `true`.
1129
- */
1130
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
767
+ type CreateMintOrderRequest = {
768
+ runeName: string;
769
+ repeats: number;
770
+ refundAddress: string;
771
+ destinationAddress: string;
772
+ feeRate: number;
773
+ appServiceFee?: number;
774
+ appServiceFeeAddress?: string;
775
+ };
776
+ type EstimateMintOrderRequest = Omit<CreateMintOrderRequest, 'refundAddress'>;
777
+ type EstimateOrderResponse = {
778
+ totalSize: number;
779
+ totalCost: number;
780
+ costBreakdown: {
781
+ postage: number;
782
+ networkFee: number;
783
+ serviceFee: number;
784
+ appServiceFee: number;
785
+ };
786
+ };
787
+ type CreateEtchOrderRequest = {
788
+ runeName: string;
789
+ divisibility?: number;
790
+ symbol?: string;
791
+ premine?: string;
792
+ isMintable: boolean;
793
+ terms?: {
794
+ amount?: string;
795
+ cap?: string;
796
+ heightStart?: string;
797
+ heightEnd?: string;
798
+ offsetStart?: string;
799
+ offsetEnd?: string;
800
+ };
801
+ inscriptionDetails?: {
802
+ contentType: string;
803
+ contentBase64: string;
804
+ };
805
+ delegateInscriptionId?: string;
806
+ destinationAddress: string;
807
+ refundAddress: string;
808
+ feeRate: number;
809
+ appServiceFee?: number;
810
+ appServiceFeeAddress?: string;
811
+ };
812
+ type EstimateEtchOrderRequest = Omit<CreateEtchOrderRequest, 'refundAddress'>;
813
+ type GetOrderRequest = {
814
+ id: string;
815
+ };
816
+ type GetOrderResponse = {
817
+ id: string;
818
+ orderType: 'rune_mint' | 'rune_etch';
819
+ state: 'new' | 'pending' | 'executing' | 'complete' | 'failed' | 'refunded' | 'stale';
820
+ fundingAddress: string;
821
+ reason?: string;
822
+ createdAt: string;
823
+ };
824
+ type RBFOrderRequest = {
825
+ orderId: string;
826
+ newFeeRate: number;
827
+ };
828
+ type RBFOrderResponse = {
829
+ rbfCost: number;
830
+ fundingAddress: string;
831
+ };
832
+
833
+ interface RunesEstimateEtchParams extends EstimateEtchOrderRequest {
834
+ network?: BitcoinNetworkType;
835
+ }
836
+ type RunesEstimateEtchResult = EstimateOrderResponse;
837
+ type RunesEstimateEtch = MethodParamsAndResult<RunesEstimateEtchParams, RunesEstimateEtchResult>;
838
+
839
+ interface runesEstimateMintParams extends EstimateMintOrderRequest {
840
+ network?: BitcoinNetworkType;
841
+ }
842
+ type runesEstimateMintResult = EstimateOrderResponse;
843
+ type RunesEstimateMint = MethodParamsAndResult<runesEstimateMintParams, runesEstimateMintResult>;
844
+
845
+ interface RunesEstimateRbfOrderParams extends RBFOrderRequest {
846
+ network?: BitcoinNetworkType;
847
+ }
848
+ type RunesEstimateRbfOrder = MethodParamsAndResult<RunesEstimateRbfOrderParams, RBFOrderResponse>;
849
+
850
+ declare const runesEtchMethodName = "runes_etch";
851
+ declare const runesEtchParamsSchema: v.ObjectSchema<{
852
+ readonly runeName: v.StringSchema<undefined>;
853
+ readonly divisibility: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
854
+ readonly symbol: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
855
+ readonly premine: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
856
+ readonly isMintable: v.BooleanSchema<undefined>;
857
+ readonly delegateInscriptionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
858
+ readonly destinationAddress: v.StringSchema<undefined>;
859
+ readonly refundAddress: v.StringSchema<undefined>;
860
+ readonly feeRate: v.NumberSchema<undefined>;
861
+ readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
862
+ readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
863
+ readonly terms: v.OptionalSchema<v.ObjectSchema<{
864
+ readonly amount: v.StringSchema<undefined>;
865
+ readonly cap: v.StringSchema<undefined>;
866
+ readonly heightStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
867
+ readonly heightEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
868
+ readonly offsetStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
869
+ readonly offsetEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
870
+ }, undefined>, undefined>;
871
+ readonly inscriptionDetails: v.OptionalSchema<v.ObjectSchema<{
872
+ readonly contentType: v.StringSchema<undefined>;
873
+ readonly contentBase64: v.StringSchema<undefined>;
874
+ }, undefined>, undefined>;
875
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
1131
876
  }, undefined>;
1132
- type StxSignTransactionParams = v.InferOutput<typeof stxSignTransactionParamsSchema>;
1133
- declare const stxSignTransactionResultSchema: v.ObjectSchema<{
1134
- /**
1135
- * The signed transaction as a hex-encoded string.
1136
- */
1137
- readonly transaction: v.StringSchema<undefined>;
877
+ type RunesEtchParams = v.InferOutput<typeof runesEtchParamsSchema>;
878
+ declare const runesEtchResultSchema: v.ObjectSchema<{
879
+ readonly orderId: v.StringSchema<undefined>;
880
+ readonly fundTransactionId: v.StringSchema<undefined>;
881
+ readonly fundingAddress: v.StringSchema<undefined>;
1138
882
  }, undefined>;
1139
- type StxSignTransactionResult = v.InferOutput<typeof stxSignTransactionResultSchema>;
1140
- declare const stxSignTransactionRequestMessageSchema: v.ObjectSchema<{
1141
- readonly method: v.LiteralSchema<"stx_signTransaction", undefined>;
883
+ type RunesEtchResult = v.InferOutput<typeof runesEtchResultSchema>;
884
+ declare const runesEtchRequestMessageSchema: v.ObjectSchema<{
885
+ readonly method: v.LiteralSchema<"runes_etch", undefined>;
1142
886
  readonly params: v.ObjectSchema<{
1143
- /**
1144
- * The transaction to sign as a hex-encoded string.
1145
- */
1146
- readonly transaction: v.StringSchema<undefined>;
1147
- /**
1148
- * The public key to sign the transaction with. The wallet may use any key
1149
- * when not provided.
1150
- */
1151
- readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1152
- /**
1153
- * Whether to broadcast the transaction after signing. Defaults to `true`.
1154
- */
1155
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
887
+ readonly runeName: v.StringSchema<undefined>;
888
+ readonly divisibility: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
889
+ readonly symbol: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
890
+ readonly premine: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
891
+ readonly isMintable: v.BooleanSchema<undefined>;
892
+ readonly delegateInscriptionId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
893
+ readonly destinationAddress: v.StringSchema<undefined>;
894
+ readonly refundAddress: v.StringSchema<undefined>;
895
+ readonly feeRate: v.NumberSchema<undefined>;
896
+ readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
897
+ readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
898
+ readonly terms: v.OptionalSchema<v.ObjectSchema<{
899
+ readonly amount: v.StringSchema<undefined>;
900
+ readonly cap: v.StringSchema<undefined>;
901
+ readonly heightStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
902
+ readonly heightEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
903
+ readonly offsetStart: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
904
+ readonly offsetEnd: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
905
+ }, undefined>, undefined>;
906
+ readonly inscriptionDetails: v.OptionalSchema<v.ObjectSchema<{
907
+ readonly contentType: v.StringSchema<undefined>;
908
+ readonly contentBase64: v.StringSchema<undefined>;
909
+ }, undefined>, undefined>;
910
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
1156
911
  }, undefined>;
1157
912
  readonly id: v.StringSchema<undefined>;
1158
913
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1159
914
  }, undefined>;
1160
- type StxSignTransactionRequestMessage = v.InferOutput<typeof stxSignTransactionRequestMessageSchema>;
1161
- type StxSignTransaction = MethodParamsAndResult<StxSignTransactionParams, StxSignTransactionResult>;
915
+ type RunesEtchRequestMessage = v.InferOutput<typeof runesEtchRequestMessageSchema>;
916
+ type RunesEtch = MethodParamsAndResult<v.InferOutput<typeof runesEtchParamsSchema>, v.InferOutput<typeof runesEtchResultSchema>>;
1162
917
 
1163
- declare const stxSignTransactionsMethodName = "stx_signTransactions";
1164
- declare const stxSignTransactionsParamsSchema: v.ObjectSchema<{
1165
- /**
1166
- * The transactions to sign as hex-encoded strings.
1167
- */
1168
- readonly transactions: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid hex-encoded Stacks transaction.">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
1169
- /**
1170
- * Whether the signed transactions should be broadcast after signing. Defaults
1171
- * to `true`.
1172
- */
1173
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1174
- }, undefined>;
1175
- type StxSignTransactionsParams = v.InferOutput<typeof stxSignTransactionsParamsSchema>;
1176
- declare const stxSignTransactionsResultSchema: v.ObjectSchema<{
1177
- /**
1178
- * The signed transactions as hex-encoded strings, in the same order as in the
1179
- * sign request.
1180
- */
1181
- readonly transactions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
918
+ declare const runesGetBalanceMethodName = "runes_getBalance";
919
+ declare const runesGetBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
920
+ type RunesGetBalanceParams = v.InferOutput<typeof runesGetBalanceParamsSchema>;
921
+ declare const runesGetBalanceResultSchema: v.ObjectSchema<{
922
+ readonly balances: v.ArraySchema<v.ObjectSchema<{
923
+ readonly runeName: v.StringSchema<undefined>;
924
+ readonly amount: v.StringSchema<undefined>;
925
+ readonly divisibility: v.NumberSchema<undefined>;
926
+ readonly symbol: v.StringSchema<undefined>;
927
+ readonly inscriptionId: v.NullishSchema<v.StringSchema<undefined>, undefined>;
928
+ readonly spendableBalance: v.StringSchema<undefined>;
929
+ }, undefined>, undefined>;
1182
930
  }, undefined>;
1183
- type StxSignTransactionsResult = v.InferOutput<typeof stxSignTransactionsResultSchema>;
1184
- declare const stxSignTransactionsRequestMessageSchema: v.ObjectSchema<{
1185
- readonly method: v.LiteralSchema<"stx_signTransactions", undefined>;
1186
- readonly params: v.ObjectSchema<{
1187
- /**
1188
- * The transactions to sign as hex-encoded strings.
1189
- */
1190
- readonly transactions: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid hex-encoded Stacks transaction.">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
1191
- /**
1192
- * Whether the signed transactions should be broadcast after signing. Defaults
1193
- * to `true`.
1194
- */
1195
- readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1196
- }, undefined>;
931
+ type RunesGetBalanceResult = v.InferOutput<typeof runesGetBalanceResultSchema>;
932
+ declare const runesGetBalanceRequestMessageSchema: v.ObjectSchema<{
933
+ readonly method: v.LiteralSchema<"runes_getBalance", undefined>;
934
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1197
935
  readonly id: v.StringSchema<undefined>;
1198
936
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1199
937
  }, undefined>;
1200
- type StxSignTransactionsRequestMessage = v.InferOutput<typeof stxSignTransactionsRequestMessageSchema>;
1201
- type StxSignTransactions = MethodParamsAndResult<StxSignTransactionsParams, StxSignTransactionsResult>;
938
+ type runesGetBalanceRequestMessage = v.InferOutput<typeof runesGetBalanceRequestMessageSchema>;
939
+ type RunesGetBalance = MethodParamsAndResult<RunesGetBalanceParams, RunesGetBalanceResult>;
1202
940
 
1203
- declare const stxTransferStxMethodName = "stx_transferStx";
1204
- declare const stxTransferStxParamsSchema: v.ObjectSchema<{
1205
- /**
1206
- * Amount of STX tokens to transfer in microstacks as a string. Anything
1207
- * parseable by `BigInt` is acceptable.
1208
- *
1209
- * Example,
1210
- *
1211
- * ```js
1212
- * const amount1 = 1234;
1213
- * const amount2 = 1234n;
1214
- * const amount3 = '1234';
1215
- * ```
1216
- */
1217
- readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1218
- /**
1219
- * The recipient's principal.
1220
- */
1221
- readonly recipient: v.StringSchema<undefined>;
1222
- /**
1223
- * A string representing the memo.
1224
- */
1225
- readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1226
- /**
1227
- * Version of parameter format.
1228
- */
1229
- readonly version: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1230
- /**
1231
- * The mode of the post conditions.
1232
- */
1233
- readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
941
+ interface RunesGetOrderParams extends GetOrderRequest {
942
+ network?: BitcoinNetworkType;
943
+ }
944
+ type RunesGetOrder = MethodParamsAndResult<RunesGetOrderParams, GetOrderResponse>;
945
+
946
+ declare const runesMintMethodName = "runes_mint";
947
+ declare const runesMintParamsSchema: v.ObjectSchema<{
948
+ readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
949
+ readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
950
+ readonly destinationAddress: v.StringSchema<undefined>;
951
+ readonly feeRate: v.NumberSchema<undefined>;
952
+ readonly refundAddress: v.StringSchema<undefined>;
953
+ readonly repeats: v.NumberSchema<undefined>;
954
+ readonly runeName: v.StringSchema<undefined>;
955
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
956
+ }, undefined>;
957
+ type RunesMintParams = v.InferOutput<typeof runesMintParamsSchema>;
958
+ declare const runesMintResultSchema: v.ObjectSchema<{
959
+ readonly orderId: v.StringSchema<undefined>;
960
+ readonly fundTransactionId: v.StringSchema<undefined>;
961
+ readonly fundingAddress: v.StringSchema<undefined>;
962
+ }, undefined>;
963
+ type RunesMintResult = v.InferOutput<typeof runesMintResultSchema>;
964
+ declare const runesMintRequestMessageSchema: v.ObjectSchema<{
965
+ readonly method: v.LiteralSchema<"runes_mint", undefined>;
966
+ readonly params: v.ObjectSchema<{
967
+ readonly appServiceFee: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
968
+ readonly appServiceFeeAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
969
+ readonly destinationAddress: v.StringSchema<undefined>;
970
+ readonly feeRate: v.NumberSchema<undefined>;
971
+ readonly refundAddress: v.StringSchema<undefined>;
972
+ readonly repeats: v.NumberSchema<undefined>;
973
+ readonly runeName: v.StringSchema<undefined>;
974
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
975
+ }, undefined>;
976
+ readonly id: v.StringSchema<undefined>;
977
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
978
+ }, undefined>;
979
+ type RunesMintRequestMessage = v.InferOutput<typeof runesMintRequestMessageSchema>;
980
+ type RunesMint = MethodParamsAndResult<v.InferOutput<typeof runesMintParamsSchema>, v.InferOutput<typeof runesMintResultSchema>>;
981
+
982
+ interface RunesRbfOrderParams extends RBFOrderRequest {
983
+ network?: BitcoinNetworkType;
984
+ }
985
+ interface RunesRbfOrderResult {
986
+ orderId: string;
987
+ fundRBFTransactionId: string;
988
+ fundingAddress: string;
989
+ }
990
+ type RunesRbfOrder = MethodParamsAndResult<RunesRbfOrderParams, RunesRbfOrderResult>;
991
+
992
+ declare const runesTransferMethodName = "runes_transfer";
993
+ declare const runesTransferParamsSchema: v.ObjectSchema<{
994
+ readonly recipients: v.ArraySchema<v.ObjectSchema<{
995
+ readonly runeName: v.StringSchema<undefined>;
996
+ readonly amount: v.StringSchema<undefined>;
997
+ readonly address: v.StringSchema<undefined>;
998
+ }, undefined>, undefined>;
999
+ }, undefined>;
1000
+ type TransferRunesParams = v.InferOutput<typeof runesTransferParamsSchema>;
1001
+ declare const runesTransferResultSchema: v.ObjectSchema<{
1002
+ readonly txid: v.StringSchema<undefined>;
1003
+ }, undefined>;
1004
+ type RunesTransferResult = v.InferOutput<typeof runesTransferResultSchema>;
1005
+ declare const runesTransferRequestMessageSchema: v.ObjectSchema<{
1006
+ readonly method: v.LiteralSchema<"runes_transfer", undefined>;
1007
+ readonly params: v.ObjectSchema<{
1008
+ readonly recipients: v.ArraySchema<v.ObjectSchema<{
1009
+ readonly runeName: v.StringSchema<undefined>;
1010
+ readonly amount: v.StringSchema<undefined>;
1011
+ readonly address: v.StringSchema<undefined>;
1012
+ }, undefined>, undefined>;
1013
+ }, undefined>;
1014
+ readonly id: v.StringSchema<undefined>;
1015
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1016
+ }, undefined>;
1017
+ type RunesTransferRequestMessage = v.InferOutput<typeof runesTransferRequestMessageSchema>;
1018
+ type RunesTransfer = MethodParamsAndResult<TransferRunesParams, RunesTransferResult>;
1019
+
1020
+ declare const sparkGetAddressesMethodName = "spark_getAddresses";
1021
+ declare const sparkGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
1234
1022
  /**
1235
- * A hex-encoded string representing the post conditions.
1236
- *
1237
- * A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
1238
- *
1239
- * ```js
1240
- * import { serializePostCondition } from '@stacks/transactions';
1241
- *
1242
- * const postCondition = somePostCondition;
1243
- * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1244
- * ```
1023
+ * A message to be displayed to the user in the request prompt.
1245
1024
  */
1246
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1025
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1026
+ }, undefined>, undefined>;
1027
+ type SparkGetAddressesParams = v.InferOutput<typeof sparkGetAddressesParamsSchema>;
1028
+ declare const sparkGetAddressesResultSchema: v.ObjectSchema<{
1247
1029
  /**
1248
- * The public key to sign the transaction with. The wallet may use any key
1249
- * when not provided.
1030
+ * The addresses generated for the given purposes.
1250
1031
  */
1251
- readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1032
+ readonly addresses: v.ArraySchema<v.ObjectSchema<{
1033
+ readonly address: v.StringSchema<undefined>;
1034
+ readonly publicKey: v.StringSchema<undefined>;
1035
+ readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1036
+ readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1037
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1038
+ }, undefined>, undefined>;
1039
+ readonly network: v.ObjectSchema<{
1040
+ readonly bitcoin: v.ObjectSchema<{
1041
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1042
+ }, undefined>;
1043
+ readonly stacks: v.ObjectSchema<{
1044
+ readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
1045
+ }, undefined>;
1046
+ readonly spark: v.ObjectSchema<{
1047
+ readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
1048
+ }, undefined>;
1049
+ }, undefined>;
1252
1050
  }, undefined>;
1253
- type StxTransferStxParams = v.InferOutput<typeof stxTransferStxParamsSchema>;
1254
- declare const stxTransferStxResultSchema: v.ObjectSchema<{
1051
+ type SparkGetAddressesResult = v.InferOutput<typeof sparkGetAddressesResultSchema>;
1052
+ declare const sparkGetAddressesRequestMessageSchema: v.ObjectSchema<{
1053
+ readonly method: v.LiteralSchema<"spark_getAddresses", undefined>;
1054
+ readonly params: v.NullishSchema<v.ObjectSchema<{
1055
+ /**
1056
+ * A message to be displayed to the user in the request prompt.
1057
+ */
1058
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1059
+ }, undefined>, undefined>;
1060
+ readonly id: v.StringSchema<undefined>;
1061
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1062
+ }, undefined>;
1063
+ type SparkGetAddressesRequestMessage = v.InferOutput<typeof sparkGetAddressesRequestMessageSchema>;
1064
+ type SparkGetAddresses = MethodParamsAndResult<v.InferOutput<typeof sparkGetAddressesParamsSchema>, v.InferOutput<typeof sparkGetAddressesResultSchema>>;
1065
+
1066
+ declare const sparkGetBalanceMethodName = "spark_getBalance";
1067
+ declare const sparkGetBalanceParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1068
+ type SparkGetBalanceParams = v.InferOutput<typeof sparkGetBalanceParamsSchema>;
1069
+ declare const sparkGetBalanceResultSchema: v.ObjectSchema<{
1255
1070
  /**
1256
- * The ID of the transaction.
1071
+ * The Spark Bitcoin address balance in sats in string form.
1257
1072
  */
1258
- readonly txid: v.StringSchema<undefined>;
1073
+ readonly balance: v.StringSchema<undefined>;
1074
+ readonly tokenBalances: v.ArraySchema<v.ObjectSchema<{
1075
+ readonly balance: v.StringSchema<undefined>;
1076
+ readonly tokenMetadata: v.ObjectSchema<{
1077
+ readonly tokenIdentifier: v.StringSchema<undefined>;
1078
+ readonly tokenName: v.StringSchema<undefined>;
1079
+ readonly tokenTicker: v.StringSchema<undefined>;
1080
+ readonly decimals: v.NumberSchema<undefined>;
1081
+ readonly maxSupply: v.StringSchema<undefined>;
1082
+ }, undefined>;
1083
+ }, undefined>, undefined>;
1084
+ }, undefined>;
1085
+ type SparkGetBalanceResult = v.InferOutput<typeof sparkGetBalanceResultSchema>;
1086
+ declare const sparkGetBalanceRequestMessageSchema: v.ObjectSchema<{
1087
+ readonly method: v.LiteralSchema<"spark_getBalance", undefined>;
1088
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1089
+ readonly id: v.StringSchema<undefined>;
1090
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1091
+ }, undefined>;
1092
+ type SparkGetBalanceRequestMessage = v.InferOutput<typeof sparkGetBalanceRequestMessageSchema>;
1093
+ type SparkGetBalance = MethodParamsAndResult<SparkGetBalanceParams, SparkGetBalanceResult>;
1094
+
1095
+ declare const sparkTransferMethodName = "spark_transfer";
1096
+ declare const sparkTransferParamsSchema: v.ObjectSchema<{
1259
1097
  /**
1260
- * A Stacks transaction as a hex-encoded string.
1098
+ * Amount of SATS to transfer as a string or number.
1261
1099
  */
1262
- readonly transaction: v.StringSchema<undefined>;
1100
+ readonly amountSats: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1101
+ /**
1102
+ * The recipient's spark address.
1103
+ */
1104
+ readonly receiverSparkAddress: v.StringSchema<undefined>;
1263
1105
  }, undefined>;
1264
- type StxTransferStxResult = v.InferOutput<typeof stxTransferStxResultSchema>;
1265
- declare const stxTransferStxRequestMessageSchema: v.ObjectSchema<{
1266
- readonly method: v.LiteralSchema<"stx_transferStx", undefined>;
1106
+ type SparkTransferParams = v.InferOutput<typeof sparkTransferParamsSchema>;
1107
+ declare const sparkTransferResultSchema: v.ObjectSchema<{
1108
+ /**
1109
+ * The ID of the transaction.
1110
+ */
1111
+ readonly id: v.StringSchema<undefined>;
1112
+ }, undefined>;
1113
+ type SparkTransferResult = v.InferOutput<typeof sparkTransferResultSchema>;
1114
+ declare const sparkTransferRequestMessageSchema: v.ObjectSchema<{
1115
+ readonly method: v.LiteralSchema<"spark_transfer", undefined>;
1267
1116
  readonly params: v.ObjectSchema<{
1268
1117
  /**
1269
- * Amount of STX tokens to transfer in microstacks as a string. Anything
1270
- * parseable by `BigInt` is acceptable.
1271
- *
1272
- * Example,
1273
- *
1274
- * ```js
1275
- * const amount1 = 1234;
1276
- * const amount2 = 1234n;
1277
- * const amount3 = '1234';
1278
- * ```
1279
- */
1280
- readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1281
- /**
1282
- * The recipient's principal.
1283
- */
1284
- readonly recipient: v.StringSchema<undefined>;
1285
- /**
1286
- * A string representing the memo.
1287
- */
1288
- readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1289
- /**
1290
- * Version of parameter format.
1291
- */
1292
- readonly version: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1293
- /**
1294
- * The mode of the post conditions.
1295
- */
1296
- readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1297
- /**
1298
- * A hex-encoded string representing the post conditions.
1299
- *
1300
- * A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
1301
- *
1302
- * ```js
1303
- * import { serializePostCondition } from '@stacks/transactions';
1304
- *
1305
- * const postCondition = somePostCondition;
1306
- * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1307
- * ```
1118
+ * Amount of SATS to transfer as a string or number.
1308
1119
  */
1309
- readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1120
+ readonly amountSats: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1310
1121
  /**
1311
- * The public key to sign the transaction with. The wallet may use any key
1312
- * when not provided.
1122
+ * The recipient's spark address.
1313
1123
  */
1314
- readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1124
+ readonly receiverSparkAddress: v.StringSchema<undefined>;
1315
1125
  }, undefined>;
1316
1126
  readonly id: v.StringSchema<undefined>;
1317
1127
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1318
1128
  }, undefined>;
1319
- type StxTransferStxRequestMessage = v.InferOutput<typeof stxTransferStxRequestMessageSchema>;
1320
- type StxTransferStx = MethodParamsAndResult<StxTransferStxParams, StxTransferStxResult>;
1129
+ type SparkTransferRequestMessage = v.InferOutput<typeof sparkTransferRequestMessageSchema>;
1130
+ type SparkTransfer = MethodParamsAndResult<SparkTransferParams, SparkTransferResult>;
1321
1131
 
1322
- declare const accountActionsSchema: v.ObjectSchema<{
1323
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1132
+ declare const sparkTransferTokenMethodName = "spark_transferToken";
1133
+ declare const sparkTransferTokenParamsSchema: v.ObjectSchema<{
1134
+ /**
1135
+ * Amount of units of the token to transfer as a string or number.
1136
+ */
1137
+ readonly tokenAmount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1138
+ /**
1139
+ * The Bech32m token identifier.
1140
+ */
1141
+ readonly tokenIdentifier: v.StringSchema<undefined>;
1142
+ /**
1143
+ * The recipient's spark address.
1144
+ */
1145
+ readonly receiverSparkAddress: v.StringSchema<undefined>;
1324
1146
  }, undefined>;
1325
- declare const walletActionsSchema: v.ObjectSchema<{
1326
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1327
- }, undefined>;
1328
- declare const accountPermissionSchema: v.ObjectSchema<{
1329
- readonly type: v.LiteralSchema<"account", undefined>;
1330
- readonly resourceId: v.StringSchema<undefined>;
1331
- readonly clientId: v.StringSchema<undefined>;
1332
- readonly actions: v.ObjectSchema<{
1333
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1334
- }, undefined>;
1335
- }, undefined>;
1336
- declare const walletPermissionSchema: v.ObjectSchema<{
1337
- readonly type: v.LiteralSchema<"wallet", undefined>;
1338
- readonly resourceId: v.StringSchema<undefined>;
1339
- readonly clientId: v.StringSchema<undefined>;
1340
- readonly actions: v.ObjectSchema<{
1341
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1342
- }, undefined>;
1147
+ type SparkTransferTokenParams = v.InferOutput<typeof sparkTransferTokenParamsSchema>;
1148
+ declare const sparkTransferTokenResultSchema: v.ObjectSchema<{
1149
+ /**
1150
+ * The ID of the transaction.
1151
+ */
1152
+ readonly id: v.StringSchema<undefined>;
1343
1153
  }, undefined>;
1344
- /**
1345
- * Permissions with the clientId field omitted and optional actions. Used for
1346
- * permission requests, since the wallet performs authentication based on the
1347
- * client's tab origin and should not rely on the client authenticating
1348
- * themselves.
1349
- */
1350
- declare const PermissionRequestParams: v.VariantSchema<"type", [v.ObjectSchema<{
1351
- readonly type: v.LiteralSchema<"account", undefined>;
1352
- readonly resourceId: v.StringSchema<undefined>;
1353
- readonly actions: v.ObjectSchema<{
1354
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1355
- }, undefined>;
1356
- }, undefined>, v.ObjectSchema<{
1357
- readonly type: v.LiteralSchema<"wallet", undefined>;
1358
- readonly resourceId: v.StringSchema<undefined>;
1359
- readonly actions: v.ObjectSchema<{
1360
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1361
- }, undefined>;
1362
- }, undefined>], undefined>;
1363
- declare const permission: v.VariantSchema<"type", [v.ObjectSchema<{
1364
- readonly type: v.LiteralSchema<"account", undefined>;
1365
- readonly resourceId: v.StringSchema<undefined>;
1366
- readonly clientId: v.StringSchema<undefined>;
1367
- readonly actions: v.ObjectSchema<{
1368
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1369
- }, undefined>;
1370
- }, undefined>, v.ObjectSchema<{
1371
- readonly type: v.LiteralSchema<"wallet", undefined>;
1372
- readonly resourceId: v.StringSchema<undefined>;
1373
- readonly clientId: v.StringSchema<undefined>;
1374
- readonly actions: v.ObjectSchema<{
1375
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1376
- }, undefined>;
1377
- }, undefined>], undefined>;
1378
- type PermissionWithoutClientId = v.InferOutput<typeof PermissionRequestParams>;
1379
- declare const requestPermissionsMethodName = "wallet_requestPermissions";
1380
- declare const requestPermissionsParamsSchema: v.NullishSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1381
- readonly type: v.LiteralSchema<"account", undefined>;
1382
- readonly resourceId: v.StringSchema<undefined>;
1383
- readonly actions: v.ObjectSchema<{
1384
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1385
- }, undefined>;
1386
- }, undefined>, v.ObjectSchema<{
1387
- readonly type: v.LiteralSchema<"wallet", undefined>;
1388
- readonly resourceId: v.StringSchema<undefined>;
1389
- readonly actions: v.ObjectSchema<{
1390
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1154
+ type SparkTransferTokenResult = v.InferOutput<typeof sparkTransferTokenResultSchema>;
1155
+ declare const sparkTransferTokenRequestMessageSchema: v.ObjectSchema<{
1156
+ readonly method: v.LiteralSchema<"spark_transferToken", undefined>;
1157
+ readonly params: v.ObjectSchema<{
1158
+ /**
1159
+ * Amount of units of the token to transfer as a string or number.
1160
+ */
1161
+ readonly tokenAmount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1162
+ /**
1163
+ * The Bech32m token identifier.
1164
+ */
1165
+ readonly tokenIdentifier: v.StringSchema<undefined>;
1166
+ /**
1167
+ * The recipient's spark address.
1168
+ */
1169
+ readonly receiverSparkAddress: v.StringSchema<undefined>;
1391
1170
  }, undefined>;
1392
- }, undefined>], undefined>, undefined>, undefined>;
1393
- type RequestPermissionsParams = v.InferOutput<typeof requestPermissionsParamsSchema>;
1394
- declare const requestPermissionsResultSchema: v.LiteralSchema<true, undefined>;
1395
- type RequestPermissionsResult = v.InferOutput<typeof requestPermissionsResultSchema>;
1396
- declare const requestPermissionsRequestMessageSchema: v.ObjectSchema<{
1397
- readonly method: v.LiteralSchema<"wallet_requestPermissions", undefined>;
1398
- readonly params: v.NullishSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1399
- readonly type: v.LiteralSchema<"account", undefined>;
1400
- readonly resourceId: v.StringSchema<undefined>;
1401
- readonly actions: v.ObjectSchema<{
1402
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1403
- }, undefined>;
1404
- }, undefined>, v.ObjectSchema<{
1405
- readonly type: v.LiteralSchema<"wallet", undefined>;
1406
- readonly resourceId: v.StringSchema<undefined>;
1407
- readonly actions: v.ObjectSchema<{
1408
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1409
- }, undefined>;
1410
- }, undefined>], undefined>, undefined>, undefined>;
1411
1171
  readonly id: v.StringSchema<undefined>;
1412
1172
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1413
1173
  }, undefined>;
1414
- type RequestPermissionsRequestMessage = v.InferOutput<typeof requestPermissionsRequestMessageSchema>;
1415
- type RequestPermissions = MethodParamsAndResult<RequestPermissionsParams, RequestPermissionsResult>;
1416
- declare const renouncePermissionsMethodName = "wallet_renouncePermissions";
1417
- declare const renouncePermissionsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1418
- type RenouncePermissionsParams = v.InferOutput<typeof renouncePermissionsParamsSchema>;
1419
- declare const renouncePermissionsResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1420
- type RenouncePermissionsResult = v.InferOutput<typeof renouncePermissionsResultSchema>;
1421
- declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
1422
- readonly method: v.LiteralSchema<"wallet_renouncePermissions", undefined>;
1423
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1424
- readonly id: v.StringSchema<undefined>;
1425
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1174
+ type SparkTransferTokenRequestMessage = v.InferOutput<typeof sparkTransferTokenRequestMessageSchema>;
1175
+ type SparkTransferToken = MethodParamsAndResult<SparkTransferTokenParams, SparkTransferTokenResult>;
1176
+
1177
+ declare const stxCallContractMethodName = "stx_callContract";
1178
+ declare const stxCallContractParamsSchema: v.ObjectSchema<{
1179
+ /**
1180
+ * The contract principal.
1181
+ *
1182
+ * E.g. `"SPKE...GD5C.my-contract"`
1183
+ */
1184
+ readonly contract: v.StringSchema<undefined>;
1185
+ /**
1186
+ * The name of the function to call.
1187
+ *
1188
+ * Note: spec changes ongoing,
1189
+ * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
1190
+ */
1191
+ readonly functionName: v.StringSchema<undefined>;
1192
+ /**
1193
+ * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
1194
+ */
1195
+ readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1196
+ /**
1197
+ * The function's arguments. The arguments are expected to be hex-encoded
1198
+ * strings of Clarity values.
1199
+ *
1200
+ * To convert Clarity values to their hex representation, the `cvToHex`
1201
+ * helper from the `@stacks/transactions` package may be helpful.
1202
+ *
1203
+ * ```js
1204
+ * import { cvToHex } from '@stacks/transactions';
1205
+ *
1206
+ * const functionArgs = [someClarityValue1, someClarityValue2];
1207
+ * const hexArgs = functionArgs.map(cvToHex);
1208
+ * ```
1209
+ */
1210
+ readonly functionArgs: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1211
+ /**
1212
+ * The post conditions to apply to the contract call.
1213
+ */
1214
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1215
+ /**
1216
+ * The mode to apply to the post conditions.
1217
+ */
1218
+ readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
1426
1219
  }, undefined>;
1427
- type RenouncePermissionsRequestMessage = v.InferOutput<typeof renouncePermissionsRequestMessageSchema>;
1428
- type RenouncePermissions = MethodParamsAndResult<RenouncePermissionsParams, RenouncePermissionsResult>;
1429
- declare const disconnectMethodName = "wallet_disconnect";
1430
- declare const disconnectParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1431
- type DisconnectParams = v.InferOutput<typeof disconnectParamsSchema>;
1432
- declare const disconnectResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1433
- type DisconnectResult = v.InferOutput<typeof disconnectResultSchema>;
1434
- declare const disconnectRequestMessageSchema: v.ObjectSchema<{
1435
- readonly method: v.LiteralSchema<"wallet_disconnect", undefined>;
1436
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1437
- readonly id: v.StringSchema<undefined>;
1438
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1220
+ type StxCallContractParams = v.InferOutput<typeof stxCallContractParamsSchema>;
1221
+ declare const stxCallContractResultSchema: v.ObjectSchema<{
1222
+ /**
1223
+ * The ID of the transaction.
1224
+ */
1225
+ readonly txid: v.StringSchema<undefined>;
1226
+ /**
1227
+ * A Stacks transaction as a hex-encoded string.
1228
+ */
1229
+ readonly transaction: v.StringSchema<undefined>;
1439
1230
  }, undefined>;
1440
- type DisconnectRequestMessage = v.InferOutput<typeof disconnectRequestMessageSchema>;
1441
- type Disconnect = MethodParamsAndResult<DisconnectParams, DisconnectResult>;
1442
- declare const getWalletTypeMethodName = "wallet_getWalletType";
1443
- declare const getWalletTypeParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1444
- type GetWalletTypeParams = v.InferOutput<typeof getWalletTypeParamsSchema>;
1445
- declare const getWalletTypeResultSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1446
- type GetWalletTypeResult = v.InferOutput<typeof getWalletTypeResultSchema>;
1447
- declare const getWalletTypeRequestMessageSchema: v.ObjectSchema<{
1448
- readonly method: v.LiteralSchema<"wallet_getWalletType", undefined>;
1449
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1231
+ type StxCallContractResult = v.InferOutput<typeof stxCallContractResultSchema>;
1232
+ declare const stxCallContractRequestMessageSchema: v.ObjectSchema<{
1233
+ readonly method: v.LiteralSchema<"stx_callContract", undefined>;
1234
+ readonly params: v.ObjectSchema<{
1235
+ /**
1236
+ * The contract principal.
1237
+ *
1238
+ * E.g. `"SPKE...GD5C.my-contract"`
1239
+ */
1240
+ readonly contract: v.StringSchema<undefined>;
1241
+ /**
1242
+ * The name of the function to call.
1243
+ *
1244
+ * Note: spec changes ongoing,
1245
+ * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
1246
+ */
1247
+ readonly functionName: v.StringSchema<undefined>;
1248
+ /**
1249
+ * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
1250
+ */
1251
+ readonly arguments: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1252
+ /**
1253
+ * The function's arguments. The arguments are expected to be hex-encoded
1254
+ * strings of Clarity values.
1255
+ *
1256
+ * To convert Clarity values to their hex representation, the `cvToHex`
1257
+ * helper from the `@stacks/transactions` package may be helpful.
1258
+ *
1259
+ * ```js
1260
+ * import { cvToHex } from '@stacks/transactions';
1261
+ *
1262
+ * const functionArgs = [someClarityValue1, someClarityValue2];
1263
+ * const hexArgs = functionArgs.map(cvToHex);
1264
+ * ```
1265
+ */
1266
+ readonly functionArgs: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1267
+ /**
1268
+ * The post conditions to apply to the contract call.
1269
+ */
1270
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1271
+ /**
1272
+ * The mode to apply to the post conditions.
1273
+ */
1274
+ readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
1275
+ }, undefined>;
1450
1276
  readonly id: v.StringSchema<undefined>;
1451
1277
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1452
1278
  }, undefined>;
1453
- type GetWalletTypeRequestMessage = v.InferOutput<typeof getWalletTypeRequestMessageSchema>;
1454
- type GetWalletType = MethodParamsAndResult<GetWalletTypeParams, GetWalletTypeResult>;
1455
- declare const getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
1456
- declare const getCurrentPermissionsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1457
- type GetCurrentPermissionsParams = v.InferOutput<typeof getCurrentPermissionsParamsSchema>;
1458
- declare const getCurrentPermissionsResultSchema: v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1459
- readonly type: v.LiteralSchema<"account", undefined>;
1460
- readonly resourceId: v.StringSchema<undefined>;
1461
- readonly clientId: v.StringSchema<undefined>;
1462
- readonly actions: v.ObjectSchema<{
1463
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1464
- }, undefined>;
1465
- }, undefined>, v.ObjectSchema<{
1466
- readonly type: v.LiteralSchema<"wallet", undefined>;
1467
- readonly resourceId: v.StringSchema<undefined>;
1468
- readonly clientId: v.StringSchema<undefined>;
1469
- readonly actions: v.ObjectSchema<{
1470
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1471
- }, undefined>;
1472
- }, undefined>], undefined>, undefined>;
1473
- type GetCurrentPermissionsResult = v.InferOutput<typeof getCurrentPermissionsResultSchema>;
1474
- declare const getCurrentPermissionsRequestMessageSchema: v.ObjectSchema<{
1475
- readonly method: v.LiteralSchema<"wallet_getCurrentPermissions", undefined>;
1476
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1477
- readonly id: v.StringSchema<undefined>;
1478
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1479
- }, undefined>;
1480
- type GetCurrentPermissionsRequestMessage = v.InferOutput<typeof getCurrentPermissionsRequestMessageSchema>;
1481
- type GetCurrentPermissions = MethodParamsAndResult<GetCurrentPermissionsParams, GetCurrentPermissionsResult>;
1482
- declare const getNetworkMethodName = "wallet_getNetwork";
1483
- declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1484
- type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
1485
- declare const getNetworkResultSchema: v.ObjectSchema<{
1486
- readonly bitcoin: v.ObjectSchema<{
1487
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1488
- }, undefined>;
1489
- readonly stacks: v.ObjectSchema<{
1490
- readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
1491
- }, undefined>;
1492
- readonly spark: v.ObjectSchema<{
1493
- readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
1494
- }, undefined>;
1495
- }, undefined>;
1496
- type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
1497
- declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
1498
- readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
1499
- readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1500
- readonly id: v.StringSchema<undefined>;
1501
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1502
- }, undefined>;
1503
- type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
1504
- type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
1505
- declare const changeNetworkMethodName = "wallet_changeNetwork";
1506
- declare const changeNetworkParamsSchema: v.ObjectSchema<{
1507
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1508
- }, undefined>;
1509
- type ChangeNetworkParams = v.InferOutput<typeof changeNetworkParamsSchema>;
1510
- declare const changeNetworkResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1511
- type ChangeNetworkResult = v.InferOutput<typeof changeNetworkResultSchema>;
1512
- declare const changeNetworkRequestMessageSchema: v.ObjectSchema<{
1513
- readonly method: v.LiteralSchema<"wallet_changeNetwork", undefined>;
1514
- readonly params: v.ObjectSchema<{
1515
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1516
- }, undefined>;
1517
- readonly id: v.StringSchema<undefined>;
1518
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1279
+ type StxCallContractRequestMessage = v.InferOutput<typeof stxCallContractRequestMessageSchema>;
1280
+ type StxCallContract = MethodParamsAndResult<StxCallContractParams, StxCallContractResult>;
1281
+
1282
+ declare const stxDeployContractMethodName = "stx_deployContract";
1283
+ declare const stxDeployContractParamsSchema: v.ObjectSchema<{
1284
+ /**
1285
+ * Name of the contract.
1286
+ */
1287
+ readonly name: v.StringSchema<undefined>;
1288
+ /**
1289
+ * The source code of the Clarity contract.
1290
+ */
1291
+ readonly clarityCode: v.StringSchema<undefined>;
1292
+ /**
1293
+ * The version of the Clarity contract.
1294
+ */
1295
+ readonly clarityVersion: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1296
+ /**
1297
+ * The post conditions to apply to the contract call.
1298
+ */
1299
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1300
+ /**
1301
+ * The mode to apply to the post conditions.
1302
+ */
1303
+ readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
1519
1304
  }, undefined>;
1520
- type ChangeNetworkRequestMessage = v.InferOutput<typeof changeNetworkRequestMessageSchema>;
1521
- type ChangeNetwork = MethodParamsAndResult<ChangeNetworkParams, ChangeNetworkResult>;
1522
- declare const changeNetworkByIdMethodName = "wallet_changeNetworkById";
1523
- declare const changeNetworkByIdParamsSchema: v.ObjectSchema<{
1524
- readonly id: v.StringSchema<undefined>;
1305
+ type StxDeployContractParams = v.InferOutput<typeof stxDeployContractParamsSchema>;
1306
+ declare const stxDeployContractResultSchema: v.ObjectSchema<{
1307
+ /**
1308
+ * The ID of the transaction.
1309
+ */
1310
+ readonly txid: v.StringSchema<undefined>;
1311
+ /**
1312
+ * A Stacks transaction as a hex-encoded string.
1313
+ */
1314
+ readonly transaction: v.StringSchema<undefined>;
1525
1315
  }, undefined>;
1526
- type ChangeNetworkByIdParams = v.InferOutput<typeof changeNetworkByIdParamsSchema>;
1527
- declare const changeNetworkByIdResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1528
- type ChangeNetworkByIdResult = v.InferOutput<typeof changeNetworkByIdResultSchema>;
1529
- declare const changeNetworkByIdRequestMessageSchema: v.ObjectSchema<{
1530
- readonly method: v.LiteralSchema<"wallet_changeNetworkById", undefined>;
1316
+ type StxDeployContractResult = v.InferOutput<typeof stxDeployContractResultSchema>;
1317
+ declare const stxDeployContractRequestMessageSchema: v.ObjectSchema<{
1318
+ readonly method: v.LiteralSchema<"stx_deployContract", undefined>;
1531
1319
  readonly params: v.ObjectSchema<{
1532
- readonly id: v.StringSchema<undefined>;
1320
+ /**
1321
+ * Name of the contract.
1322
+ */
1323
+ readonly name: v.StringSchema<undefined>;
1324
+ /**
1325
+ * The source code of the Clarity contract.
1326
+ */
1327
+ readonly clarityCode: v.StringSchema<undefined>;
1328
+ /**
1329
+ * The version of the Clarity contract.
1330
+ */
1331
+ readonly clarityVersion: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1332
+ /**
1333
+ * The post conditions to apply to the contract call.
1334
+ */
1335
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1336
+ /**
1337
+ * The mode to apply to the post conditions.
1338
+ */
1339
+ readonly postConditionMode: v.OptionalSchema<v.UnionSchema<[v.LiteralSchema<"allow", undefined>, v.LiteralSchema<"deny", undefined>], undefined>, undefined>;
1533
1340
  }, undefined>;
1534
1341
  readonly id: v.StringSchema<undefined>;
1535
1342
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1536
1343
  }, undefined>;
1537
- type ChangeNetworkByIdRequestMessage = v.InferOutput<typeof changeNetworkByIdRequestMessageSchema>;
1538
- type ChangeNetworkById = MethodParamsAndResult<ChangeNetworkByIdParams, ChangeNetworkByIdResult>;
1539
- declare const getAccountMethodName = "wallet_getAccount";
1540
- declare const getAccountParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1541
- type GetAccountParams = v.InferOutput<typeof getAccountParamsSchema>;
1542
- declare const getAccountResultSchema: v.ObjectSchema<{
1543
- readonly id: v.StringSchema<undefined>;
1344
+ type StxDeployContractRequestMessage = v.InferOutput<typeof stxDeployContractRequestMessageSchema>;
1345
+ type StxDeployContract = MethodParamsAndResult<StxDeployContractParams, StxDeployContractResult>;
1346
+
1347
+ declare const stxGetAccountsMethodName = "stx_getAccounts";
1348
+ declare const stxGetAccountsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1349
+ type StxGetAccountsParams = v.InferOutput<typeof stxGetAccountsParamsSchema>;
1350
+ declare const stxGetAccountsResultSchema: v.ObjectSchema<{
1351
+ /**
1352
+ * The addresses generated for the given purposes.
1353
+ */
1544
1354
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1545
1355
  readonly address: v.StringSchema<undefined>;
1546
1356
  readonly publicKey: v.StringSchema<undefined>;
1547
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1548
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1549
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1357
+ readonly gaiaHubUrl: v.StringSchema<undefined>;
1358
+ readonly gaiaAppKey: v.StringSchema<undefined>;
1550
1359
  }, undefined>, undefined>;
1551
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1552
1360
  readonly network: v.ObjectSchema<{
1553
1361
  readonly bitcoin: v.ObjectSchema<{
1554
1362
  readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
@@ -1561,37 +1369,28 @@ declare const getAccountResultSchema: v.ObjectSchema<{
1561
1369
  }, undefined>;
1562
1370
  }, undefined>;
1563
1371
  }, undefined>;
1564
- type GetAccountResult = v.InferOutput<typeof getAccountResultSchema>;
1565
- declare const getAccountRequestMessageSchema: v.ObjectSchema<{
1566
- readonly method: v.LiteralSchema<"wallet_getAccount", undefined>;
1372
+ type StxGetAccountsResult = v.InferOutput<typeof stxGetAccountsResultSchema>;
1373
+ declare const stxGetAccountsRequestMessageSchema: v.ObjectSchema<{
1374
+ readonly method: v.LiteralSchema<"stx_getAccounts", undefined>;
1567
1375
  readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1568
1376
  readonly id: v.StringSchema<undefined>;
1569
1377
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1570
1378
  }, undefined>;
1571
- type GetAccountRequestMessage = v.InferOutput<typeof getAccountRequestMessageSchema>;
1572
- type GetAccount = MethodParamsAndResult<GetAccountParams, GetAccountResult>;
1573
- declare const connectMethodName = "wallet_connect";
1574
- declare const connectParamsSchema: v.NullishSchema<v.ObjectSchema<{
1575
- readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1576
- readonly type: v.LiteralSchema<"account", undefined>;
1577
- readonly resourceId: v.StringSchema<undefined>;
1578
- readonly actions: v.ObjectSchema<{
1579
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1580
- }, undefined>;
1581
- }, undefined>, v.ObjectSchema<{
1582
- readonly type: v.LiteralSchema<"wallet", undefined>;
1583
- readonly resourceId: v.StringSchema<undefined>;
1584
- readonly actions: v.ObjectSchema<{
1585
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1586
- }, undefined>;
1587
- }, undefined>], undefined>, undefined>, undefined>;
1588
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>, undefined>;
1589
- readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 80, "The message must not exceed 80 characters.">]>, undefined>;
1590
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
1379
+ type StxGetAccountsRequestMessage = v.InferOutput<typeof stxGetAccountsRequestMessageSchema>;
1380
+ type StxGetAccounts = MethodParamsAndResult<StxGetAccountsParams, StxGetAccountsResult>;
1381
+
1382
+ declare const stxGetAddressesMethodName = "stx_getAddresses";
1383
+ declare const stxGetAddressesParamsSchema: v.NullishSchema<v.ObjectSchema<{
1384
+ /**
1385
+ * A message to be displayed to the user in the request prompt.
1386
+ */
1387
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1591
1388
  }, undefined>, undefined>;
1592
- type ConnectParams = v.InferOutput<typeof connectParamsSchema>;
1593
- declare const connectResultSchema: v.ObjectSchema<{
1594
- readonly id: v.StringSchema<undefined>;
1389
+ type StxGetAddressesParams = v.InferOutput<typeof stxGetAddressesParamsSchema>;
1390
+ declare const stxGetAddressesResultSchema: v.ObjectSchema<{
1391
+ /**
1392
+ * The addresses generated for the given purposes.
1393
+ */
1595
1394
  readonly addresses: v.ArraySchema<v.ObjectSchema<{
1596
1395
  readonly address: v.StringSchema<undefined>;
1597
1396
  readonly publicKey: v.StringSchema<undefined>;
@@ -1599,7 +1398,6 @@ declare const connectResultSchema: v.ObjectSchema<{
1599
1398
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1600
1399
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1601
1400
  }, undefined>, undefined>;
1602
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1603
1401
  readonly network: v.ObjectSchema<{
1604
1402
  readonly bitcoin: v.ObjectSchema<{
1605
1403
  readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
@@ -1612,573 +1410,775 @@ declare const connectResultSchema: v.ObjectSchema<{
1612
1410
  }, undefined>;
1613
1411
  }, undefined>;
1614
1412
  }, undefined>;
1615
- type ConnectResult = v.InferOutput<typeof connectResultSchema>;
1616
- declare const connectRequestMessageSchema: v.ObjectSchema<{
1617
- readonly method: v.LiteralSchema<"wallet_connect", undefined>;
1413
+ type StxGetAddressesResult = v.InferOutput<typeof stxGetAddressesResultSchema>;
1414
+ declare const stxGetAddressesRequestMessageSchema: v.ObjectSchema<{
1415
+ readonly method: v.LiteralSchema<"stx_getAddresses", undefined>;
1618
1416
  readonly params: v.NullishSchema<v.ObjectSchema<{
1619
- readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1620
- readonly type: v.LiteralSchema<"account", undefined>;
1621
- readonly resourceId: v.StringSchema<undefined>;
1622
- readonly actions: v.ObjectSchema<{
1623
- readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1624
- }, undefined>;
1625
- }, undefined>, v.ObjectSchema<{
1626
- readonly type: v.LiteralSchema<"wallet", undefined>;
1627
- readonly resourceId: v.StringSchema<undefined>;
1628
- readonly actions: v.ObjectSchema<{
1629
- readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1630
- }, undefined>;
1631
- }, undefined>], undefined>, undefined>, undefined>;
1632
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>, undefined>;
1633
- readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 80, "The message must not exceed 80 characters.">]>, undefined>;
1634
- readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
1417
+ /**
1418
+ * A message to be displayed to the user in the request prompt.
1419
+ */
1420
+ readonly message: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1635
1421
  }, undefined>, undefined>;
1636
1422
  readonly id: v.StringSchema<undefined>;
1637
1423
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1638
1424
  }, undefined>;
1639
- type ConnectRequestMessage = v.InferOutput<typeof connectRequestMessageSchema>;
1640
- type Connect = MethodParamsAndResult<ConnectParams, ConnectResult>;
1641
- declare const addNetworkMethodName = "wallet_addNetwork";
1642
- declare const addNetworkParamsSchema: v.VariantSchema<"chain", [v.ObjectSchema<{
1643
- readonly chain: v.LiteralSchema<"bitcoin", undefined>;
1644
- readonly type: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1645
- readonly name: v.StringSchema<undefined>;
1646
- readonly rpcUrl: v.StringSchema<undefined>;
1647
- readonly rpcFallbackUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1648
- readonly indexerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1649
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1650
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1651
- }, undefined>, v.ObjectSchema<{
1652
- readonly chain: v.LiteralSchema<"stacks", undefined>;
1653
- readonly name: v.StringSchema<undefined>;
1654
- readonly type: v.EnumSchema<typeof StacksNetworkType, undefined>;
1655
- readonly rpcUrl: v.StringSchema<undefined>;
1656
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1657
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1658
- }, undefined>, v.ObjectSchema<{
1659
- readonly chain: v.LiteralSchema<"starknet", undefined>;
1660
- readonly name: v.StringSchema<undefined>;
1661
- readonly type: v.EnumSchema<typeof StarknetNetworkType, undefined>;
1662
- readonly rpcUrl: v.StringSchema<undefined>;
1663
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1664
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1665
- }, undefined>], undefined>;
1666
- type AddNetworkParams = v.InferOutput<typeof addNetworkParamsSchema>;
1667
- declare const addNetworkRequestMessageSchema: v.ObjectSchema<{
1668
- readonly method: v.LiteralSchema<"wallet_addNetwork", undefined>;
1669
- readonly params: v.VariantSchema<"chain", [v.ObjectSchema<{
1670
- readonly chain: v.LiteralSchema<"bitcoin", undefined>;
1671
- readonly type: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1672
- readonly name: v.StringSchema<undefined>;
1673
- readonly rpcUrl: v.StringSchema<undefined>;
1674
- readonly rpcFallbackUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1675
- readonly indexerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1676
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1677
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1678
- }, undefined>, v.ObjectSchema<{
1679
- readonly chain: v.LiteralSchema<"stacks", undefined>;
1680
- readonly name: v.StringSchema<undefined>;
1681
- readonly type: v.EnumSchema<typeof StacksNetworkType, undefined>;
1682
- readonly rpcUrl: v.StringSchema<undefined>;
1683
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1684
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1685
- }, undefined>, v.ObjectSchema<{
1686
- readonly chain: v.LiteralSchema<"starknet", undefined>;
1687
- readonly name: v.StringSchema<undefined>;
1688
- readonly type: v.EnumSchema<typeof StarknetNetworkType, undefined>;
1689
- readonly rpcUrl: v.StringSchema<undefined>;
1690
- readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1691
- readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1692
- }, undefined>], undefined>;
1693
- readonly id: v.StringSchema<undefined>;
1694
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1695
- }, undefined>;
1696
- type AddNetworkRequestMessage = v.InferOutput<typeof addNetworkRequestMessageSchema>;
1697
- declare const addNetworkResultSchema: v.ObjectSchema<{
1698
- readonly id: v.StringSchema<undefined>;
1699
- }, undefined>;
1700
- type AddNetworkResult = v.InferOutput<typeof addNetworkResultSchema>;
1701
- type AddNetwork = MethodParamsAndResult<AddNetworkParams, AddNetworkResult>;
1702
-
1703
- declare const walletTypes: readonly ["software", "ledger", "keystone"];
1704
- declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1705
- type WalletType = v.InferOutput<typeof walletTypeSchema>;
1706
-
1707
- type StxRequests = {
1708
- stx_callContract: StxCallContract;
1709
- stx_deployContract: StxDeployContract;
1710
- stx_getAccounts: StxGetAccounts;
1711
- stx_getAddresses: StxGetAddresses;
1712
- stx_signMessage: StxSignMessage;
1713
- stx_signStructuredMessage: StxSignStructuredMessage;
1714
- stx_signTransaction: StxSignTransaction;
1715
- stx_transferStx: StxTransferStx;
1716
- stx_signTransactions: StxSignTransactions;
1717
- };
1718
- type StxRequestMethod = keyof StxRequests;
1719
- type SparkRequests = {
1720
- [sparkGetAddressesMethodName]: SparkGetAddresses;
1721
- [sparkGetBalanceMethodName]: SparkGetBalance;
1722
- [sparkTransferMethodName]: SparkTransfer;
1723
- [sparkTransferTokenMethodName]: SparkTransferToken;
1724
- };
1725
- type SparkRequestMethod = keyof SparkRequests;
1726
- type BtcRequests = {
1727
- getInfo: GetInfo;
1728
- getAddresses: GetAddresses;
1729
- getAccounts: GetAccounts;
1730
- getBalance: GetBalance;
1731
- signMessage: SignMessage;
1732
- sendTransfer: SendTransfer;
1733
- signPsbt: SignPsbt;
1734
- };
1735
- type BtcRequestMethod = keyof BtcRequests;
1736
- type RunesRequests = {
1737
- runes_estimateEtch: RunesEstimateEtch;
1738
- runes_estimateMint: RunesEstimateMint;
1739
- runes_estimateRbfOrder: RunesEstimateRbfOrder;
1740
- runes_etch: RunesEtch;
1741
- runes_getBalance: RunesGetBalance;
1742
- runes_getOrder: RunesGetOrder;
1743
- runes_mint: RunesMint;
1744
- runes_rbfOrder: RunesRbfOrder;
1745
- runes_transfer: RunesTransfer;
1746
- };
1747
- type RunesRequestMethod = keyof RunesRequests;
1748
- type OrdinalsRequests = {
1749
- ord_getInscriptions: GetInscriptions;
1750
- ord_sendInscriptions: SendInscriptions;
1751
- };
1752
- type OrdinalsRequestMethod = keyof OrdinalsRequests;
1753
- type WalletRequests = {
1754
- wallet_addNetwork: AddNetwork;
1755
- wallet_changeNetwork: ChangeNetwork;
1756
- wallet_changeNetworkById: ChangeNetworkById;
1757
- wallet_connect: Connect;
1758
- wallet_disconnect: Disconnect;
1759
- wallet_getAccount: GetAccount;
1760
- wallet_getCurrentPermissions: GetCurrentPermissions;
1761
- wallet_getNetwork: GetNetwork;
1762
- wallet_getWalletType: GetWalletType;
1763
- wallet_renouncePermissions: RenouncePermissions;
1764
- wallet_requestPermissions: RequestPermissions;
1765
- };
1766
- type Requests = BtcRequests & StxRequests & SparkRequests & RunesRequests & WalletRequests & OrdinalsRequests;
1767
- type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
1768
- type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
1769
-
1770
- declare const request: <Method extends keyof Requests>(method: Method, params: Params<Method>,
1771
- /**
1772
- * The providerId is the object path to the provider in the window object.
1773
- * E.g., a provider available at `window.Foo.BarProvider` would have a
1774
- * providerId of `Foo.BarProvider`.
1775
- */
1776
- providerId?: string) => Promise<RpcResult<Method>>;
1777
- /**
1778
- * Adds an event listener.
1779
- *
1780
- * Currently expects 2 arguments, although is also capable of handling legacy
1781
- * calls with 3 arguments consisting of:
1782
- *
1783
- * - event name (string)
1784
- * - callback (function)
1785
- * - provider ID (optional string)
1786
- */
1787
- declare const addListener: (...rawArgs: unknown[]) => ReturnType<AddListener>;
1425
+ type StxGetAddressesRequestMessage = v.InferOutput<typeof stxGetAddressesRequestMessageSchema>;
1426
+ type StxGetAddresses = MethodParamsAndResult<v.InferOutput<typeof stxGetAddressesParamsSchema>, v.InferOutput<typeof stxGetAddressesResultSchema>>;
1788
1427
 
1789
- declare enum BitcoinNetworkType {
1790
- Mainnet = "Mainnet",
1791
- Testnet = "Testnet",
1792
- Testnet4 = "Testnet4",
1793
- Signet = "Signet",
1794
- Regtest = "Regtest"
1795
- }
1796
- declare enum StacksNetworkType {
1797
- Mainnet = "mainnet",
1798
- Testnet = "testnet"
1799
- }
1800
- declare enum StarknetNetworkType {
1801
- Mainnet = "mainnet",
1802
- Sepolia = "sepolia"
1803
- }
1804
- declare enum SparkNetworkType {
1805
- Mainnet = "mainnet",
1806
- Regtest = "regtest"
1807
- }
1808
- interface BitcoinNetwork {
1809
- type: BitcoinNetworkType;
1810
- address?: string;
1811
- }
1812
- interface RequestPayload {
1813
- network: BitcoinNetwork;
1814
- }
1815
- interface RequestOptions<Payload extends RequestPayload, Response> {
1816
- onFinish: (response: Response) => void;
1817
- onCancel: () => void;
1818
- payload: Payload;
1819
- getProvider?: () => Promise<BitcoinProvider | undefined>;
1820
- }
1821
- declare const RpcIdSchema: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1822
- type RpcId = v.InferOutput<typeof RpcIdSchema>;
1823
- declare const rpcRequestMessageSchema: v.ObjectSchema<{
1824
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1825
- readonly method: v.StringSchema<undefined>;
1826
- readonly params: v.OptionalSchema<v.UnionSchema<[v.ArraySchema<v.UnknownSchema, undefined>, v.LooseObjectSchema<{}, undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1827
- readonly id: v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>;
1828
- }, undefined>;
1829
- type RpcRequestMessage = v.InferOutput<typeof rpcRequestMessageSchema>;
1830
- interface RpcBase {
1831
- jsonrpc: '2.0';
1832
- id: RpcId;
1833
- }
1834
- interface RpcRequest<T extends string, U> extends RpcBase {
1835
- method: T;
1836
- params: U;
1837
- }
1838
- interface MethodParamsAndResult<TParams, TResult> {
1839
- params: TParams;
1840
- result: TResult;
1841
- }
1842
- /**
1843
- * @enum {number} RpcErrorCode
1844
- * @description JSON-RPC error codes
1845
- * @see https://www.jsonrpc.org/specification#error_object
1846
- */
1847
- declare enum RpcErrorCode {
1428
+ declare const stxSignMessageMethodName = "stx_signMessage";
1429
+ declare const stxSignMessageParamsSchema: v.ObjectSchema<{
1848
1430
  /**
1849
- * Parse error Invalid JSON
1850
- **/
1851
- PARSE_ERROR = -32700,
1431
+ * The message to sign.
1432
+ */
1433
+ readonly message: v.StringSchema<undefined>;
1434
+ }, undefined>;
1435
+ type StxSignMessageParams = v.InferOutput<typeof stxSignMessageParamsSchema>;
1436
+ declare const stxSignMessageResultSchema: v.ObjectSchema<{
1852
1437
  /**
1853
- * The JSON sent is not a valid Request object.
1854
- **/
1855
- INVALID_REQUEST = -32600,
1438
+ * The signature of the message.
1439
+ */
1440
+ readonly signature: v.StringSchema<undefined>;
1856
1441
  /**
1857
- * The method does not exist/is not available.
1858
- **/
1859
- METHOD_NOT_FOUND = -32601,
1442
+ * The public key used to sign the message.
1443
+ */
1444
+ readonly publicKey: v.StringSchema<undefined>;
1445
+ }, undefined>;
1446
+ type StxSignMessageResult = v.InferOutput<typeof stxSignMessageResultSchema>;
1447
+ declare const stxSignMessageRequestMessageSchema: v.ObjectSchema<{
1448
+ readonly method: v.LiteralSchema<"stx_signMessage", undefined>;
1449
+ readonly params: v.ObjectSchema<{
1450
+ /**
1451
+ * The message to sign.
1452
+ */
1453
+ readonly message: v.StringSchema<undefined>;
1454
+ }, undefined>;
1455
+ readonly id: v.StringSchema<undefined>;
1456
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1457
+ }, undefined>;
1458
+ type StxSignMessageRequestMessage = v.InferOutput<typeof stxSignMessageRequestMessageSchema>;
1459
+ type StxSignMessage = MethodParamsAndResult<StxSignMessageParams, StxSignMessageResult>;
1460
+
1461
+ declare const stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
1462
+ declare const stxSignStructuredMessageParamsSchema: v.ObjectSchema<{
1860
1463
  /**
1861
- * Invalid method parameter(s).
1464
+ * The domain to be signed.
1862
1465
  */
1863
- INVALID_PARAMS = -32602,
1466
+ readonly domain: v.StringSchema<undefined>;
1864
1467
  /**
1865
- * Internal JSON-RPC error.
1866
- * This is a generic error, used when the server encounters an error in performing the request.
1867
- **/
1868
- INTERNAL_ERROR = -32603,
1468
+ * Message payload to be signed.
1469
+ */
1470
+ readonly message: v.StringSchema<undefined>;
1869
1471
  /**
1870
- * user rejected/canceled the request
1472
+ * The public key to sign the message with.
1871
1473
  */
1872
- USER_REJECTION = -32000,
1474
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1475
+ }, undefined>;
1476
+ type StxSignStructuredMessageParams = v.InferOutput<typeof stxSignStructuredMessageParamsSchema>;
1477
+ declare const stxSignStructuredMessageResultSchema: v.ObjectSchema<{
1873
1478
  /**
1874
- * method is not supported for the address provided
1479
+ * Signature of the message.
1875
1480
  */
1876
- METHOD_NOT_SUPPORTED = -32001,
1481
+ readonly signature: v.StringSchema<undefined>;
1877
1482
  /**
1878
- * The client does not have permission to access the requested resource.
1483
+ * Public key as hex-encoded string.
1879
1484
  */
1880
- ACCESS_DENIED = -32002
1881
- }
1882
- declare const rpcSuccessResponseMessageSchema: v.ObjectSchema<{
1485
+ readonly publicKey: v.StringSchema<undefined>;
1486
+ }, undefined>;
1487
+ type StxSignStructuredMessageResult = v.InferOutput<typeof stxSignStructuredMessageResultSchema>;
1488
+ declare const stxSignStructuredMessageRequestMessageSchema: v.ObjectSchema<{
1489
+ readonly method: v.LiteralSchema<"stx_signStructuredMessage", undefined>;
1490
+ readonly params: v.ObjectSchema<{
1491
+ /**
1492
+ * The domain to be signed.
1493
+ */
1494
+ readonly domain: v.StringSchema<undefined>;
1495
+ /**
1496
+ * Message payload to be signed.
1497
+ */
1498
+ readonly message: v.StringSchema<undefined>;
1499
+ /**
1500
+ * The public key to sign the message with.
1501
+ */
1502
+ readonly publicKey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1503
+ }, undefined>;
1504
+ readonly id: v.StringSchema<undefined>;
1883
1505
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1884
- readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
1885
- readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1886
1506
  }, undefined>;
1887
- type RpcSuccessResponseMessage = v.InferOutput<typeof rpcSuccessResponseMessageSchema>;
1888
- declare const rpcErrorResponseMessageSchema: v.ObjectSchema<{
1889
- readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1890
- readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
1891
- readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1507
+ type StxSignStructuredMessageRequestMessage = v.InferOutput<typeof stxSignStructuredMessageRequestMessageSchema>;
1508
+ type StxSignStructuredMessage = MethodParamsAndResult<StxSignStructuredMessageParams, StxSignStructuredMessageResult>;
1509
+
1510
+ declare const stxSignTransactionMethodName = "stx_signTransaction";
1511
+ declare const stxSignTransactionParamsSchema: v.ObjectSchema<{
1512
+ /**
1513
+ * The transaction to sign as a hex-encoded string.
1514
+ */
1515
+ readonly transaction: v.StringSchema<undefined>;
1516
+ /**
1517
+ * The public key to sign the transaction with. The wallet may use any key
1518
+ * when not provided.
1519
+ */
1520
+ readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1521
+ /**
1522
+ * Whether to broadcast the transaction after signing. Defaults to `true`.
1523
+ */
1524
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1892
1525
  }, undefined>;
1893
- type RpcErrorResponseMessage = v.InferOutput<typeof rpcErrorResponseMessageSchema>;
1894
- declare const rpcResponseMessageSchema: v.UnionSchema<[v.ObjectSchema<{
1526
+ type StxSignTransactionParams = v.InferOutput<typeof stxSignTransactionParamsSchema>;
1527
+ declare const stxSignTransactionResultSchema: v.ObjectSchema<{
1528
+ /**
1529
+ * The signed transaction as a hex-encoded string.
1530
+ */
1531
+ readonly transaction: v.StringSchema<undefined>;
1532
+ }, undefined>;
1533
+ type StxSignTransactionResult = v.InferOutput<typeof stxSignTransactionResultSchema>;
1534
+ declare const stxSignTransactionRequestMessageSchema: v.ObjectSchema<{
1535
+ readonly method: v.LiteralSchema<"stx_signTransaction", undefined>;
1536
+ readonly params: v.ObjectSchema<{
1537
+ /**
1538
+ * The transaction to sign as a hex-encoded string.
1539
+ */
1540
+ readonly transaction: v.StringSchema<undefined>;
1541
+ /**
1542
+ * The public key to sign the transaction with. The wallet may use any key
1543
+ * when not provided.
1544
+ */
1545
+ readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1546
+ /**
1547
+ * Whether to broadcast the transaction after signing. Defaults to `true`.
1548
+ */
1549
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1550
+ }, undefined>;
1551
+ readonly id: v.StringSchema<undefined>;
1895
1552
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1896
- readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
1897
- readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1898
- }, undefined>, v.ObjectSchema<{
1553
+ }, undefined>;
1554
+ type StxSignTransactionRequestMessage = v.InferOutput<typeof stxSignTransactionRequestMessageSchema>;
1555
+ type StxSignTransaction = MethodParamsAndResult<StxSignTransactionParams, StxSignTransactionResult>;
1556
+
1557
+ declare const stxSignTransactionsMethodName = "stx_signTransactions";
1558
+ declare const stxSignTransactionsParamsSchema: v.ObjectSchema<{
1559
+ /**
1560
+ * The transactions to sign as hex-encoded strings.
1561
+ */
1562
+ readonly transactions: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid hex-encoded Stacks transaction.">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
1563
+ /**
1564
+ * Whether the signed transactions should be broadcast after signing. Defaults
1565
+ * to `true`.
1566
+ */
1567
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1568
+ }, undefined>;
1569
+ type StxSignTransactionsParams = v.InferOutput<typeof stxSignTransactionsParamsSchema>;
1570
+ declare const stxSignTransactionsResultSchema: v.ObjectSchema<{
1571
+ /**
1572
+ * The signed transactions as hex-encoded strings, in the same order as in the
1573
+ * sign request.
1574
+ */
1575
+ readonly transactions: v.ArraySchema<v.StringSchema<undefined>, undefined>;
1576
+ }, undefined>;
1577
+ type StxSignTransactionsResult = v.InferOutput<typeof stxSignTransactionsResultSchema>;
1578
+ declare const stxSignTransactionsRequestMessageSchema: v.ObjectSchema<{
1579
+ readonly method: v.LiteralSchema<"stx_signTransactions", undefined>;
1580
+ readonly params: v.ObjectSchema<{
1581
+ /**
1582
+ * The transactions to sign as hex-encoded strings.
1583
+ */
1584
+ readonly transactions: v.SchemaWithPipe<readonly [v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.CheckAction<string, "Invalid hex-encoded Stacks transaction.">]>, undefined>, v.MinLengthAction<string[], 1, undefined>]>;
1585
+ /**
1586
+ * Whether the signed transactions should be broadcast after signing. Defaults
1587
+ * to `true`.
1588
+ */
1589
+ readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1590
+ }, undefined>;
1591
+ readonly id: v.StringSchema<undefined>;
1899
1592
  readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1900
- readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
1901
- readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, undefined>;
1902
- }, undefined>], undefined>;
1903
- type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;
1904
- interface RpcError {
1905
- code: number | RpcErrorCode;
1906
- message: string;
1907
- data?: any;
1908
- }
1909
- interface RpcErrorResponse<TError extends RpcError = RpcError> extends RpcBase {
1910
- error: TError;
1911
- }
1912
- interface RpcSuccessResponse<Method extends keyof Requests> extends RpcBase {
1913
- result: Return<Method>;
1914
- }
1915
- type RpcResponse<Method extends keyof Requests> = RpcSuccessResponse<Method> | RpcErrorResponse;
1916
- type RpcResult<Method extends keyof Requests> = {
1917
- result: RpcSuccessResponse<Method>['result'];
1918
- status: 'success';
1919
- } | {
1920
- error: RpcErrorResponse['error'];
1921
- status: 'error';
1922
- };
1593
+ }, undefined>;
1594
+ type StxSignTransactionsRequestMessage = v.InferOutput<typeof stxSignTransactionsRequestMessageSchema>;
1595
+ type StxSignTransactions = MethodParamsAndResult<StxSignTransactionsParams, StxSignTransactionsResult>;
1923
1596
 
1924
- declare enum AddressPurpose {
1925
- Ordinals = "ordinals",
1926
- Payment = "payment",
1927
- Stacks = "stacks",
1928
- Starknet = "starknet",
1929
- Spark = "spark"
1930
- }
1931
- interface GetAddressPayload extends RequestPayload {
1932
- purposes: AddressPurpose[];
1933
- message: string;
1934
- }
1935
- declare enum AddressType {
1936
- p2pkh = "p2pkh",
1937
- p2sh = "p2sh",
1938
- p2wpkh = "p2wpkh",
1939
- p2wsh = "p2wsh",
1940
- p2tr = "p2tr",
1941
- stacks = "stacks",
1942
- starknet = "starknet",
1943
- spark = "spark"
1944
- }
1945
- declare const addressSchema: v.ObjectSchema<{
1946
- readonly address: v.StringSchema<undefined>;
1947
- readonly publicKey: v.StringSchema<undefined>;
1948
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
1949
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
1950
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1597
+ declare const stxTransferStxMethodName = "stx_transferStx";
1598
+ declare const stxTransferStxParamsSchema: v.ObjectSchema<{
1599
+ /**
1600
+ * Amount of STX tokens to transfer in microstacks as a string. Anything
1601
+ * parseable by `BigInt` is acceptable.
1602
+ *
1603
+ * Example,
1604
+ *
1605
+ * ```js
1606
+ * const amount1 = 1234;
1607
+ * const amount2 = 1234n;
1608
+ * const amount3 = '1234';
1609
+ * ```
1610
+ */
1611
+ readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1612
+ /**
1613
+ * The recipient's principal.
1614
+ */
1615
+ readonly recipient: v.StringSchema<undefined>;
1616
+ /**
1617
+ * A string representing the memo.
1618
+ */
1619
+ readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1620
+ /**
1621
+ * Version of parameter format.
1622
+ */
1623
+ readonly version: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1624
+ /**
1625
+ * The mode of the post conditions.
1626
+ */
1627
+ readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1628
+ /**
1629
+ * A hex-encoded string representing the post conditions.
1630
+ *
1631
+ * A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
1632
+ *
1633
+ * ```js
1634
+ * import { serializePostCondition } from '@stacks/transactions';
1635
+ *
1636
+ * const postCondition = somePostCondition;
1637
+ * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1638
+ * ```
1639
+ */
1640
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1641
+ /**
1642
+ * The public key to sign the transaction with. The wallet may use any key
1643
+ * when not provided.
1644
+ */
1645
+ readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1951
1646
  }, undefined>;
1952
- type Address = v.InferOutput<typeof addressSchema>;
1953
- interface GetAddressResponse {
1954
- addresses: Address[];
1955
- }
1956
- type GetAddressOptions = RequestOptions<GetAddressPayload, GetAddressResponse>;
1647
+ type StxTransferStxParams = v.InferOutput<typeof stxTransferStxParamsSchema>;
1648
+ declare const stxTransferStxResultSchema: v.ObjectSchema<{
1649
+ /**
1650
+ * The ID of the transaction.
1651
+ */
1652
+ readonly txid: v.StringSchema<undefined>;
1653
+ /**
1654
+ * A Stacks transaction as a hex-encoded string.
1655
+ */
1656
+ readonly transaction: v.StringSchema<undefined>;
1657
+ }, undefined>;
1658
+ type StxTransferStxResult = v.InferOutput<typeof stxTransferStxResultSchema>;
1659
+ declare const stxTransferStxRequestMessageSchema: v.ObjectSchema<{
1660
+ readonly method: v.LiteralSchema<"stx_transferStx", undefined>;
1661
+ readonly params: v.ObjectSchema<{
1662
+ /**
1663
+ * Amount of STX tokens to transfer in microstacks as a string. Anything
1664
+ * parseable by `BigInt` is acceptable.
1665
+ *
1666
+ * Example,
1667
+ *
1668
+ * ```js
1669
+ * const amount1 = 1234;
1670
+ * const amount2 = 1234n;
1671
+ * const amount3 = '1234';
1672
+ * ```
1673
+ */
1674
+ readonly amount: v.UnionSchema<[v.NumberSchema<undefined>, v.StringSchema<undefined>], undefined>;
1675
+ /**
1676
+ * The recipient's principal.
1677
+ */
1678
+ readonly recipient: v.StringSchema<undefined>;
1679
+ /**
1680
+ * A string representing the memo.
1681
+ */
1682
+ readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1683
+ /**
1684
+ * Version of parameter format.
1685
+ */
1686
+ readonly version: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1687
+ /**
1688
+ * The mode of the post conditions.
1689
+ */
1690
+ readonly postConditionMode: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
1691
+ /**
1692
+ * A hex-encoded string representing the post conditions.
1693
+ *
1694
+ * A post condition may be converted to it's hex representation using the `serializePostCondition` helper from the `@stacks/transactions` package,
1695
+ *
1696
+ * ```js
1697
+ * import { serializePostCondition } from '@stacks/transactions';
1698
+ *
1699
+ * const postCondition = somePostCondition;
1700
+ * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
1701
+ * ```
1702
+ */
1703
+ readonly postConditions: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
1704
+ /**
1705
+ * The public key to sign the transaction with. The wallet may use any key
1706
+ * when not provided.
1707
+ */
1708
+ readonly pubkey: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
1709
+ }, undefined>;
1710
+ readonly id: v.StringSchema<undefined>;
1711
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1712
+ }, undefined>;
1713
+ type StxTransferStxRequestMessage = v.InferOutput<typeof stxTransferStxRequestMessageSchema>;
1714
+ type StxTransferStx = MethodParamsAndResult<StxTransferStxParams, StxTransferStxResult>;
1957
1715
 
1716
+ declare const accountActionsSchema: v.ObjectSchema<{
1717
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1718
+ }, undefined>;
1719
+ declare const walletActionsSchema: v.ObjectSchema<{
1720
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1721
+ }, undefined>;
1722
+ declare const accountPermissionSchema: v.ObjectSchema<{
1723
+ readonly type: v.LiteralSchema<"account", undefined>;
1724
+ readonly resourceId: v.StringSchema<undefined>;
1725
+ readonly clientId: v.StringSchema<undefined>;
1726
+ readonly actions: v.ObjectSchema<{
1727
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1728
+ }, undefined>;
1729
+ }, undefined>;
1730
+ declare const walletPermissionSchema: v.ObjectSchema<{
1731
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1732
+ readonly resourceId: v.StringSchema<undefined>;
1733
+ readonly clientId: v.StringSchema<undefined>;
1734
+ readonly actions: v.ObjectSchema<{
1735
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1736
+ }, undefined>;
1737
+ }, undefined>;
1958
1738
  /**
1959
- * @deprecated Use `request()` instead
1960
- */
1961
- declare const getAddress: (options: GetAddressOptions) => Promise<void>;
1962
-
1963
- interface GetCapabilitiesPayload extends RequestPayload {
1964
- }
1965
- type GetCapabilitiesResponse = Capability[];
1966
- type GetCapabilitiesOptions = RequestOptions<GetCapabilitiesPayload, GetCapabilitiesResponse>;
1967
-
1968
- declare const getCapabilities: (options: GetCapabilitiesOptions) => Promise<void>;
1969
-
1970
- interface CreateInscriptionPayload extends RequestPayload {
1971
- contentType: string;
1972
- content: string;
1973
- payloadType: 'PLAIN_TEXT' | 'BASE_64';
1974
- appFee?: number;
1975
- appFeeAddress?: string;
1976
- suggestedMinerFeeRate?: number;
1977
- token?: string;
1978
- }
1979
- interface CreateRepeatInscriptionsPayload extends CreateInscriptionPayload {
1980
- repeat: number;
1981
- }
1982
- type CreateInscriptionResponse = {
1983
- txId: string;
1984
- };
1985
- type CreateRepeatInscriptionsResponse = {
1986
- txId: string;
1987
- };
1988
- type CreateInscriptionOptions = RequestOptions<CreateInscriptionPayload, CreateInscriptionResponse>;
1989
- type CreateRepeatInscriptionsOptions = RequestOptions<CreateRepeatInscriptionsPayload, CreateRepeatInscriptionsResponse>;
1990
-
1991
- declare const createInscription: (options: CreateInscriptionOptions) => Promise<void>;
1992
-
1993
- declare const createRepeatInscriptions: (options: CreateRepeatInscriptionsOptions) => Promise<void>;
1994
-
1995
- interface SignMessagePayload extends RequestPayload {
1996
- address: string;
1997
- message: string;
1998
- protocol?: MessageSigningProtocols;
1999
- }
2000
- type SignMessageResponse = string;
2001
- type SignMessageOptions = RequestOptions<SignMessagePayload, SignMessageResponse>;
2002
-
2003
- declare const signMessage: (options: SignMessageOptions) => Promise<void>;
2004
-
2005
- interface Recipient {
2006
- address: string;
2007
- amountSats: bigint;
2008
- }
2009
- type SerializedRecipient = Omit<Recipient, 'amountSats'> & {
2010
- amountSats: string;
2011
- };
2012
- interface SendBtcTransactionPayload extends RequestPayload {
2013
- recipients: Recipient[];
2014
- senderAddress: string;
2015
- message?: string;
2016
- }
2017
- type SerializedSendBtcTransactionPayload = Omit<SendBtcTransactionPayload, 'recipients'> & {
2018
- recipients: SerializedRecipient[];
2019
- };
2020
- type SendBtcTransactionResponse = string;
2021
- type SendBtcTransactionOptions = RequestOptions<SendBtcTransactionPayload, SendBtcTransactionResponse>;
2022
- interface InputToSign {
2023
- address: string;
2024
- signingIndexes: number[];
2025
- sigHash?: number;
2026
- }
2027
- type PsbtPayload = {
2028
- psbtBase64: string;
2029
- inputsToSign?: InputToSign[];
2030
- broadcast?: boolean;
2031
- };
2032
- type SignMultiplePsbtPayload = {
2033
- psbtBase64: string;
2034
- inputsToSign?: InputToSign[];
2035
- };
2036
- interface SignTransactionPayload extends RequestPayload, PsbtPayload {
2037
- message: string;
2038
- }
2039
- interface SignTransactionResponse {
2040
- psbtBase64: string;
2041
- txId?: string;
2042
- }
2043
- type SignTransactionOptions = RequestOptions<SignTransactionPayload, SignTransactionResponse>;
2044
- interface SignMultipleTransactionsPayload extends RequestPayload {
2045
- message: string;
2046
- psbts: SignMultiplePsbtPayload[];
2047
- }
2048
- type SignMultipleTransactionsResponse = SignTransactionResponse[];
2049
- type SignMultipleTransactionOptions = RequestOptions<SignMultipleTransactionsPayload, SignMultipleTransactionsResponse>;
2050
-
2051
- declare const sendBtcTransaction: (options: SendBtcTransactionOptions) => Promise<void>;
2052
-
2053
- declare const signTransaction: (options: SignTransactionOptions) => Promise<void>;
2054
-
2055
- declare const signMultipleTransactions: (options: SignMultipleTransactionOptions) => Promise<void>;
2056
-
2057
- declare const accountChangeEventName = "accountChange";
2058
- declare const accountChangeSchema: v.ObjectSchema<{
2059
- readonly type: v.LiteralSchema<"accountChange", undefined>;
2060
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2061
- readonly address: v.StringSchema<undefined>;
2062
- readonly publicKey: v.StringSchema<undefined>;
2063
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
2064
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
2065
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
2066
- }, undefined>, undefined>, undefined>;
1739
+ * Permissions with the clientId field omitted and optional actions. Used for
1740
+ * permission requests, since the wallet performs authentication based on the
1741
+ * client's tab origin and should not rely on the client authenticating
1742
+ * themselves.
1743
+ */
1744
+ declare const PermissionRequestParams: v.VariantSchema<"type", [v.ObjectSchema<{
1745
+ readonly type: v.LiteralSchema<"account", undefined>;
1746
+ readonly resourceId: v.StringSchema<undefined>;
1747
+ readonly actions: v.ObjectSchema<{
1748
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1749
+ }, undefined>;
1750
+ }, undefined>, v.ObjectSchema<{
1751
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1752
+ readonly resourceId: v.StringSchema<undefined>;
1753
+ readonly actions: v.ObjectSchema<{
1754
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1755
+ }, undefined>;
1756
+ }, undefined>], undefined>;
1757
+ declare const permission: v.VariantSchema<"type", [v.ObjectSchema<{
1758
+ readonly type: v.LiteralSchema<"account", undefined>;
1759
+ readonly resourceId: v.StringSchema<undefined>;
1760
+ readonly clientId: v.StringSchema<undefined>;
1761
+ readonly actions: v.ObjectSchema<{
1762
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1763
+ }, undefined>;
1764
+ }, undefined>, v.ObjectSchema<{
1765
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1766
+ readonly resourceId: v.StringSchema<undefined>;
1767
+ readonly clientId: v.StringSchema<undefined>;
1768
+ readonly actions: v.ObjectSchema<{
1769
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1770
+ }, undefined>;
1771
+ }, undefined>], undefined>;
1772
+ type PermissionWithoutClientId = v.InferOutput<typeof PermissionRequestParams>;
1773
+ declare const requestPermissionsMethodName = "wallet_requestPermissions";
1774
+ declare const requestPermissionsParamsSchema: v.NullishSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1775
+ readonly type: v.LiteralSchema<"account", undefined>;
1776
+ readonly resourceId: v.StringSchema<undefined>;
1777
+ readonly actions: v.ObjectSchema<{
1778
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1779
+ }, undefined>;
1780
+ }, undefined>, v.ObjectSchema<{
1781
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1782
+ readonly resourceId: v.StringSchema<undefined>;
1783
+ readonly actions: v.ObjectSchema<{
1784
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1785
+ }, undefined>;
1786
+ }, undefined>], undefined>, undefined>, undefined>;
1787
+ type RequestPermissionsParams = v.InferOutput<typeof requestPermissionsParamsSchema>;
1788
+ declare const requestPermissionsResultSchema: v.LiteralSchema<true, undefined>;
1789
+ type RequestPermissionsResult = v.InferOutput<typeof requestPermissionsResultSchema>;
1790
+ declare const requestPermissionsRequestMessageSchema: v.ObjectSchema<{
1791
+ readonly method: v.LiteralSchema<"wallet_requestPermissions", undefined>;
1792
+ readonly params: v.NullishSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1793
+ readonly type: v.LiteralSchema<"account", undefined>;
1794
+ readonly resourceId: v.StringSchema<undefined>;
1795
+ readonly actions: v.ObjectSchema<{
1796
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1797
+ }, undefined>;
1798
+ }, undefined>, v.ObjectSchema<{
1799
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1800
+ readonly resourceId: v.StringSchema<undefined>;
1801
+ readonly actions: v.ObjectSchema<{
1802
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1803
+ }, undefined>;
1804
+ }, undefined>], undefined>, undefined>, undefined>;
1805
+ readonly id: v.StringSchema<undefined>;
1806
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
2067
1807
  }, undefined>;
2068
- type AccountChangeEvent = v.InferOutput<typeof accountChangeSchema>;
2069
- declare const networkChangeEventName = "networkChange";
2070
- declare const networkChangeSchema: v.ObjectSchema<{
2071
- readonly type: v.LiteralSchema<"networkChange", undefined>;
1808
+ type RequestPermissionsRequestMessage = v.InferOutput<typeof requestPermissionsRequestMessageSchema>;
1809
+ type RequestPermissions = MethodParamsAndResult<RequestPermissionsParams, RequestPermissionsResult>;
1810
+ declare const renouncePermissionsMethodName = "wallet_renouncePermissions";
1811
+ declare const renouncePermissionsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1812
+ type RenouncePermissionsParams = v.InferOutput<typeof renouncePermissionsParamsSchema>;
1813
+ declare const renouncePermissionsResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1814
+ type RenouncePermissionsResult = v.InferOutput<typeof renouncePermissionsResultSchema>;
1815
+ declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
1816
+ readonly method: v.LiteralSchema<"wallet_renouncePermissions", undefined>;
1817
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1818
+ readonly id: v.StringSchema<undefined>;
1819
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1820
+ }, undefined>;
1821
+ type RenouncePermissionsRequestMessage = v.InferOutput<typeof renouncePermissionsRequestMessageSchema>;
1822
+ type RenouncePermissions = MethodParamsAndResult<RenouncePermissionsParams, RenouncePermissionsResult>;
1823
+ declare const disconnectMethodName = "wallet_disconnect";
1824
+ declare const disconnectParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1825
+ type DisconnectParams = v.InferOutput<typeof disconnectParamsSchema>;
1826
+ declare const disconnectResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1827
+ type DisconnectResult = v.InferOutput<typeof disconnectResultSchema>;
1828
+ declare const disconnectRequestMessageSchema: v.ObjectSchema<{
1829
+ readonly method: v.LiteralSchema<"wallet_disconnect", undefined>;
1830
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1831
+ readonly id: v.StringSchema<undefined>;
1832
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1833
+ }, undefined>;
1834
+ type DisconnectRequestMessage = v.InferOutput<typeof disconnectRequestMessageSchema>;
1835
+ type Disconnect = MethodParamsAndResult<DisconnectParams, DisconnectResult>;
1836
+ declare const getWalletTypeMethodName = "wallet_getWalletType";
1837
+ declare const getWalletTypeParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1838
+ type GetWalletTypeParams = v.InferOutput<typeof getWalletTypeParamsSchema>;
1839
+ declare const getWalletTypeResultSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1840
+ type GetWalletTypeResult = v.InferOutput<typeof getWalletTypeResultSchema>;
1841
+ declare const getWalletTypeRequestMessageSchema: v.ObjectSchema<{
1842
+ readonly method: v.LiteralSchema<"wallet_getWalletType", undefined>;
1843
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1844
+ readonly id: v.StringSchema<undefined>;
1845
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1846
+ }, undefined>;
1847
+ type GetWalletTypeRequestMessage = v.InferOutput<typeof getWalletTypeRequestMessageSchema>;
1848
+ type GetWalletType = MethodParamsAndResult<GetWalletTypeParams, GetWalletTypeResult>;
1849
+ declare const getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
1850
+ declare const getCurrentPermissionsParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1851
+ type GetCurrentPermissionsParams = v.InferOutput<typeof getCurrentPermissionsParamsSchema>;
1852
+ declare const getCurrentPermissionsResultSchema: v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1853
+ readonly type: v.LiteralSchema<"account", undefined>;
1854
+ readonly resourceId: v.StringSchema<undefined>;
1855
+ readonly clientId: v.StringSchema<undefined>;
1856
+ readonly actions: v.ObjectSchema<{
1857
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1858
+ }, undefined>;
1859
+ }, undefined>, v.ObjectSchema<{
1860
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1861
+ readonly resourceId: v.StringSchema<undefined>;
1862
+ readonly clientId: v.StringSchema<undefined>;
1863
+ readonly actions: v.ObjectSchema<{
1864
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1865
+ }, undefined>;
1866
+ }, undefined>], undefined>, undefined>;
1867
+ type GetCurrentPermissionsResult = v.InferOutput<typeof getCurrentPermissionsResultSchema>;
1868
+ declare const getCurrentPermissionsRequestMessageSchema: v.ObjectSchema<{
1869
+ readonly method: v.LiteralSchema<"wallet_getCurrentPermissions", undefined>;
1870
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1871
+ readonly id: v.StringSchema<undefined>;
1872
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1873
+ }, undefined>;
1874
+ type GetCurrentPermissionsRequestMessage = v.InferOutput<typeof getCurrentPermissionsRequestMessageSchema>;
1875
+ type GetCurrentPermissions = MethodParamsAndResult<GetCurrentPermissionsParams, GetCurrentPermissionsResult>;
1876
+ declare const getNetworkMethodName = "wallet_getNetwork";
1877
+ declare const getNetworkParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1878
+ type GetNetworkParams = v.InferOutput<typeof getNetworkParamsSchema>;
1879
+ declare const getNetworkResultSchema: v.ObjectSchema<{
2072
1880
  readonly bitcoin: v.ObjectSchema<{
2073
1881
  readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
2074
1882
  }, undefined>;
2075
1883
  readonly stacks: v.ObjectSchema<{
2076
- readonly name: v.StringSchema<undefined>;
1884
+ readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
1885
+ }, undefined>;
1886
+ readonly spark: v.ObjectSchema<{
1887
+ readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
2077
1888
  }, undefined>;
2078
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
2079
- readonly address: v.StringSchema<undefined>;
2080
- readonly publicKey: v.StringSchema<undefined>;
2081
- readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
2082
- readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
2083
- readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
2084
- }, undefined>, undefined>, undefined>;
2085
1889
  }, undefined>;
2086
- type NetworkChangeEvent = v.InferOutput<typeof networkChangeSchema>;
2087
- declare const disconnectEventName = "disconnect";
2088
- declare const disconnectSchema: v.ObjectSchema<{
2089
- readonly type: v.LiteralSchema<"disconnect", undefined>;
1890
+ type GetNetworkResult = v.InferOutput<typeof getNetworkResultSchema>;
1891
+ declare const getNetworkRequestMessageSchema: v.ObjectSchema<{
1892
+ readonly method: v.LiteralSchema<"wallet_getNetwork", undefined>;
1893
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1894
+ readonly id: v.StringSchema<undefined>;
1895
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
2090
1896
  }, undefined>;
2091
- type DisconnectEvent = v.InferOutput<typeof disconnectSchema>;
2092
- declare const walletEventSchema: v.VariantSchema<"type", [v.ObjectSchema<{
2093
- readonly type: v.LiteralSchema<"accountChange", undefined>;
2094
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1897
+ type GetNetworkRequestMessage = v.InferOutput<typeof getNetworkRequestMessageSchema>;
1898
+ type GetNetwork = MethodParamsAndResult<GetNetworkParams, GetNetworkResult>;
1899
+ declare const changeNetworkMethodName = "wallet_changeNetwork";
1900
+ declare const changeNetworkParamsSchema: v.ObjectSchema<{
1901
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1902
+ }, undefined>;
1903
+ type ChangeNetworkParams = v.InferOutput<typeof changeNetworkParamsSchema>;
1904
+ declare const changeNetworkResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1905
+ type ChangeNetworkResult = v.InferOutput<typeof changeNetworkResultSchema>;
1906
+ declare const changeNetworkRequestMessageSchema: v.ObjectSchema<{
1907
+ readonly method: v.LiteralSchema<"wallet_changeNetwork", undefined>;
1908
+ readonly params: v.ObjectSchema<{
1909
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1910
+ }, undefined>;
1911
+ readonly id: v.StringSchema<undefined>;
1912
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1913
+ }, undefined>;
1914
+ type ChangeNetworkRequestMessage = v.InferOutput<typeof changeNetworkRequestMessageSchema>;
1915
+ type ChangeNetwork = MethodParamsAndResult<ChangeNetworkParams, ChangeNetworkResult>;
1916
+ declare const changeNetworkByIdMethodName = "wallet_changeNetworkById";
1917
+ declare const changeNetworkByIdParamsSchema: v.ObjectSchema<{
1918
+ readonly id: v.StringSchema<undefined>;
1919
+ }, undefined>;
1920
+ type ChangeNetworkByIdParams = v.InferOutput<typeof changeNetworkByIdParamsSchema>;
1921
+ declare const changeNetworkByIdResultSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1922
+ type ChangeNetworkByIdResult = v.InferOutput<typeof changeNetworkByIdResultSchema>;
1923
+ declare const changeNetworkByIdRequestMessageSchema: v.ObjectSchema<{
1924
+ readonly method: v.LiteralSchema<"wallet_changeNetworkById", undefined>;
1925
+ readonly params: v.ObjectSchema<{
1926
+ readonly id: v.StringSchema<undefined>;
1927
+ }, undefined>;
1928
+ readonly id: v.StringSchema<undefined>;
1929
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1930
+ }, undefined>;
1931
+ type ChangeNetworkByIdRequestMessage = v.InferOutput<typeof changeNetworkByIdRequestMessageSchema>;
1932
+ type ChangeNetworkById = MethodParamsAndResult<ChangeNetworkByIdParams, ChangeNetworkByIdResult>;
1933
+ declare const getAccountMethodName = "wallet_getAccount";
1934
+ declare const getAccountParamsSchema: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1935
+ type GetAccountParams = v.InferOutput<typeof getAccountParamsSchema>;
1936
+ declare const getAccountResultSchema: v.ObjectSchema<{
1937
+ readonly id: v.StringSchema<undefined>;
1938
+ readonly addresses: v.ArraySchema<v.ObjectSchema<{
2095
1939
  readonly address: v.StringSchema<undefined>;
2096
1940
  readonly publicKey: v.StringSchema<undefined>;
2097
1941
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
2098
1942
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
2099
1943
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
2100
- }, undefined>, undefined>, undefined>;
2101
- }, undefined>, v.ObjectSchema<{
2102
- readonly type: v.LiteralSchema<"networkChange", undefined>;
2103
- readonly bitcoin: v.ObjectSchema<{
2104
- readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
2105
- }, undefined>;
2106
- readonly stacks: v.ObjectSchema<{
2107
- readonly name: v.StringSchema<undefined>;
1944
+ }, undefined>, undefined>;
1945
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1946
+ readonly network: v.ObjectSchema<{
1947
+ readonly bitcoin: v.ObjectSchema<{
1948
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
1949
+ }, undefined>;
1950
+ readonly stacks: v.ObjectSchema<{
1951
+ readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
1952
+ }, undefined>;
1953
+ readonly spark: v.ObjectSchema<{
1954
+ readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
1955
+ }, undefined>;
2108
1956
  }, undefined>;
2109
- readonly addresses: v.OptionalSchema<v.ArraySchema<v.ObjectSchema<{
1957
+ }, undefined>;
1958
+ type GetAccountResult = v.InferOutput<typeof getAccountResultSchema>;
1959
+ declare const getAccountRequestMessageSchema: v.ObjectSchema<{
1960
+ readonly method: v.LiteralSchema<"wallet_getAccount", undefined>;
1961
+ readonly params: v.NullishSchema<v.NullSchema<undefined>, undefined>;
1962
+ readonly id: v.StringSchema<undefined>;
1963
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
1964
+ }, undefined>;
1965
+ type GetAccountRequestMessage = v.InferOutput<typeof getAccountRequestMessageSchema>;
1966
+ type GetAccount = MethodParamsAndResult<GetAccountParams, GetAccountResult>;
1967
+ declare const connectMethodName = "wallet_connect";
1968
+ declare const connectParamsSchema: v.NullishSchema<v.ObjectSchema<{
1969
+ readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
1970
+ readonly type: v.LiteralSchema<"account", undefined>;
1971
+ readonly resourceId: v.StringSchema<undefined>;
1972
+ readonly actions: v.ObjectSchema<{
1973
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1974
+ }, undefined>;
1975
+ }, undefined>, v.ObjectSchema<{
1976
+ readonly type: v.LiteralSchema<"wallet", undefined>;
1977
+ readonly resourceId: v.StringSchema<undefined>;
1978
+ readonly actions: v.ObjectSchema<{
1979
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
1980
+ }, undefined>;
1981
+ }, undefined>], undefined>, undefined>, undefined>;
1982
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>, undefined>;
1983
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 80, "The message must not exceed 80 characters.">]>, undefined>;
1984
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
1985
+ }, undefined>, undefined>;
1986
+ type ConnectParams = v.InferOutput<typeof connectParamsSchema>;
1987
+ declare const connectResultSchema: v.ObjectSchema<{
1988
+ readonly id: v.StringSchema<undefined>;
1989
+ readonly addresses: v.ArraySchema<v.ObjectSchema<{
2110
1990
  readonly address: v.StringSchema<undefined>;
2111
1991
  readonly publicKey: v.StringSchema<undefined>;
2112
1992
  readonly purpose: v.EnumSchema<typeof AddressPurpose, undefined>;
2113
1993
  readonly addressType: v.EnumSchema<typeof AddressType, undefined>;
2114
1994
  readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
2115
- }, undefined>, undefined>, undefined>;
1995
+ }, undefined>, undefined>;
1996
+ readonly walletType: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
1997
+ readonly network: v.ObjectSchema<{
1998
+ readonly bitcoin: v.ObjectSchema<{
1999
+ readonly name: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
2000
+ }, undefined>;
2001
+ readonly stacks: v.ObjectSchema<{
2002
+ readonly name: v.EnumSchema<typeof StacksNetworkType, undefined>;
2003
+ }, undefined>;
2004
+ readonly spark: v.ObjectSchema<{
2005
+ readonly name: v.EnumSchema<typeof SparkNetworkType, undefined>;
2006
+ }, undefined>;
2007
+ }, undefined>;
2008
+ }, undefined>;
2009
+ type ConnectResult = v.InferOutput<typeof connectResultSchema>;
2010
+ declare const connectRequestMessageSchema: v.ObjectSchema<{
2011
+ readonly method: v.LiteralSchema<"wallet_connect", undefined>;
2012
+ readonly params: v.NullishSchema<v.ObjectSchema<{
2013
+ readonly permissions: v.OptionalSchema<v.ArraySchema<v.VariantSchema<"type", [v.ObjectSchema<{
2014
+ readonly type: v.LiteralSchema<"account", undefined>;
2015
+ readonly resourceId: v.StringSchema<undefined>;
2016
+ readonly actions: v.ObjectSchema<{
2017
+ readonly read: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2018
+ }, undefined>;
2019
+ }, undefined>, v.ObjectSchema<{
2020
+ readonly type: v.LiteralSchema<"wallet", undefined>;
2021
+ readonly resourceId: v.StringSchema<undefined>;
2022
+ readonly actions: v.ObjectSchema<{
2023
+ readonly readNetwork: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2024
+ }, undefined>;
2025
+ }, undefined>], undefined>, undefined>, undefined>;
2026
+ readonly addresses: v.OptionalSchema<v.ArraySchema<v.EnumSchema<typeof AddressPurpose, undefined>, undefined>, undefined>;
2027
+ readonly message: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 80, "The message must not exceed 80 characters.">]>, undefined>;
2028
+ readonly network: v.OptionalSchema<v.EnumSchema<typeof BitcoinNetworkType, undefined>, undefined>;
2029
+ }, undefined>, undefined>;
2030
+ readonly id: v.StringSchema<undefined>;
2031
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
2032
+ }, undefined>;
2033
+ type ConnectRequestMessage = v.InferOutput<typeof connectRequestMessageSchema>;
2034
+ type Connect = MethodParamsAndResult<ConnectParams, ConnectResult>;
2035
+ declare const addNetworkMethodName = "wallet_addNetwork";
2036
+ declare const addNetworkParamsSchema: v.VariantSchema<"chain", [v.ObjectSchema<{
2037
+ readonly chain: v.LiteralSchema<"bitcoin", undefined>;
2038
+ readonly type: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
2039
+ readonly name: v.StringSchema<undefined>;
2040
+ readonly rpcUrl: v.StringSchema<undefined>;
2041
+ readonly rpcFallbackUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2042
+ readonly indexerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2043
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2044
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2116
2045
  }, undefined>, v.ObjectSchema<{
2117
- readonly type: v.LiteralSchema<"disconnect", undefined>;
2046
+ readonly chain: v.LiteralSchema<"stacks", undefined>;
2047
+ readonly name: v.StringSchema<undefined>;
2048
+ readonly type: v.EnumSchema<typeof StacksNetworkType, undefined>;
2049
+ readonly rpcUrl: v.StringSchema<undefined>;
2050
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2051
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2052
+ }, undefined>, v.ObjectSchema<{
2053
+ readonly chain: v.LiteralSchema<"starknet", undefined>;
2054
+ readonly name: v.StringSchema<undefined>;
2055
+ readonly type: v.EnumSchema<typeof StarknetNetworkType, undefined>;
2056
+ readonly rpcUrl: v.StringSchema<undefined>;
2057
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2058
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2118
2059
  }, undefined>], undefined>;
2119
- type WalletEvent = v.InferOutput<typeof walletEventSchema>;
2120
- type AccountChangeCallback = (e: AccountChangeEvent) => void;
2121
- type DisconnectCallback = (e: DisconnectEvent) => void;
2122
- type NetworkChangeCallback = (e: NetworkChangeEvent) => void;
2123
- type ListenerInfo = {
2124
- eventName: typeof accountChangeEventName;
2125
- cb: AccountChangeCallback;
2126
- } | {
2127
- eventName: typeof disconnectEventName;
2128
- cb: DisconnectCallback;
2129
- } | {
2130
- eventName: typeof networkChangeEventName;
2131
- cb: NetworkChangeCallback;
2060
+ type AddNetworkParams = v.InferOutput<typeof addNetworkParamsSchema>;
2061
+ declare const addNetworkRequestMessageSchema: v.ObjectSchema<{
2062
+ readonly method: v.LiteralSchema<"wallet_addNetwork", undefined>;
2063
+ readonly params: v.VariantSchema<"chain", [v.ObjectSchema<{
2064
+ readonly chain: v.LiteralSchema<"bitcoin", undefined>;
2065
+ readonly type: v.EnumSchema<typeof BitcoinNetworkType, undefined>;
2066
+ readonly name: v.StringSchema<undefined>;
2067
+ readonly rpcUrl: v.StringSchema<undefined>;
2068
+ readonly rpcFallbackUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2069
+ readonly indexerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2070
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2071
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2072
+ }, undefined>, v.ObjectSchema<{
2073
+ readonly chain: v.LiteralSchema<"stacks", undefined>;
2074
+ readonly name: v.StringSchema<undefined>;
2075
+ readonly type: v.EnumSchema<typeof StacksNetworkType, undefined>;
2076
+ readonly rpcUrl: v.StringSchema<undefined>;
2077
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2078
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2079
+ }, undefined>, v.ObjectSchema<{
2080
+ readonly chain: v.LiteralSchema<"starknet", undefined>;
2081
+ readonly name: v.StringSchema<undefined>;
2082
+ readonly type: v.EnumSchema<typeof StarknetNetworkType, undefined>;
2083
+ readonly rpcUrl: v.StringSchema<undefined>;
2084
+ readonly blockExplorerUrl: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
2085
+ readonly switch: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
2086
+ }, undefined>], undefined>;
2087
+ readonly id: v.StringSchema<undefined>;
2088
+ readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
2089
+ }, undefined>;
2090
+ type AddNetworkRequestMessage = v.InferOutput<typeof addNetworkRequestMessageSchema>;
2091
+ declare const addNetworkResultSchema: v.ObjectSchema<{
2092
+ readonly id: v.StringSchema<undefined>;
2093
+ }, undefined>;
2094
+ type AddNetworkResult = v.InferOutput<typeof addNetworkResultSchema>;
2095
+ type AddNetwork = MethodParamsAndResult<AddNetworkParams, AddNetworkResult>;
2096
+
2097
+ declare const walletTypes: readonly ["software", "ledger", "keystone"];
2098
+ declare const walletTypeSchema: v.PicklistSchema<readonly ["software", "ledger", "keystone"], undefined>;
2099
+ type WalletType = v.InferOutput<typeof walletTypeSchema>;
2100
+
2101
+ type StxRequests = {
2102
+ stx_callContract: StxCallContract;
2103
+ stx_deployContract: StxDeployContract;
2104
+ stx_getAccounts: StxGetAccounts;
2105
+ stx_getAddresses: StxGetAddresses;
2106
+ stx_signMessage: StxSignMessage;
2107
+ stx_signStructuredMessage: StxSignStructuredMessage;
2108
+ stx_signTransaction: StxSignTransaction;
2109
+ stx_transferStx: StxTransferStx;
2110
+ stx_signTransactions: StxSignTransactions;
2132
2111
  };
2133
- type AddListener = (arg: ListenerInfo) => () => void;
2134
- interface BaseBitcoinProvider {
2135
- request: <Method extends keyof Requests>(method: Method, options: Params<Method>, providerId?: string) => Promise<RpcResponse<Method>>;
2136
- connect: (request: string) => Promise<GetAddressResponse>;
2137
- signMessage: (request: string) => Promise<SignMessageResponse>;
2138
- signTransaction: (request: string) => Promise<SignTransactionResponse>;
2139
- sendBtcTransaction: (request: string) => Promise<SendBtcTransactionResponse>;
2140
- createInscription: (request: string) => Promise<CreateInscriptionResponse>;
2141
- createRepeatInscriptions: (request: string) => Promise<CreateRepeatInscriptionsResponse>;
2142
- signMultipleTransactions: (request: string) => Promise<SignMultipleTransactionsResponse>;
2143
- addListener: AddListener;
2144
- }
2145
- type Capability = keyof BaseBitcoinProvider;
2146
- interface BitcoinProvider extends BaseBitcoinProvider {
2147
- getCapabilities?: (request: string) => Promise<GetCapabilitiesResponse>;
2148
- }
2149
- interface Provider {
2150
- id: string;
2151
- name: string;
2152
- icon: string;
2153
- webUrl?: string;
2154
- chromeWebStoreUrl?: string;
2155
- mozillaAddOnsUrl?: string;
2156
- googlePlayStoreUrl?: string;
2157
- iOSAppStoreUrl?: string;
2158
- methods?: (StxRequestMethod | BtcRequestMethod | RunesRequestMethod | OrdinalsRequestMethod)[];
2159
- }
2160
- interface SupportedWallet extends Provider {
2161
- isInstalled: boolean;
2162
- }
2163
- declare global {
2164
- interface XverseProviders {
2165
- BitcoinProvider?: BitcoinProvider;
2166
- }
2167
- interface Window {
2168
- BitcoinProvider?: BitcoinProvider;
2169
- XverseProviders?: XverseProviders;
2170
- btc_providers?: Provider[];
2171
- }
2172
- }
2112
+ type StxRequestMethod = keyof StxRequests;
2113
+ type SparkRequests = {
2114
+ [sparkGetAddressesMethodName]: SparkGetAddresses;
2115
+ [sparkGetBalanceMethodName]: SparkGetBalance;
2116
+ [sparkTransferMethodName]: SparkTransfer;
2117
+ [sparkTransferTokenMethodName]: SparkTransferToken;
2118
+ };
2119
+ type SparkRequestMethod = keyof SparkRequests;
2120
+ type BtcRequests = {
2121
+ getInfo: GetInfo;
2122
+ getAddresses: GetAddresses;
2123
+ getAccounts: GetAccounts;
2124
+ getBalance: GetBalance;
2125
+ signMessage: SignMessage;
2126
+ sendTransfer: SendTransfer;
2127
+ signPsbt: SignPsbt;
2128
+ };
2129
+ type BtcRequestMethod = keyof BtcRequests;
2130
+ type RunesRequests = {
2131
+ runes_estimateEtch: RunesEstimateEtch;
2132
+ runes_estimateMint: RunesEstimateMint;
2133
+ runes_estimateRbfOrder: RunesEstimateRbfOrder;
2134
+ runes_etch: RunesEtch;
2135
+ runes_getBalance: RunesGetBalance;
2136
+ runes_getOrder: RunesGetOrder;
2137
+ runes_mint: RunesMint;
2138
+ runes_rbfOrder: RunesRbfOrder;
2139
+ runes_transfer: RunesTransfer;
2140
+ };
2141
+ type RunesRequestMethod = keyof RunesRequests;
2142
+ type OrdinalsRequests = {
2143
+ ord_getInscriptions: GetInscriptions;
2144
+ ord_sendInscriptions: SendInscriptions;
2145
+ };
2146
+ type OrdinalsRequestMethod = keyof OrdinalsRequests;
2147
+ type WalletRequests = {
2148
+ wallet_addNetwork: AddNetwork;
2149
+ wallet_changeNetwork: ChangeNetwork;
2150
+ wallet_changeNetworkById: ChangeNetworkById;
2151
+ wallet_connect: Connect;
2152
+ wallet_disconnect: Disconnect;
2153
+ wallet_getAccount: GetAccount;
2154
+ wallet_getCurrentPermissions: GetCurrentPermissions;
2155
+ wallet_getNetwork: GetNetwork;
2156
+ wallet_getWalletType: GetWalletType;
2157
+ wallet_renouncePermissions: RenouncePermissions;
2158
+ wallet_requestPermissions: RequestPermissions;
2159
+ };
2160
+ type Requests = BtcRequests & StxRequests & SparkRequests & RunesRequests & WalletRequests & OrdinalsRequests;
2161
+ type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
2162
+ type Params<Method> = Method extends keyof Requests ? Requests[Method]['params'] : never;
2173
2163
 
2174
- declare function getProviderOrThrow(getProvider?: () => Promise<BitcoinProvider | undefined>): Promise<BitcoinProvider>;
2175
- declare function getProviders(): Provider[];
2176
- declare function getProviderById(providerId: string): any;
2177
- declare function isProviderInstalled(providerId: string): boolean;
2178
- declare function setDefaultProvider(providerId: string): void;
2179
- declare function getDefaultProvider(): string | null;
2180
- declare function removeDefaultProvider(): void;
2181
- declare function getSupportedWallets(): SupportedWallet[];
2164
+ declare const request: <Method extends keyof Requests>(method: Method, params: Params<Method>,
2165
+ /**
2166
+ * The providerId is the object path to the provider in the window object.
2167
+ * E.g., a provider available at `window.Foo.BarProvider` would have a
2168
+ * providerId of `Foo.BarProvider`.
2169
+ */
2170
+ providerId?: string) => Promise<RpcResult<Method>>;
2171
+ /**
2172
+ * Adds an event listener.
2173
+ *
2174
+ * Currently expects 2 arguments, although is also capable of handling legacy
2175
+ * calls with 3 arguments consisting of:
2176
+ *
2177
+ * - event name (string)
2178
+ * - callback (function)
2179
+ * - provider ID (optional string)
2180
+ */
2181
+ declare const addListener: (...rawArgs: unknown[]) => ReturnType<AddListener>;
2182
2182
 
2183
2183
  declare abstract class SatsConnectAdapter {
2184
2184
  abstract readonly id: string;