@sats-connect/core 0.0.11-2768523 → 0.0.11-4a437ed
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 +42 -27
- package/dist/index.mjs +66 -35
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -222,23 +222,26 @@ declare enum RpcErrorCode {
|
|
|
222
222
|
}
|
|
223
223
|
declare const rpcSuccessResponseMessageSchema: v.ObjectSchema<{
|
|
224
224
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
225
|
-
readonly result: v.UnknownSchema
|
|
225
|
+
readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
|
|
226
226
|
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
227
227
|
}, undefined>;
|
|
228
|
+
type RpcSuccessResponseMessage = v.InferOutput<typeof rpcSuccessResponseMessageSchema>;
|
|
228
229
|
declare const rpcErrorResponseMessageSchema: v.ObjectSchema<{
|
|
229
230
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
230
|
-
readonly error: v.UnknownSchema
|
|
231
|
+
readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
|
|
231
232
|
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
232
233
|
}, undefined>;
|
|
234
|
+
type RpcErrorResponseMessage = v.InferOutput<typeof rpcErrorResponseMessageSchema>;
|
|
233
235
|
declare const rpcResponseMessageSchema: v.UnionSchema<[v.ObjectSchema<{
|
|
234
236
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
235
|
-
readonly result: v.UnknownSchema
|
|
237
|
+
readonly result: v.NonOptionalSchema<v.UnknownSchema, undefined>;
|
|
236
238
|
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
237
239
|
}, undefined>, v.ObjectSchema<{
|
|
238
240
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
239
|
-
readonly error: v.UnknownSchema
|
|
241
|
+
readonly error: v.NonOptionalSchema<v.UnknownSchema, undefined>;
|
|
240
242
|
readonly id: v.OptionalSchema<v.UnionSchema<[v.StringSchema<undefined>, v.NumberSchema<undefined>, v.NullSchema<undefined>], undefined>, never>;
|
|
241
243
|
}, undefined>], undefined>;
|
|
244
|
+
type RpcResponseMessage = v.InferOutput<typeof rpcResponseMessageSchema>;
|
|
242
245
|
interface RpcError {
|
|
243
246
|
code: number | RpcErrorCode;
|
|
244
247
|
message: string;
|
|
@@ -489,20 +492,25 @@ declare const getBalanceMethodName = "getBalance";
|
|
|
489
492
|
declare const getBalanceParamsSchema: v.UndefinedSchema<undefined>;
|
|
490
493
|
declare const getBalanceResultSchema: v.ObjectSchema<{
|
|
491
494
|
/**
|
|
492
|
-
* The confirmed balance of the wallet in sats.
|
|
495
|
+
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
496
|
+
* messages not supporting bigint
|
|
497
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
493
498
|
*/
|
|
494
|
-
readonly confirmed: v.
|
|
499
|
+
readonly confirmed: v.StringSchema<undefined>;
|
|
495
500
|
/**
|
|
496
|
-
* The unconfirmed balance of the wallet in sats.
|
|
501
|
+
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
502
|
+
* messages not supporting bigint
|
|
503
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
497
504
|
*/
|
|
498
|
-
readonly unconfirmed: v.
|
|
505
|
+
readonly unconfirmed: v.StringSchema<undefined>;
|
|
499
506
|
/**
|
|
500
507
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
501
|
-
* sats.
|
|
508
|
+
* sats. Using a string due to chrome messages not supporting bigint
|
|
509
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
502
510
|
*/
|
|
503
|
-
readonly total: v.
|
|
511
|
+
readonly total: v.StringSchema<undefined>;
|
|
504
512
|
}, undefined>;
|
|
505
|
-
declare const
|
|
513
|
+
declare const getBalanceRequestMessageSchema: v.ObjectSchema<{
|
|
506
514
|
readonly method: v.LiteralSchema<"getBalance", undefined>;
|
|
507
515
|
readonly id: v.StringSchema<undefined>;
|
|
508
516
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
@@ -621,17 +629,24 @@ interface RbfOrderResult {
|
|
|
621
629
|
fundingAddress: string;
|
|
622
630
|
}
|
|
623
631
|
type RbfOrder = MethodParamsAndResult<RbfOrderParams, RbfOrderResult>;
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
}
|
|
634
|
-
|
|
632
|
+
declare const getRunesBalanceMethodName = "getRunesBalance";
|
|
633
|
+
declare const getRunesBalanceParamsSchema: v.NullSchema<undefined>;
|
|
634
|
+
declare const getRunesBalanceResultSchema: v.ObjectSchema<{
|
|
635
|
+
readonly balances: v.ArraySchema<v.ObjectSchema<{
|
|
636
|
+
readonly runeName: v.StringSchema<undefined>;
|
|
637
|
+
readonly amount: v.StringSchema<undefined>;
|
|
638
|
+
readonly divisibility: v.NumberSchema<undefined>;
|
|
639
|
+
readonly symbol: v.StringSchema<undefined>;
|
|
640
|
+
readonly inscriptionId: v.NullishSchema<v.StringSchema<undefined>, never>;
|
|
641
|
+
}, undefined>, undefined>;
|
|
642
|
+
}, undefined>;
|
|
643
|
+
declare const getRunesBalanceRequestMessageSchema: v.ObjectSchema<{
|
|
644
|
+
readonly method: v.LiteralSchema<"getRunesBalance", undefined>;
|
|
645
|
+
readonly params: v.NullSchema<undefined>;
|
|
646
|
+
readonly id: v.StringSchema<undefined>;
|
|
647
|
+
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
648
|
+
}, undefined>;
|
|
649
|
+
type GetRunesBalance = MethodParamsAndResult<v.InferOutput<typeof getRunesBalanceParamsSchema>, v.InferOutput<typeof getRunesBalanceResultSchema>>;
|
|
635
650
|
|
|
636
651
|
interface Pubkey {
|
|
637
652
|
/**
|
|
@@ -815,8 +830,8 @@ type StxSignTransaction = MethodParamsAndResult<SignTransactionParams, SignTrans
|
|
|
815
830
|
|
|
816
831
|
declare const connectMethodName = "wallet_connect";
|
|
817
832
|
declare const connectParamsSchema: v.UndefinedSchema<undefined>;
|
|
818
|
-
declare const connectResultSchema: v.
|
|
819
|
-
declare const
|
|
833
|
+
declare const connectResultSchema: v.LiteralSchema<true, undefined>;
|
|
834
|
+
declare const connectRequestMessageSchema: v.ObjectSchema<{
|
|
820
835
|
readonly method: v.LiteralSchema<"wallet_connect", undefined>;
|
|
821
836
|
readonly params: v.UndefinedSchema<undefined>;
|
|
822
837
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -825,8 +840,8 @@ declare const connectSchema: v.ObjectSchema<{
|
|
|
825
840
|
type Connect = MethodParamsAndResult<v.InferOutput<typeof connectParamsSchema>, v.InferOutput<typeof connectResultSchema>>;
|
|
826
841
|
declare const disconnectMethodName = "wallet_disconnect";
|
|
827
842
|
declare const disconnectParamsSchema: v.UndefinedSchema<undefined>;
|
|
828
|
-
declare const disconnectResultSchema: v.
|
|
829
|
-
declare const
|
|
843
|
+
declare const disconnectResultSchema: v.LiteralSchema<true, undefined>;
|
|
844
|
+
declare const disconnectRequestMessageSchema: v.ObjectSchema<{
|
|
830
845
|
readonly method: v.LiteralSchema<"wallet_disconnect", undefined>;
|
|
831
846
|
readonly params: v.UndefinedSchema<undefined>;
|
|
832
847
|
readonly id: v.StringSchema<undefined>;
|
|
@@ -898,4 +913,4 @@ declare class BaseAdapter extends SatsConnectAdapter {
|
|
|
898
913
|
declare const DefaultAdaptersInfo: Record<string, Provider>;
|
|
899
914
|
declare const defaultAdapters: Record<string, new () => SatsConnectAdapter>;
|
|
900
915
|
|
|
901
|
-
export { type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type Connect, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type Disconnect, type GetAccounts, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesResult, type GetBalance, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type InputToSign, type MethodParamsAndResult, type Params, type Provider, type PsbtPayload, type Recipient$2 as Recipient, type RequestOptions, type RequestPayload, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResult, type RpcSuccessResponse, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessagePayload, type SignMessageResponse, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionParams, type SignTransactionPayload, type SignTransactionResponse, type SignTransactionResult, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAddresses, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type WalletMethods, addressSchema, connectMethodName, connectParamsSchema,
|
|
916
|
+
export { type Address$1 as Address, AddressPurpose, AddressType, BaseAdapter, type BitcoinNetwork, BitcoinNetworkType, type BitcoinProvider, type BtcRequestMethod, type BtcRequests, type CallContractParams, type CallContractResult, type Capability, type Connect, type CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, type Disconnect, type EstimateRbfOrder, type EstimateRunesEtch, type EstimateRunesEtchParams, type EstimateRunesEtchResult, type EstimateRunesMint, type EstimateRunesMintParams, type EstimateRunesMintResult, type EtchRunes, type EtchRunesParams, type EtchRunesResult, type GetAccounts, type GetAccountsResult, type GetAddressOptions, type GetAddressPayload, type GetAddressResponse, type GetAddresses, type GetAddressesParams, type GetAddressesResult, type GetBalance, type GetCapabilitiesOptions, type GetCapabilitiesPayload, type GetCapabilitiesResponse, type GetInfo, type GetOrder, type GetRunesBalance, type InputToSign, type MethodParamsAndResult, type MintRunes, type MintRunesParams, type MintRunesResult, type Params, type Provider, type PsbtPayload, type RbfOrder, type Recipient$2 as Recipient, type RequestOptions, type RequestPayload, type Requests, type Return, type RpcBase, type RpcError, RpcErrorCode, type RpcErrorResponse, type RpcErrorResponseMessage, type RpcId, RpcIdSchema, type RpcRequest, type RpcRequestMessage, type RpcResponse, type RpcResponseMessage, type RpcResult, type RpcSuccessResponse, type RpcSuccessResponseMessage, type RunesRequestMethod, type RunesRequests, SatsConnectAdapter, type SendBtcTransactionOptions, type SendBtcTransactionPayload, type SendBtcTransactionResponse, type SendTransfer, type SendTransferParams, type SerializedRecipient, type SerializedSendBtcTransactionPayload, type SignMessage, type SignMessageOptions, type SignMessagePayload, type SignMessageResponse, type SignMultiplePsbtPayload, type SignMultipleTransactionOptions, type SignMultipleTransactionsPayload, type SignMultipleTransactionsResponse, type SignPsbt, type SignPsbtParams, type SignPsbtResult, type SignStructuredMessageResult, type SignStxMessageParams, type SignStxMessageResult, type SignTransactionOptions, type SignTransactionParams, type SignTransactionPayload, type SignTransactionResponse, type SignTransactionResult, type StxCallContract, type StxDeployContract, type StxGetAccounts, type StxGetAddresses, type StxRequestMethod, type StxRequests, type StxSignStructuredMessage, type StxSignStxMessage, type StxSignTransaction, type StxTransferStx, type SupportedWallet, type TransferStxParams, type TransferStxResult, type WalletMethods, addressSchema, connectMethodName, connectParamsSchema, connectRequestMessageSchema, connectResultSchema, createInscription, createRepeatInscriptions, defaultAdapters, disconnectMethodName, disconnectParamsSchema, disconnectRequestMessageSchema, disconnectResultSchema, getAccountsMethodName, getAccountsParamsSchema, getAccountsRequestMessageSchema, getAccountsResultSchema, getAddress, getAddressesMethodName, getAddressesParamsSchema, getAddressesRequestMessageSchema, getAddressesResultSchema, getBalanceMethodName, getBalanceParamsSchema, getBalanceRequestMessageSchema, getBalanceResultSchema, getCapabilities, getDefaultProvider, getInfoMethodName, getInfoParamsSchema, getInfoResultSchema, getInfoSchema, getProviderById, getProviderOrThrow, getProviders, getRunesBalanceMethodName, getRunesBalanceParamsSchema, getRunesBalanceRequestMessageSchema, getRunesBalanceResultSchema, getSupportedWallets, isProviderInstalled, removeDefaultProvider, request, rpcErrorResponseMessageSchema, rpcRequestMessageSchema, rpcResponseMessageSchema, rpcSuccessResponseMessageSchema, sendBtcTransaction, setDefaultProvider, signMessage, signMessageMethodName, signMessageParamsSchema, signMessageRequestMessageSchema, signMessageResultSchema, signMultipleTransactions, signTransaction };
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// src/types.ts
|
|
2
2
|
import * as v from "valibot";
|
|
3
|
-
var BitcoinNetworkType = /* @__PURE__ */ ((
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return
|
|
3
|
+
var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType3) => {
|
|
4
|
+
BitcoinNetworkType3["Mainnet"] = "Mainnet";
|
|
5
|
+
BitcoinNetworkType3["Testnet"] = "Testnet";
|
|
6
|
+
BitcoinNetworkType3["Signet"] = "Signet";
|
|
7
|
+
return BitcoinNetworkType3;
|
|
8
8
|
})(BitcoinNetworkType || {});
|
|
9
9
|
var RpcIdSchema = v.optional(v.union([v.string(), v.number(), v.null()]));
|
|
10
10
|
var rpcRequestMessageSchema = v.object({
|
|
@@ -36,12 +36,12 @@ var RpcErrorCode = /* @__PURE__ */ ((RpcErrorCode2) => {
|
|
|
36
36
|
})(RpcErrorCode || {});
|
|
37
37
|
var rpcSuccessResponseMessageSchema = v.object({
|
|
38
38
|
jsonrpc: v.literal("2.0"),
|
|
39
|
-
result: v.unknown(),
|
|
39
|
+
result: v.nonOptional(v.unknown()),
|
|
40
40
|
id: RpcIdSchema
|
|
41
41
|
});
|
|
42
42
|
var rpcErrorResponseMessageSchema = v.object({
|
|
43
43
|
jsonrpc: v.literal("2.0"),
|
|
44
|
-
error: v.unknown(),
|
|
44
|
+
error: v.nonOptional(v.unknown()),
|
|
45
45
|
id: RpcIdSchema
|
|
46
46
|
});
|
|
47
47
|
var rpcResponseMessageSchema = v.union([
|
|
@@ -526,7 +526,7 @@ function getSupportedWallets() {
|
|
|
526
526
|
}
|
|
527
527
|
|
|
528
528
|
// src/request/index.ts
|
|
529
|
-
import * as
|
|
529
|
+
import * as v6 from "valibot";
|
|
530
530
|
|
|
531
531
|
// src/addresses/index.ts
|
|
532
532
|
import { createUnsecuredToken } from "jsontokens";
|
|
@@ -672,20 +672,25 @@ var getBalanceMethodName = "getBalance";
|
|
|
672
672
|
var getBalanceParamsSchema = v3.undefined();
|
|
673
673
|
var getBalanceResultSchema = v3.object({
|
|
674
674
|
/**
|
|
675
|
-
* The confirmed balance of the wallet in sats.
|
|
675
|
+
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
676
|
+
* messages not supporting bigint
|
|
677
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
676
678
|
*/
|
|
677
|
-
confirmed: v3.
|
|
679
|
+
confirmed: v3.string(),
|
|
678
680
|
/**
|
|
679
|
-
* The unconfirmed balance of the wallet in sats.
|
|
681
|
+
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
682
|
+
* messages not supporting bigint
|
|
683
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
680
684
|
*/
|
|
681
|
-
unconfirmed: v3.
|
|
685
|
+
unconfirmed: v3.string(),
|
|
682
686
|
/**
|
|
683
687
|
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
684
|
-
* sats.
|
|
688
|
+
* sats. Using a string due to chrome messages not supporting bigint
|
|
689
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
685
690
|
*/
|
|
686
|
-
total: v3.
|
|
691
|
+
total: v3.string()
|
|
687
692
|
});
|
|
688
|
-
var
|
|
693
|
+
var getBalanceRequestMessageSchema = v3.object({
|
|
689
694
|
...rpcRequestMessageSchema.entries,
|
|
690
695
|
...v3.object({
|
|
691
696
|
method: v3.literal(getBalanceMethodName),
|
|
@@ -697,8 +702,8 @@ var getBalanceSchema = v3.object({
|
|
|
697
702
|
import * as v4 from "valibot";
|
|
698
703
|
var connectMethodName = "wallet_connect";
|
|
699
704
|
var connectParamsSchema = v4.undefined();
|
|
700
|
-
var connectResultSchema = v4.
|
|
701
|
-
var
|
|
705
|
+
var connectResultSchema = v4.literal(true);
|
|
706
|
+
var connectRequestMessageSchema = v4.object({
|
|
702
707
|
...rpcRequestMessageSchema.entries,
|
|
703
708
|
...v4.object({
|
|
704
709
|
method: v4.literal(connectMethodName),
|
|
@@ -708,8 +713,8 @@ var connectSchema = v4.object({
|
|
|
708
713
|
});
|
|
709
714
|
var disconnectMethodName = "wallet_disconnect";
|
|
710
715
|
var disconnectParamsSchema = v4.undefined();
|
|
711
|
-
var disconnectResultSchema = v4.
|
|
712
|
-
var
|
|
716
|
+
var disconnectResultSchema = v4.literal(true);
|
|
717
|
+
var disconnectRequestMessageSchema = v4.object({
|
|
713
718
|
...rpcRequestMessageSchema.entries,
|
|
714
719
|
...v4.object({
|
|
715
720
|
method: v4.literal(disconnectMethodName),
|
|
@@ -718,6 +723,30 @@ var disconnectSchema = v4.object({
|
|
|
718
723
|
}).entries
|
|
719
724
|
});
|
|
720
725
|
|
|
726
|
+
// src/request/types/runesMethods.ts
|
|
727
|
+
import * as v5 from "valibot";
|
|
728
|
+
var getRunesBalanceMethodName = "getRunesBalance";
|
|
729
|
+
var getRunesBalanceParamsSchema = v5.null();
|
|
730
|
+
var getRunesBalanceResultSchema = v5.object({
|
|
731
|
+
balances: v5.array(
|
|
732
|
+
v5.object({
|
|
733
|
+
runeName: v5.string(),
|
|
734
|
+
amount: v5.string(),
|
|
735
|
+
divisibility: v5.number(),
|
|
736
|
+
symbol: v5.string(),
|
|
737
|
+
inscriptionId: v5.nullish(v5.string())
|
|
738
|
+
})
|
|
739
|
+
)
|
|
740
|
+
});
|
|
741
|
+
var getRunesBalanceRequestMessageSchema = v5.object({
|
|
742
|
+
...rpcRequestMessageSchema.entries,
|
|
743
|
+
...v5.object({
|
|
744
|
+
method: v5.literal(getRunesBalanceMethodName),
|
|
745
|
+
params: getRunesBalanceParamsSchema,
|
|
746
|
+
id: v5.string()
|
|
747
|
+
}).entries
|
|
748
|
+
});
|
|
749
|
+
|
|
721
750
|
// src/request/index.ts
|
|
722
751
|
var request = async (method, params, providerId) => {
|
|
723
752
|
let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
|
|
@@ -731,27 +760,25 @@ var request = async (method, params, providerId) => {
|
|
|
731
760
|
throw new Error("A wallet method is required");
|
|
732
761
|
}
|
|
733
762
|
const response = await provider.request(method, params);
|
|
734
|
-
|
|
735
|
-
if (!parseResult.success) {
|
|
763
|
+
if (v6.is(rpcErrorResponseMessageSchema, response)) {
|
|
736
764
|
return {
|
|
737
765
|
status: "error",
|
|
738
|
-
error:
|
|
739
|
-
code: -32603 /* INTERNAL_ERROR */,
|
|
740
|
-
message: "Received unknown response from provider.",
|
|
741
|
-
data: response
|
|
742
|
-
}
|
|
766
|
+
error: response.error
|
|
743
767
|
};
|
|
744
768
|
}
|
|
745
|
-
|
|
746
|
-
if ("error" in parsedResponse) {
|
|
769
|
+
if (v6.is(rpcSuccessResponseMessageSchema, response)) {
|
|
747
770
|
return {
|
|
748
|
-
status: "
|
|
749
|
-
|
|
771
|
+
status: "success",
|
|
772
|
+
result: response.result
|
|
750
773
|
};
|
|
751
774
|
}
|
|
752
775
|
return {
|
|
753
|
-
status: "
|
|
754
|
-
|
|
776
|
+
status: "error",
|
|
777
|
+
error: {
|
|
778
|
+
code: -32603 /* INTERNAL_ERROR */,
|
|
779
|
+
message: "Received unknown response from provider.",
|
|
780
|
+
data: response
|
|
781
|
+
}
|
|
755
782
|
};
|
|
756
783
|
};
|
|
757
784
|
|
|
@@ -1174,15 +1201,15 @@ export {
|
|
|
1174
1201
|
addressSchema,
|
|
1175
1202
|
connectMethodName,
|
|
1176
1203
|
connectParamsSchema,
|
|
1204
|
+
connectRequestMessageSchema,
|
|
1177
1205
|
connectResultSchema,
|
|
1178
|
-
connectSchema,
|
|
1179
1206
|
createInscription,
|
|
1180
1207
|
createRepeatInscriptions,
|
|
1181
1208
|
defaultAdapters,
|
|
1182
1209
|
disconnectMethodName,
|
|
1183
1210
|
disconnectParamsSchema,
|
|
1211
|
+
disconnectRequestMessageSchema,
|
|
1184
1212
|
disconnectResultSchema,
|
|
1185
|
-
disconnectSchema,
|
|
1186
1213
|
getAccountsMethodName,
|
|
1187
1214
|
getAccountsParamsSchema,
|
|
1188
1215
|
getAccountsRequestMessageSchema,
|
|
@@ -1194,8 +1221,8 @@ export {
|
|
|
1194
1221
|
getAddressesResultSchema,
|
|
1195
1222
|
getBalanceMethodName,
|
|
1196
1223
|
getBalanceParamsSchema,
|
|
1224
|
+
getBalanceRequestMessageSchema,
|
|
1197
1225
|
getBalanceResultSchema,
|
|
1198
|
-
getBalanceSchema,
|
|
1199
1226
|
getCapabilities,
|
|
1200
1227
|
getDefaultProvider,
|
|
1201
1228
|
getInfoMethodName,
|
|
@@ -1205,6 +1232,10 @@ export {
|
|
|
1205
1232
|
getProviderById,
|
|
1206
1233
|
getProviderOrThrow,
|
|
1207
1234
|
getProviders,
|
|
1235
|
+
getRunesBalanceMethodName,
|
|
1236
|
+
getRunesBalanceParamsSchema,
|
|
1237
|
+
getRunesBalanceRequestMessageSchema,
|
|
1238
|
+
getRunesBalanceResultSchema,
|
|
1208
1239
|
getSupportedWallets,
|
|
1209
1240
|
isProviderInstalled,
|
|
1210
1241
|
removeDefaultProvider,
|