@sats-connect/core 0.4.0-68f1213 → 0.4.0-6eb2eb5
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 +255 -423
- package/dist/index.d.ts +255 -423
- package/dist/index.js +234 -121
- package/dist/index.mjs +210 -110
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -36,12 +36,14 @@ __export(src_exports, {
|
|
|
36
36
|
BitcoinNetworkType: () => BitcoinNetworkType,
|
|
37
37
|
DefaultAdaptersInfo: () => DefaultAdaptersInfo,
|
|
38
38
|
MessageSigningProtocols: () => MessageSigningProtocols,
|
|
39
|
+
PermissionRequestParams: () => PermissionRequestParams,
|
|
39
40
|
RpcErrorCode: () => RpcErrorCode,
|
|
40
41
|
RpcIdSchema: () => RpcIdSchema,
|
|
41
42
|
SatsConnectAdapter: () => SatsConnectAdapter,
|
|
42
|
-
|
|
43
|
+
accountActionsSchema: () => accountActionsSchema,
|
|
43
44
|
accountChangeEventName: () => accountChangeEventName,
|
|
44
45
|
accountChangeSchema: () => accountChangeSchema,
|
|
46
|
+
accountPermissionSchema: () => accountPermissionSchema,
|
|
45
47
|
addListener: () => addListener,
|
|
46
48
|
addressSchema: () => addressSchema,
|
|
47
49
|
connectMethodName: () => connectMethodName,
|
|
@@ -86,15 +88,11 @@ __export(src_exports, {
|
|
|
86
88
|
getInfoResultSchema: () => getInfoResultSchema,
|
|
87
89
|
getInscriptionsMethodName: () => getInscriptionsMethodName,
|
|
88
90
|
getInscriptionsParamsSchema: () => getInscriptionsParamsSchema,
|
|
91
|
+
getInscriptionsRequestMessageSchema: () => getInscriptionsRequestMessageSchema,
|
|
89
92
|
getInscriptionsResultSchema: () => getInscriptionsResultSchema,
|
|
90
|
-
getInscriptionsSchema: () => getInscriptionsSchema,
|
|
91
93
|
getProviderById: () => getProviderById,
|
|
92
94
|
getProviderOrThrow: () => getProviderOrThrow,
|
|
93
95
|
getProviders: () => getProviders,
|
|
94
|
-
getRunesBalanceMethodName: () => getRunesBalanceMethodName,
|
|
95
|
-
getRunesBalanceParamsSchema: () => getRunesBalanceParamsSchema,
|
|
96
|
-
getRunesBalanceRequestMessageSchema: () => getRunesBalanceRequestMessageSchema,
|
|
97
|
-
getRunesBalanceResultSchema: () => getRunesBalanceResultSchema,
|
|
98
96
|
getSupportedWallets: () => getSupportedWallets,
|
|
99
97
|
getWalletTypeMethodName: () => getWalletTypeMethodName,
|
|
100
98
|
getWalletTypeParamsSchema: () => getWalletTypeParamsSchema,
|
|
@@ -103,7 +101,7 @@ __export(src_exports, {
|
|
|
103
101
|
isProviderInstalled: () => isProviderInstalled,
|
|
104
102
|
networkChangeEventName: () => networkChangeEventName,
|
|
105
103
|
networkChangeSchema: () => networkChangeSchema,
|
|
106
|
-
|
|
104
|
+
permission: () => permission,
|
|
107
105
|
removeDefaultProvider: () => removeDefaultProvider,
|
|
108
106
|
renouncePermissionsMethodName: () => renouncePermissionsMethodName,
|
|
109
107
|
renouncePermissionsParamsSchema: () => renouncePermissionsParamsSchema,
|
|
@@ -118,11 +116,27 @@ __export(src_exports, {
|
|
|
118
116
|
rpcRequestMessageSchema: () => rpcRequestMessageSchema,
|
|
119
117
|
rpcResponseMessageSchema: () => rpcResponseMessageSchema,
|
|
120
118
|
rpcSuccessResponseMessageSchema: () => rpcSuccessResponseMessageSchema,
|
|
119
|
+
runesEtchMethodName: () => runesEtchMethodName,
|
|
120
|
+
runesEtchParamsSchema: () => runesEtchParamsSchema,
|
|
121
|
+
runesEtchRequestMessageSchema: () => runesEtchRequestMessageSchema,
|
|
122
|
+
runesEtchResultSchema: () => runesEtchResultSchema,
|
|
123
|
+
runesGetBalanceMethodName: () => runesGetBalanceMethodName,
|
|
124
|
+
runesGetBalanceParamsSchema: () => runesGetBalanceParamsSchema,
|
|
125
|
+
runesGetBalanceRequestMessageSchema: () => runesGetBalanceRequestMessageSchema,
|
|
126
|
+
runesGetBalanceResultSchema: () => runesGetBalanceResultSchema,
|
|
127
|
+
runesMintMethodName: () => runesMintMethodName,
|
|
128
|
+
runesMintParamsSchema: () => runesMintParamsSchema,
|
|
129
|
+
runesMintRequestMessageSchema: () => runesMintRequestMessageSchema,
|
|
130
|
+
runesMintResultSchema: () => runesMintResultSchema,
|
|
131
|
+
runesTransferMethodName: () => runesTransferMethodName,
|
|
132
|
+
runesTransferParamsSchema: () => runesTransferParamsSchema,
|
|
133
|
+
runesTransferRequestMessageSchema: () => runesTransferRequestMessageSchema,
|
|
134
|
+
runesTransferResultSchema: () => runesTransferResultSchema,
|
|
121
135
|
sendBtcTransaction: () => sendBtcTransaction,
|
|
122
136
|
sendInscriptionsMethodName: () => sendInscriptionsMethodName,
|
|
123
137
|
sendInscriptionsParamsSchema: () => sendInscriptionsParamsSchema,
|
|
138
|
+
sendInscriptionsRequestMessageSchema: () => sendInscriptionsRequestMessageSchema,
|
|
124
139
|
sendInscriptionsResultSchema: () => sendInscriptionsResultSchema,
|
|
125
|
-
sendInscriptionsSchema: () => sendInscriptionsSchema,
|
|
126
140
|
sendTransferMethodName: () => sendTransferMethodName,
|
|
127
141
|
sendTransferParamsSchema: () => sendTransferParamsSchema,
|
|
128
142
|
sendTransferRequestMessageSchema: () => sendTransferRequestMessageSchema,
|
|
@@ -171,10 +185,9 @@ __export(src_exports, {
|
|
|
171
185
|
stxTransferStxParamsSchema: () => stxTransferStxParamsSchema,
|
|
172
186
|
stxTransferStxRequestMessageSchema: () => stxTransferStxRequestMessageSchema,
|
|
173
187
|
stxTransferStxResultSchema: () => stxTransferStxResultSchema,
|
|
174
|
-
|
|
175
|
-
transferRunesParamsSchema: () => transferRunesParamsSchema,
|
|
176
|
-
transferRunesRequestSchema: () => transferRunesRequestSchema,
|
|
188
|
+
walletActionsSchema: () => walletActionsSchema,
|
|
177
189
|
walletEventSchema: () => walletEventSchema,
|
|
190
|
+
walletPermissionSchema: () => walletPermissionSchema,
|
|
178
191
|
walletTypeSchema: () => walletTypeSchema,
|
|
179
192
|
walletTypes: () => walletTypes
|
|
180
193
|
});
|
|
@@ -209,8 +222,7 @@ async function getProviderOrThrow(getProvider) {
|
|
|
209
222
|
return provider;
|
|
210
223
|
}
|
|
211
224
|
function getProviders() {
|
|
212
|
-
if (!window.btc_providers)
|
|
213
|
-
window.btc_providers = [];
|
|
225
|
+
if (!window.btc_providers) window.btc_providers = [];
|
|
214
226
|
return window.btc_providers;
|
|
215
227
|
}
|
|
216
228
|
function getProviderById(providerId) {
|
|
@@ -229,10 +241,7 @@ function removeDefaultProvider() {
|
|
|
229
241
|
localStorage.removeItem("sats-connect_defaultProvider");
|
|
230
242
|
}
|
|
231
243
|
function getSupportedWallets() {
|
|
232
|
-
const
|
|
233
|
-
const { xverse, ...defaultProviders } = DefaultAdaptersInfo;
|
|
234
|
-
const allProviders = [...ambientProviders, ...Object.values(defaultProviders)];
|
|
235
|
-
const wallets = allProviders.map((provider) => {
|
|
244
|
+
const wallets = Object.values(DefaultAdaptersInfo).map((provider) => {
|
|
236
245
|
{
|
|
237
246
|
return {
|
|
238
247
|
...provider,
|
|
@@ -245,11 +254,11 @@ function getSupportedWallets() {
|
|
|
245
254
|
|
|
246
255
|
// src/types.ts
|
|
247
256
|
var v2 = __toESM(require("valibot"));
|
|
248
|
-
var BitcoinNetworkType = /* @__PURE__ */ ((
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return
|
|
257
|
+
var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
|
|
258
|
+
BitcoinNetworkType2["Mainnet"] = "Mainnet";
|
|
259
|
+
BitcoinNetworkType2["Testnet"] = "Testnet";
|
|
260
|
+
BitcoinNetworkType2["Signet"] = "Signet";
|
|
261
|
+
return BitcoinNetworkType2;
|
|
253
262
|
})(BitcoinNetworkType || {});
|
|
254
263
|
var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
|
|
255
264
|
var rpcRequestMessageSchema = v2.object({
|
|
@@ -266,7 +275,7 @@ var rpcRequestMessageSchema = v2.object({
|
|
|
266
275
|
v2.null()
|
|
267
276
|
])
|
|
268
277
|
),
|
|
269
|
-
id: RpcIdSchema
|
|
278
|
+
id: v2.unwrap(RpcIdSchema)
|
|
270
279
|
});
|
|
271
280
|
var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
|
|
272
281
|
RpcErrorCode2[RpcErrorCode2["PARSE_ERROR"] = -32700] = "PARSE_ERROR";
|
|
@@ -295,7 +304,7 @@ var rpcResponseMessageSchema = v2.union([
|
|
|
295
304
|
]);
|
|
296
305
|
|
|
297
306
|
// src/request/index.ts
|
|
298
|
-
var
|
|
307
|
+
var v20 = __toESM(require("valibot"));
|
|
299
308
|
|
|
300
309
|
// src/request/types/stxMethods/callContract.ts
|
|
301
310
|
var v3 = __toESM(require("valibot"));
|
|
@@ -358,13 +367,13 @@ var stxDeployContractParamsSchema = v4.object({
|
|
|
358
367
|
*/
|
|
359
368
|
name: v4.string(),
|
|
360
369
|
/**
|
|
361
|
-
* The code of the Clarity contract.
|
|
370
|
+
* The source code of the Clarity contract.
|
|
362
371
|
*/
|
|
363
|
-
|
|
372
|
+
clarityCode: v4.string(),
|
|
364
373
|
/**
|
|
365
374
|
* The version of the Clarity contract.
|
|
366
375
|
*/
|
|
367
|
-
|
|
376
|
+
clarityVersion: v4.optional(v4.string())
|
|
368
377
|
});
|
|
369
378
|
var stxDeployContractResultSchema = v4.object({
|
|
370
379
|
/**
|
|
@@ -804,7 +813,6 @@ var signPsbtParamsSchema = v13.object({
|
|
|
804
813
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
805
814
|
*/
|
|
806
815
|
signInputs: v13.record(v13.string(), v13.array(v13.number())),
|
|
807
|
-
allowedSignHash: v13.optional(v13.number()),
|
|
808
816
|
/**
|
|
809
817
|
* Whether to broadcast the transaction after signing.
|
|
810
818
|
**/
|
|
@@ -889,19 +897,33 @@ var getBalanceRequestMessageSchema = v13.object({
|
|
|
889
897
|
|
|
890
898
|
// src/request/types/walletMethods.ts
|
|
891
899
|
var v14 = __toESM(require("valibot"));
|
|
892
|
-
var
|
|
893
|
-
|
|
900
|
+
var accountActionsSchema = v14.object({
|
|
901
|
+
read: v14.optional(v14.boolean())
|
|
902
|
+
});
|
|
903
|
+
var walletActionsSchema = v14.object({});
|
|
904
|
+
var accountPermissionSchema = v14.object({
|
|
905
|
+
type: v14.literal("account"),
|
|
906
|
+
resourceId: v14.string(),
|
|
907
|
+
clientId: v14.string(),
|
|
908
|
+
actions: accountActionsSchema
|
|
909
|
+
});
|
|
910
|
+
var walletPermissionSchema = v14.object({
|
|
911
|
+
type: v14.literal("wallet"),
|
|
912
|
+
resourceId: v14.string(),
|
|
913
|
+
clientId: v14.string(),
|
|
914
|
+
actions: walletActionsSchema
|
|
915
|
+
});
|
|
916
|
+
var PermissionRequestParams = v14.variant("type", [
|
|
894
917
|
v14.object({
|
|
895
|
-
...v14.omit(
|
|
896
|
-
actions: v14.partial(import_xverse_core.permissions.resources.account.accountActionsSchema)
|
|
918
|
+
...v14.omit(accountPermissionSchema, ["clientId"]).entries
|
|
897
919
|
}),
|
|
898
920
|
v14.object({
|
|
899
|
-
...v14.omit(
|
|
900
|
-
actions: v14.partial(import_xverse_core.permissions.resources.wallet.walletActionsSchema)
|
|
921
|
+
...v14.omit(walletPermissionSchema, ["clientId"]).entries
|
|
901
922
|
})
|
|
902
923
|
]);
|
|
924
|
+
var permission = v14.variant("type", [accountPermissionSchema, walletPermissionSchema]);
|
|
903
925
|
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
904
|
-
var requestPermissionsParamsSchema = v14.nullish(v14.array(
|
|
926
|
+
var requestPermissionsParamsSchema = v14.nullish(v14.array(PermissionRequestParams));
|
|
905
927
|
var requestPermissionsResultSchema = v14.literal(true);
|
|
906
928
|
var requestPermissionsRequestMessageSchema = v14.object({
|
|
907
929
|
...rpcRequestMessageSchema.entries,
|
|
@@ -946,7 +968,7 @@ var getWalletTypeRequestMessageSchema = v14.object({
|
|
|
946
968
|
});
|
|
947
969
|
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
948
970
|
var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
|
|
949
|
-
var getCurrentPermissionsResultSchema = v14.array(
|
|
971
|
+
var getCurrentPermissionsResultSchema = v14.array(permission);
|
|
950
972
|
var getCurrentPermissionsRequestMessageSchema = v14.object({
|
|
951
973
|
...rpcRequestMessageSchema.entries,
|
|
952
974
|
...v14.object({
|
|
@@ -958,7 +980,7 @@ var getCurrentPermissionsRequestMessageSchema = v14.object({
|
|
|
958
980
|
var getAccountMethodName = "wallet_getAccount";
|
|
959
981
|
var getAccountParamsSchema = v14.nullish(v14.null());
|
|
960
982
|
var getAccountResultSchema = v14.object({
|
|
961
|
-
id:
|
|
983
|
+
id: v14.string(),
|
|
962
984
|
addresses: v14.array(addressSchema),
|
|
963
985
|
walletType: walletTypeSchema
|
|
964
986
|
});
|
|
@@ -973,7 +995,11 @@ var getAccountRequestMessageSchema = v14.object({
|
|
|
973
995
|
var connectMethodName = "wallet_connect";
|
|
974
996
|
var connectParamsSchema = v14.nullish(
|
|
975
997
|
v14.object({
|
|
976
|
-
permissions: v14.optional(v14.array(
|
|
998
|
+
permissions: v14.optional(v14.array(PermissionRequestParams)),
|
|
999
|
+
addresses: v14.optional(v14.array(v14.enum(AddressPurpose))),
|
|
1000
|
+
message: v14.optional(
|
|
1001
|
+
v14.pipe(v14.string(), v14.maxLength(80, "The message must not exceed 80 characters."))
|
|
1002
|
+
)
|
|
977
1003
|
})
|
|
978
1004
|
);
|
|
979
1005
|
var connectResultSchema = getAccountResultSchema;
|
|
@@ -986,104 +1012,179 @@ var connectRequestMessageSchema = v14.object({
|
|
|
986
1012
|
}).entries
|
|
987
1013
|
});
|
|
988
1014
|
|
|
989
|
-
// src/request/types/runesMethods.ts
|
|
1015
|
+
// src/request/types/runesMethods/etch.ts
|
|
990
1016
|
var v15 = __toESM(require("valibot"));
|
|
991
|
-
var
|
|
992
|
-
var
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
)
|
|
1003
|
-
});
|
|
1004
|
-
var
|
|
1017
|
+
var runesEtchMethodName = "runes_etch";
|
|
1018
|
+
var etchTermsSchema = v15.object({
|
|
1019
|
+
amount: v15.string(),
|
|
1020
|
+
cap: v15.string(),
|
|
1021
|
+
heightStart: v15.optional(v15.string()),
|
|
1022
|
+
heightEnd: v15.optional(v15.string()),
|
|
1023
|
+
offsetStart: v15.optional(v15.string()),
|
|
1024
|
+
offsetEnd: v15.optional(v15.string())
|
|
1025
|
+
});
|
|
1026
|
+
var inscriptionDetailsSchema = v15.object({
|
|
1027
|
+
contentType: v15.string(),
|
|
1028
|
+
contentBase64: v15.string()
|
|
1029
|
+
});
|
|
1030
|
+
var runesEtchParamsSchema = v15.object({
|
|
1031
|
+
runeName: v15.string(),
|
|
1032
|
+
divisibility: v15.optional(v15.number()),
|
|
1033
|
+
symbol: v15.optional(v15.string()),
|
|
1034
|
+
premine: v15.optional(v15.string()),
|
|
1035
|
+
isMintable: v15.boolean(),
|
|
1036
|
+
delegateInscriptionId: v15.optional(v15.string()),
|
|
1037
|
+
destinationAddress: v15.string(),
|
|
1038
|
+
refundAddress: v15.string(),
|
|
1039
|
+
feeRate: v15.number(),
|
|
1040
|
+
appServiceFee: v15.optional(v15.number()),
|
|
1041
|
+
appServiceFeeAddress: v15.optional(v15.string()),
|
|
1042
|
+
terms: v15.optional(etchTermsSchema),
|
|
1043
|
+
inscriptionDetails: v15.optional(inscriptionDetailsSchema),
|
|
1044
|
+
network: v15.optional(v15.enum(BitcoinNetworkType))
|
|
1045
|
+
});
|
|
1046
|
+
var runesEtchResultSchema = v15.object({
|
|
1047
|
+
orderId: v15.string(),
|
|
1048
|
+
fundTransactionId: v15.string(),
|
|
1049
|
+
fundingAddress: v15.string()
|
|
1050
|
+
});
|
|
1051
|
+
var runesEtchRequestMessageSchema = v15.object({
|
|
1005
1052
|
...rpcRequestMessageSchema.entries,
|
|
1006
1053
|
...v15.object({
|
|
1007
|
-
method: v15.literal(
|
|
1008
|
-
params:
|
|
1054
|
+
method: v15.literal(runesEtchMethodName),
|
|
1055
|
+
params: runesEtchParamsSchema,
|
|
1009
1056
|
id: v15.string()
|
|
1010
1057
|
}).entries
|
|
1011
1058
|
});
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1059
|
+
|
|
1060
|
+
// src/request/types/runesMethods/getBalance.ts
|
|
1061
|
+
var v16 = __toESM(require("valibot"));
|
|
1062
|
+
var runesGetBalanceMethodName = "runes_getBalance";
|
|
1063
|
+
var runesGetBalanceParamsSchema = v16.nullish(v16.null());
|
|
1064
|
+
var runesGetBalanceResultSchema = v16.object({
|
|
1065
|
+
balances: v16.array(
|
|
1066
|
+
v16.object({
|
|
1067
|
+
runeName: v16.string(),
|
|
1068
|
+
amount: v16.string(),
|
|
1069
|
+
divisibility: v16.number(),
|
|
1070
|
+
symbol: v16.string(),
|
|
1071
|
+
inscriptionId: v16.nullish(v16.string())
|
|
1019
1072
|
})
|
|
1020
1073
|
)
|
|
1021
1074
|
});
|
|
1022
|
-
var
|
|
1075
|
+
var runesGetBalanceRequestMessageSchema = v16.object({
|
|
1023
1076
|
...rpcRequestMessageSchema.entries,
|
|
1024
|
-
...
|
|
1025
|
-
method:
|
|
1026
|
-
params:
|
|
1027
|
-
id:
|
|
1077
|
+
...v16.object({
|
|
1078
|
+
method: v16.literal(runesGetBalanceMethodName),
|
|
1079
|
+
params: runesGetBalanceParamsSchema,
|
|
1080
|
+
id: v16.string()
|
|
1028
1081
|
}).entries
|
|
1029
1082
|
});
|
|
1030
|
-
|
|
1031
|
-
|
|
1083
|
+
|
|
1084
|
+
// src/request/types/runesMethods/mint.ts
|
|
1085
|
+
var v17 = __toESM(require("valibot"));
|
|
1086
|
+
var runesMintMethodName = "runes_mint";
|
|
1087
|
+
var runesMintParamsSchema = v17.object({
|
|
1088
|
+
appServiceFee: v17.optional(v17.number()),
|
|
1089
|
+
appServiceFeeAddress: v17.optional(v17.string()),
|
|
1090
|
+
destinationAddress: v17.string(),
|
|
1091
|
+
feeRate: v17.number(),
|
|
1092
|
+
refundAddress: v17.string(),
|
|
1093
|
+
repeats: v17.number(),
|
|
1094
|
+
runeName: v17.string(),
|
|
1095
|
+
network: v17.optional(v17.enum(BitcoinNetworkType))
|
|
1096
|
+
});
|
|
1097
|
+
var runesMintResultSchema = v17.object({
|
|
1098
|
+
orderId: v17.string(),
|
|
1099
|
+
fundTransactionId: v17.string(),
|
|
1100
|
+
fundingAddress: v17.string()
|
|
1101
|
+
});
|
|
1102
|
+
var runesMintRequestMessageSchema = v17.object({
|
|
1103
|
+
...rpcRequestMessageSchema.entries,
|
|
1104
|
+
...v17.object({
|
|
1105
|
+
method: v17.literal(runesMintMethodName),
|
|
1106
|
+
params: runesMintParamsSchema,
|
|
1107
|
+
id: v17.string()
|
|
1108
|
+
}).entries
|
|
1109
|
+
});
|
|
1110
|
+
|
|
1111
|
+
// src/request/types/runesMethods/transfer.ts
|
|
1112
|
+
var v18 = __toESM(require("valibot"));
|
|
1113
|
+
var runesTransferMethodName = "runes_transfer";
|
|
1114
|
+
var runesTransferParamsSchema = v18.object({
|
|
1115
|
+
recipients: v18.array(
|
|
1116
|
+
v18.object({
|
|
1117
|
+
runeName: v18.string(),
|
|
1118
|
+
amount: v18.string(),
|
|
1119
|
+
address: v18.string()
|
|
1120
|
+
})
|
|
1121
|
+
)
|
|
1122
|
+
});
|
|
1123
|
+
var runesTransferResultSchema = v18.object({
|
|
1124
|
+
txid: v18.string()
|
|
1125
|
+
});
|
|
1126
|
+
var runesTransferRequestMessageSchema = v18.object({
|
|
1127
|
+
...rpcRequestMessageSchema.entries,
|
|
1128
|
+
...v18.object({
|
|
1129
|
+
method: v18.literal(runesTransferMethodName),
|
|
1130
|
+
params: runesTransferParamsSchema,
|
|
1131
|
+
id: v18.string()
|
|
1132
|
+
}).entries
|
|
1032
1133
|
});
|
|
1033
1134
|
|
|
1034
1135
|
// src/request/types/ordinalsMethods.ts
|
|
1035
|
-
var
|
|
1136
|
+
var v19 = __toESM(require("valibot"));
|
|
1036
1137
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
1037
|
-
var getInscriptionsParamsSchema =
|
|
1038
|
-
offset:
|
|
1039
|
-
limit:
|
|
1040
|
-
});
|
|
1041
|
-
var getInscriptionsResultSchema =
|
|
1042
|
-
total:
|
|
1043
|
-
limit:
|
|
1044
|
-
offset:
|
|
1045
|
-
inscriptions:
|
|
1046
|
-
|
|
1047
|
-
inscriptionId:
|
|
1048
|
-
inscriptionNumber:
|
|
1049
|
-
address:
|
|
1050
|
-
collectionName:
|
|
1051
|
-
postage:
|
|
1052
|
-
contentLength:
|
|
1053
|
-
contentType:
|
|
1054
|
-
timestamp:
|
|
1055
|
-
offset:
|
|
1056
|
-
genesisTransaction:
|
|
1057
|
-
output:
|
|
1138
|
+
var getInscriptionsParamsSchema = v19.object({
|
|
1139
|
+
offset: v19.number(),
|
|
1140
|
+
limit: v19.number()
|
|
1141
|
+
});
|
|
1142
|
+
var getInscriptionsResultSchema = v19.object({
|
|
1143
|
+
total: v19.number(),
|
|
1144
|
+
limit: v19.number(),
|
|
1145
|
+
offset: v19.number(),
|
|
1146
|
+
inscriptions: v19.array(
|
|
1147
|
+
v19.object({
|
|
1148
|
+
inscriptionId: v19.string(),
|
|
1149
|
+
inscriptionNumber: v19.string(),
|
|
1150
|
+
address: v19.string(),
|
|
1151
|
+
collectionName: v19.optional(v19.string()),
|
|
1152
|
+
postage: v19.string(),
|
|
1153
|
+
contentLength: v19.string(),
|
|
1154
|
+
contentType: v19.string(),
|
|
1155
|
+
timestamp: v19.number(),
|
|
1156
|
+
offset: v19.number(),
|
|
1157
|
+
genesisTransaction: v19.string(),
|
|
1158
|
+
output: v19.string()
|
|
1058
1159
|
})
|
|
1059
1160
|
)
|
|
1060
1161
|
});
|
|
1061
|
-
var
|
|
1162
|
+
var getInscriptionsRequestMessageSchema = v19.object({
|
|
1062
1163
|
...rpcRequestMessageSchema.entries,
|
|
1063
|
-
...
|
|
1064
|
-
method:
|
|
1164
|
+
...v19.object({
|
|
1165
|
+
method: v19.literal(getInscriptionsMethodName),
|
|
1065
1166
|
params: getInscriptionsParamsSchema,
|
|
1066
|
-
id:
|
|
1167
|
+
id: v19.string()
|
|
1067
1168
|
}).entries
|
|
1068
1169
|
});
|
|
1069
1170
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
1070
|
-
var sendInscriptionsParamsSchema =
|
|
1071
|
-
transfers:
|
|
1072
|
-
|
|
1073
|
-
address:
|
|
1074
|
-
inscriptionId:
|
|
1171
|
+
var sendInscriptionsParamsSchema = v19.object({
|
|
1172
|
+
transfers: v19.array(
|
|
1173
|
+
v19.object({
|
|
1174
|
+
address: v19.string(),
|
|
1175
|
+
inscriptionId: v19.string()
|
|
1075
1176
|
})
|
|
1076
1177
|
)
|
|
1077
1178
|
});
|
|
1078
|
-
var sendInscriptionsResultSchema =
|
|
1079
|
-
txid:
|
|
1179
|
+
var sendInscriptionsResultSchema = v19.object({
|
|
1180
|
+
txid: v19.string()
|
|
1080
1181
|
});
|
|
1081
|
-
var
|
|
1182
|
+
var sendInscriptionsRequestMessageSchema = v19.object({
|
|
1082
1183
|
...rpcRequestMessageSchema.entries,
|
|
1083
|
-
...
|
|
1084
|
-
method:
|
|
1184
|
+
...v19.object({
|
|
1185
|
+
method: v19.literal(sendInscriptionsMethodName),
|
|
1085
1186
|
params: sendInscriptionsParamsSchema,
|
|
1086
|
-
id:
|
|
1187
|
+
id: v19.string()
|
|
1087
1188
|
}).entries
|
|
1088
1189
|
});
|
|
1089
1190
|
|
|
@@ -1100,13 +1201,13 @@ var request = async (method, params, providerId) => {
|
|
|
1100
1201
|
throw new Error("A wallet method is required");
|
|
1101
1202
|
}
|
|
1102
1203
|
const response = await provider.request(method, params);
|
|
1103
|
-
if (
|
|
1204
|
+
if (v20.is(rpcErrorResponseMessageSchema, response)) {
|
|
1104
1205
|
return {
|
|
1105
1206
|
status: "error",
|
|
1106
1207
|
error: response.error
|
|
1107
1208
|
};
|
|
1108
1209
|
}
|
|
1109
|
-
if (
|
|
1210
|
+
if (v20.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1110
1211
|
return {
|
|
1111
1212
|
status: "success",
|
|
1112
1213
|
result: response.result
|
|
@@ -1862,8 +1963,7 @@ var extractOrValidateCapabilities = (provider, reportedCapabilities) => {
|
|
|
1862
1963
|
addListener: validateCapability("addListener")
|
|
1863
1964
|
};
|
|
1864
1965
|
return Object.entries(capabilityMap).reduce((acc, [capability, value]) => {
|
|
1865
|
-
if (value)
|
|
1866
|
-
return [...acc, capability];
|
|
1966
|
+
if (value) return [...acc, capability];
|
|
1867
1967
|
return acc;
|
|
1868
1968
|
}, []);
|
|
1869
1969
|
};
|
|
@@ -2055,12 +2155,14 @@ var signMultipleTransactions = async (options) => {
|
|
|
2055
2155
|
BitcoinNetworkType,
|
|
2056
2156
|
DefaultAdaptersInfo,
|
|
2057
2157
|
MessageSigningProtocols,
|
|
2158
|
+
PermissionRequestParams,
|
|
2058
2159
|
RpcErrorCode,
|
|
2059
2160
|
RpcIdSchema,
|
|
2060
2161
|
SatsConnectAdapter,
|
|
2061
|
-
|
|
2162
|
+
accountActionsSchema,
|
|
2062
2163
|
accountChangeEventName,
|
|
2063
2164
|
accountChangeSchema,
|
|
2165
|
+
accountPermissionSchema,
|
|
2064
2166
|
addListener,
|
|
2065
2167
|
addressSchema,
|
|
2066
2168
|
connectMethodName,
|
|
@@ -2105,15 +2207,11 @@ var signMultipleTransactions = async (options) => {
|
|
|
2105
2207
|
getInfoResultSchema,
|
|
2106
2208
|
getInscriptionsMethodName,
|
|
2107
2209
|
getInscriptionsParamsSchema,
|
|
2210
|
+
getInscriptionsRequestMessageSchema,
|
|
2108
2211
|
getInscriptionsResultSchema,
|
|
2109
|
-
getInscriptionsSchema,
|
|
2110
2212
|
getProviderById,
|
|
2111
2213
|
getProviderOrThrow,
|
|
2112
2214
|
getProviders,
|
|
2113
|
-
getRunesBalanceMethodName,
|
|
2114
|
-
getRunesBalanceParamsSchema,
|
|
2115
|
-
getRunesBalanceRequestMessageSchema,
|
|
2116
|
-
getRunesBalanceResultSchema,
|
|
2117
2215
|
getSupportedWallets,
|
|
2118
2216
|
getWalletTypeMethodName,
|
|
2119
2217
|
getWalletTypeParamsSchema,
|
|
@@ -2122,7 +2220,7 @@ var signMultipleTransactions = async (options) => {
|
|
|
2122
2220
|
isProviderInstalled,
|
|
2123
2221
|
networkChangeEventName,
|
|
2124
2222
|
networkChangeSchema,
|
|
2125
|
-
|
|
2223
|
+
permission,
|
|
2126
2224
|
removeDefaultProvider,
|
|
2127
2225
|
renouncePermissionsMethodName,
|
|
2128
2226
|
renouncePermissionsParamsSchema,
|
|
@@ -2137,11 +2235,27 @@ var signMultipleTransactions = async (options) => {
|
|
|
2137
2235
|
rpcRequestMessageSchema,
|
|
2138
2236
|
rpcResponseMessageSchema,
|
|
2139
2237
|
rpcSuccessResponseMessageSchema,
|
|
2238
|
+
runesEtchMethodName,
|
|
2239
|
+
runesEtchParamsSchema,
|
|
2240
|
+
runesEtchRequestMessageSchema,
|
|
2241
|
+
runesEtchResultSchema,
|
|
2242
|
+
runesGetBalanceMethodName,
|
|
2243
|
+
runesGetBalanceParamsSchema,
|
|
2244
|
+
runesGetBalanceRequestMessageSchema,
|
|
2245
|
+
runesGetBalanceResultSchema,
|
|
2246
|
+
runesMintMethodName,
|
|
2247
|
+
runesMintParamsSchema,
|
|
2248
|
+
runesMintRequestMessageSchema,
|
|
2249
|
+
runesMintResultSchema,
|
|
2250
|
+
runesTransferMethodName,
|
|
2251
|
+
runesTransferParamsSchema,
|
|
2252
|
+
runesTransferRequestMessageSchema,
|
|
2253
|
+
runesTransferResultSchema,
|
|
2140
2254
|
sendBtcTransaction,
|
|
2141
2255
|
sendInscriptionsMethodName,
|
|
2142
2256
|
sendInscriptionsParamsSchema,
|
|
2257
|
+
sendInscriptionsRequestMessageSchema,
|
|
2143
2258
|
sendInscriptionsResultSchema,
|
|
2144
|
-
sendInscriptionsSchema,
|
|
2145
2259
|
sendTransferMethodName,
|
|
2146
2260
|
sendTransferParamsSchema,
|
|
2147
2261
|
sendTransferRequestMessageSchema,
|
|
@@ -2190,10 +2304,9 @@ var signMultipleTransactions = async (options) => {
|
|
|
2190
2304
|
stxTransferStxParamsSchema,
|
|
2191
2305
|
stxTransferStxRequestMessageSchema,
|
|
2192
2306
|
stxTransferStxResultSchema,
|
|
2193
|
-
|
|
2194
|
-
transferRunesParamsSchema,
|
|
2195
|
-
transferRunesRequestSchema,
|
|
2307
|
+
walletActionsSchema,
|
|
2196
2308
|
walletEventSchema,
|
|
2309
|
+
walletPermissionSchema,
|
|
2197
2310
|
walletTypeSchema,
|
|
2198
2311
|
walletTypes
|
|
2199
2312
|
});
|