@sats-connect/core 0.0.11-2768523 → 0.0.11-2e5bcfe
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 +52 -37
- package/dist/index.mjs +80 -49
- 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 = "runes_getBalance";
|
|
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<"runes_getBalance", 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
|
/**
|
|
@@ -813,26 +828,26 @@ type SignTransactionParams = Transaction & Partial<Pubkey>;
|
|
|
813
828
|
type SignTransactionResult = Transaction;
|
|
814
829
|
type StxSignTransaction = MethodParamsAndResult<SignTransactionParams, SignTransactionResult>;
|
|
815
830
|
|
|
816
|
-
declare const
|
|
817
|
-
declare const
|
|
818
|
-
declare const
|
|
819
|
-
declare const
|
|
820
|
-
readonly method: v.LiteralSchema<"
|
|
831
|
+
declare const requestPermissionsMethodName = "wallet_requestPermissions";
|
|
832
|
+
declare const requestPermissionsParamsSchema: v.UndefinedSchema<undefined>;
|
|
833
|
+
declare const requestPermissionsResultSchema: v.LiteralSchema<true, undefined>;
|
|
834
|
+
declare const requestPermissionsRequestMessageSchema: v.ObjectSchema<{
|
|
835
|
+
readonly method: v.LiteralSchema<"wallet_requestPermissions", undefined>;
|
|
821
836
|
readonly params: v.UndefinedSchema<undefined>;
|
|
822
837
|
readonly id: v.StringSchema<undefined>;
|
|
823
838
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
824
839
|
}, undefined>;
|
|
825
|
-
type
|
|
826
|
-
declare const
|
|
827
|
-
declare const
|
|
828
|
-
declare const
|
|
829
|
-
declare const
|
|
830
|
-
readonly method: v.LiteralSchema<"
|
|
840
|
+
type RequestPermissions = MethodParamsAndResult<v.InferOutput<typeof requestPermissionsParamsSchema>, v.InferOutput<typeof requestPermissionsResultSchema>>;
|
|
841
|
+
declare const renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
842
|
+
declare const renouncePermissionsParamsSchema: v.UndefinedSchema<undefined>;
|
|
843
|
+
declare const renouncePermissionsResultSchema: v.LiteralSchema<true, undefined>;
|
|
844
|
+
declare const renouncePermissionsRequestMessageSchema: v.ObjectSchema<{
|
|
845
|
+
readonly method: v.LiteralSchema<"wallet_renouncePermissions", undefined>;
|
|
831
846
|
readonly params: v.UndefinedSchema<undefined>;
|
|
832
847
|
readonly id: v.StringSchema<undefined>;
|
|
833
848
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
834
849
|
}, undefined>;
|
|
835
|
-
type
|
|
850
|
+
type RenouncePermissions = MethodParamsAndResult<v.InferOutput<typeof renouncePermissionsParamsSchema>, v.InferOutput<typeof renouncePermissionsResultSchema>>;
|
|
836
851
|
|
|
837
852
|
interface StxRequests {
|
|
838
853
|
stx_callContract: StxCallContract;
|
|
@@ -867,8 +882,8 @@ interface RunesRequests {
|
|
|
867
882
|
}
|
|
868
883
|
type RunesRequestMethod = keyof RunesRequests;
|
|
869
884
|
interface WalletMethods {
|
|
870
|
-
|
|
871
|
-
|
|
885
|
+
wallet_requestPermissions: RequestPermissions;
|
|
886
|
+
wallet_renouncePermissions: RenouncePermissions;
|
|
872
887
|
}
|
|
873
888
|
type Requests = BtcRequests & StxRequests & RunesRequests & WalletMethods;
|
|
874
889
|
type Return<Method> = Method extends keyof Requests ? Requests[Method]['result'] : never;
|
|
@@ -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
|
|
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 CreateInscriptionOptions, type CreateInscriptionPayload, type CreateInscriptionResponse, type CreateRepeatInscriptionsOptions, type CreateRepeatInscriptionsPayload, type CreateRepeatInscriptionsResponse, DefaultAdaptersInfo, type DeployContractParams, type DeployContractResult, 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 RenouncePermissions, type RequestOptions, type RequestPayload, type RequestPermissions, 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, createInscription, createRepeatInscriptions, defaultAdapters, 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, renouncePermissionsMethodName, renouncePermissionsParamsSchema, renouncePermissionsRequestMessageSchema, renouncePermissionsResultSchema, request, requestPermissionsMethodName, requestPermissionsParamsSchema, requestPermissionsRequestMessageSchema, requestPermissionsResultSchema, 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),
|
|
@@ -695,29 +700,53 @@ var getBalanceSchema = v3.object({
|
|
|
695
700
|
|
|
696
701
|
// src/request/types/walletMethods.ts
|
|
697
702
|
import * as v4 from "valibot";
|
|
698
|
-
var
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
var
|
|
703
|
+
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
704
|
+
var requestPermissionsParamsSchema = v4.undefined();
|
|
705
|
+
var requestPermissionsResultSchema = v4.literal(true);
|
|
706
|
+
var requestPermissionsRequestMessageSchema = v4.object({
|
|
702
707
|
...rpcRequestMessageSchema.entries,
|
|
703
708
|
...v4.object({
|
|
704
|
-
method: v4.literal(
|
|
705
|
-
params:
|
|
709
|
+
method: v4.literal(requestPermissionsMethodName),
|
|
710
|
+
params: requestPermissionsParamsSchema,
|
|
706
711
|
id: v4.string()
|
|
707
712
|
}).entries
|
|
708
713
|
});
|
|
709
|
-
var
|
|
710
|
-
var
|
|
711
|
-
var
|
|
712
|
-
var
|
|
714
|
+
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
715
|
+
var renouncePermissionsParamsSchema = v4.undefined();
|
|
716
|
+
var renouncePermissionsResultSchema = v4.literal(true);
|
|
717
|
+
var renouncePermissionsRequestMessageSchema = v4.object({
|
|
713
718
|
...rpcRequestMessageSchema.entries,
|
|
714
719
|
...v4.object({
|
|
715
|
-
method: v4.literal(
|
|
716
|
-
params:
|
|
720
|
+
method: v4.literal(renouncePermissionsMethodName),
|
|
721
|
+
params: renouncePermissionsParamsSchema,
|
|
717
722
|
id: v4.string()
|
|
718
723
|
}).entries
|
|
719
724
|
});
|
|
720
725
|
|
|
726
|
+
// src/request/types/runesMethods.ts
|
|
727
|
+
import * as v5 from "valibot";
|
|
728
|
+
var getRunesBalanceMethodName = "runes_getBalance";
|
|
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
|
|
|
@@ -1172,17 +1199,9 @@ export {
|
|
|
1172
1199
|
RpcIdSchema,
|
|
1173
1200
|
SatsConnectAdapter,
|
|
1174
1201
|
addressSchema,
|
|
1175
|
-
connectMethodName,
|
|
1176
|
-
connectParamsSchema,
|
|
1177
|
-
connectResultSchema,
|
|
1178
|
-
connectSchema,
|
|
1179
1202
|
createInscription,
|
|
1180
1203
|
createRepeatInscriptions,
|
|
1181
1204
|
defaultAdapters,
|
|
1182
|
-
disconnectMethodName,
|
|
1183
|
-
disconnectParamsSchema,
|
|
1184
|
-
disconnectResultSchema,
|
|
1185
|
-
disconnectSchema,
|
|
1186
1205
|
getAccountsMethodName,
|
|
1187
1206
|
getAccountsParamsSchema,
|
|
1188
1207
|
getAccountsRequestMessageSchema,
|
|
@@ -1194,8 +1213,8 @@ export {
|
|
|
1194
1213
|
getAddressesResultSchema,
|
|
1195
1214
|
getBalanceMethodName,
|
|
1196
1215
|
getBalanceParamsSchema,
|
|
1216
|
+
getBalanceRequestMessageSchema,
|
|
1197
1217
|
getBalanceResultSchema,
|
|
1198
|
-
getBalanceSchema,
|
|
1199
1218
|
getCapabilities,
|
|
1200
1219
|
getDefaultProvider,
|
|
1201
1220
|
getInfoMethodName,
|
|
@@ -1205,10 +1224,22 @@ export {
|
|
|
1205
1224
|
getProviderById,
|
|
1206
1225
|
getProviderOrThrow,
|
|
1207
1226
|
getProviders,
|
|
1227
|
+
getRunesBalanceMethodName,
|
|
1228
|
+
getRunesBalanceParamsSchema,
|
|
1229
|
+
getRunesBalanceRequestMessageSchema,
|
|
1230
|
+
getRunesBalanceResultSchema,
|
|
1208
1231
|
getSupportedWallets,
|
|
1209
1232
|
isProviderInstalled,
|
|
1210
1233
|
removeDefaultProvider,
|
|
1234
|
+
renouncePermissionsMethodName,
|
|
1235
|
+
renouncePermissionsParamsSchema,
|
|
1236
|
+
renouncePermissionsRequestMessageSchema,
|
|
1237
|
+
renouncePermissionsResultSchema,
|
|
1211
1238
|
request,
|
|
1239
|
+
requestPermissionsMethodName,
|
|
1240
|
+
requestPermissionsParamsSchema,
|
|
1241
|
+
requestPermissionsRequestMessageSchema,
|
|
1242
|
+
requestPermissionsResultSchema,
|
|
1212
1243
|
rpcErrorResponseMessageSchema,
|
|
1213
1244
|
rpcRequestMessageSchema,
|
|
1214
1245
|
rpcResponseMessageSchema,
|