example-js-sdk 0.0.6 → 0.0.8
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/README.md +134 -52
- package/lib/OrbixSDK.d.ts +145 -0
- package/lib/{CarbonSDK.js → OrbixSDK.js} +52 -52
- package/lib/clients/ETHClient.d.ts +10 -10
- package/lib/clients/ETHClient.js +4 -4
- package/lib/clients/{CarbonQueryClient.d.ts → OrbixQueryClient.d.ts} +4 -4
- package/lib/clients/{CarbonQueryClient.js → OrbixQueryClient.js} +2 -2
- package/lib/clients/TokenClient.d.ts +26 -26
- package/lib/clients/TokenClient.js +5 -5
- package/lib/clients/index.d.ts +1 -1
- package/lib/clients/index.js +3 -3
- package/lib/codec/index.d.ts +1 -1
- package/lib/codec/index.js +253 -253
- package/lib/constant/eip712.d.ts +1 -1
- package/lib/constant/eip712.js +2 -2
- package/lib/constant/generic.d.ts +1 -1
- package/lib/constant/generic.js +2 -2
- package/lib/constant/ibc.d.ts +0 -1
- package/lib/constant/ibc.js +0 -32
- package/lib/constant/network.d.ts +2 -2
- package/lib/constant/network.js +3 -3
- package/lib/constant/node.js +2 -74
- package/lib/constant/web3Config.d.ts +5 -5
- package/lib/constant/web3Config.js +18 -22
- package/lib/index.d.ts +3 -3
- package/lib/index.js +7 -7
- package/lib/insights/balance.d.ts +2 -2
- package/lib/modules/admin.d.ts +23 -23
- package/lib/modules/admin.js +43 -43
- package/lib/modules/alliance.d.ts +6 -6
- package/lib/modules/alliance.js +5 -5
- package/lib/modules/bank.d.ts +2 -2
- package/lib/modules/bank.js +1 -1
- package/lib/modules/base.d.ts +4 -4
- package/lib/modules/bridge.d.ts +3 -3
- package/lib/modules/bridge.js +5 -5
- package/lib/modules/broker.d.ts +3 -3
- package/lib/modules/broker.js +2 -2
- package/lib/modules/coin.d.ts +8 -8
- package/lib/modules/coin.js +7 -7
- package/lib/modules/evm.d.ts +2 -2
- package/lib/modules/evm.js +1 -1
- package/lib/modules/evmmerge.d.ts +2 -2
- package/lib/modules/evmmerge.js +3 -3
- package/lib/modules/gov.d.ts +4 -4
- package/lib/modules/gov.js +3 -3
- package/lib/modules/grant.d.ts +4 -4
- package/lib/modules/grant.js +6 -6
- package/lib/modules/ibc.d.ts +3 -3
- package/lib/modules/ibc.js +2 -2
- package/lib/modules/leverage.d.ts +3 -3
- package/lib/modules/leverage.js +2 -2
- package/lib/modules/market.d.ts +15 -15
- package/lib/modules/market.js +7 -7
- package/lib/modules/order.d.ts +8 -8
- package/lib/modules/order.js +7 -7
- package/lib/modules/perpspool.d.ts +14 -14
- package/lib/modules/perpspool.js +23 -23
- package/lib/modules/position.d.ts +3 -3
- package/lib/modules/position.js +2 -2
- package/lib/modules/staking.d.ts +6 -6
- package/lib/modules/subaccount.d.ts +4 -4
- package/lib/modules/subaccount.js +3 -3
- package/lib/provider/amino/types/admin.js +12 -12
- package/lib/provider/amino/types/bank.js +2 -2
- package/lib/provider/amino/types/bridge.js +3 -3
- package/lib/provider/amino/types/broker.js +2 -2
- package/lib/provider/amino/types/coin.js +5 -5
- package/lib/provider/amino/types/evm.js +2 -2
- package/lib/provider/amino/types/evmmerge.js +2 -2
- package/lib/provider/amino/types/feemarket.js +2 -2
- package/lib/provider/amino/types/gov.js +17 -17
- package/lib/provider/amino/types/grant.js +6 -6
- package/lib/provider/amino/types/group.js +4 -4
- package/lib/provider/amino/types/ibc.js +2 -2
- package/lib/provider/amino/types/leverage.js +2 -2
- package/lib/provider/amino/types/market.js +7 -7
- package/lib/provider/amino/types/order.js +5 -5
- package/lib/provider/amino/types/perpspool.js +11 -11
- package/lib/provider/amino/types/position.js +2 -2
- package/lib/provider/amino/types/staking.js +5 -5
- package/lib/provider/amino/types/subaccount.js +4 -4
- package/lib/provider/keplr/KeplrAccount.d.ts +3 -3
- package/lib/provider/keplr/KeplrAccount.js +8 -8
- package/lib/provider/leap/LeapAccount.d.ts +3 -3
- package/lib/provider/leap/LeapAccount.js +7 -7
- package/lib/provider/metamask/MetaMask.d.ts +8 -8
- package/lib/provider/metamask/MetaMask.js +17 -17
- package/lib/provider/rainbowKit/RainbowKitAccount.d.ts +7 -7
- package/lib/provider/rainbowKit/RainbowKitAccount.js +12 -12
- package/lib/provider/sdk/SDKProvider.d.ts +4 -4
- package/lib/util/alliance.js +1 -1
- package/lib/util/blockchain.d.ts +5 -5
- package/lib/util/blockchain.js +11 -11
- package/lib/util/eip712.d.ts +2 -2
- package/lib/util/eip712.js +1 -1
- package/lib/util/ethermint.d.ts +4 -4
- package/lib/util/ethermint.js +1 -1
- package/lib/util/external.d.ts +2 -2
- package/lib/util/gov.js +16 -16
- package/lib/util/index.d.ts +1 -1
- package/lib/util/index.js +2 -2
- package/lib/util/legacyEIP712.js +1 -1
- package/lib/util/network.d.ts +1 -1
- package/lib/util/network.js +7 -7
- package/lib/util/provider.js +1 -1
- package/lib/util/tx.d.ts +3 -3
- package/lib/util/tx.js +9 -9
- package/lib/wallet/{CarbonSigner.d.ts → OrbixSigner.d.ts} +19 -19
- package/lib/wallet/{CarbonSigner.js → OrbixSigner.js} +19 -19
- package/lib/wallet/{CarbonSigningClient.d.ts → OrbixSigningClient.d.ts} +3 -3
- package/lib/wallet/{CarbonSigningClient.js → OrbixSigningClient.js} +9 -9
- package/lib/wallet/{CarbonWallet.d.ts → OrbixWallet.d.ts} +38 -38
- package/lib/wallet/{CarbonWallet.js → OrbixWallet.js} +39 -39
- package/lib/wallet/index.d.ts +2 -2
- package/lib/wallet/index.js +2 -2
- package/package.json +1 -1
- package/lib/CarbonSDK.d.ts +0 -145
- /package/lib/codec/{carbon-models.d.ts → orbix-models.d.ts} +0 -0
- /package/lib/codec/{carbon-models.js → orbix-models.js} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { OverrideConfig } from "../
|
|
2
|
-
import {
|
|
1
|
+
import { OverrideConfig } from "../OrbixSDK";
|
|
2
|
+
import { OrbixQueryClient } from "../clients";
|
|
3
3
|
import GasFee from "../clients/GasFee";
|
|
4
4
|
import { Network, NetworkConfig, SupportedEip6963Provider } from "../constant";
|
|
5
5
|
import { ProviderAgent } from "../constant/walletProvider";
|
|
6
|
-
import {
|
|
6
|
+
import { OrbixTx } from "../util";
|
|
7
7
|
import { AccessTokenResponse, GrantRequest } from "../util/auth";
|
|
8
8
|
import { SmartWalletBlockchain } from "../util/blockchain";
|
|
9
9
|
import { BroadcastTxMode } from "../util/tx";
|
|
@@ -13,9 +13,9 @@ import { Account, DeliverTxResponse } from "@cosmjs/stargate";
|
|
|
13
13
|
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
|
|
14
14
|
import { BroadcastTxAsyncResponse, BroadcastTxSyncResponse, TxResponse } from "@cosmjs/tendermint-rpc/build/tendermint37/responses";
|
|
15
15
|
import { TxRaw as StargateTxRaw } from "cosmjs-types/cosmos/tx/v1beta1/tx";
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
export interface
|
|
16
|
+
import { OrbixSigner, OrbixSignerTypes } from "./OrbixSigner";
|
|
17
|
+
import { OrbixSigningClient } from "./OrbixSigningClient";
|
|
18
|
+
export interface OrbixWalletGenericOpts {
|
|
19
19
|
tmClient?: Tendermint37Client;
|
|
20
20
|
txDefaultBroadcastMode?: BroadcastTxMode;
|
|
21
21
|
network?: Network;
|
|
@@ -33,27 +33,27 @@ export interface CarbonWalletGenericOpts {
|
|
|
33
33
|
/**
|
|
34
34
|
* Optional callback that will be called before signing is requested/executed.
|
|
35
35
|
*/
|
|
36
|
-
onRequestSign?:
|
|
36
|
+
onRequestSign?: OrbixWallet.OnRequestSignCallback;
|
|
37
37
|
/**
|
|
38
38
|
* Optional callback that will be called when signing is complete.
|
|
39
39
|
*/
|
|
40
|
-
onSignComplete?:
|
|
40
|
+
onSignComplete?: OrbixWallet.OnSignCompleteCallback;
|
|
41
41
|
/**
|
|
42
42
|
* Optional callback that will be called after tx is broadcast successful.
|
|
43
43
|
*/
|
|
44
|
-
onBroadcastTxSuccess?:
|
|
44
|
+
onBroadcastTxSuccess?: OrbixWallet.OnBroadcastTxSuccessCallback;
|
|
45
45
|
/**
|
|
46
46
|
* Optional callback that will be called if tx broadcast fails.
|
|
47
47
|
*/
|
|
48
|
-
onBroadcastTxFail?:
|
|
48
|
+
onBroadcastTxFail?: OrbixWallet.OnBroadcastTxFailCallback;
|
|
49
49
|
/**
|
|
50
50
|
* Optional callback that will be called before authentication is requested
|
|
51
51
|
*/
|
|
52
|
-
onRequestAuth?:
|
|
52
|
+
onRequestAuth?: OrbixWallet.OnRequestAuthCallback;
|
|
53
53
|
/**
|
|
54
54
|
* Optional callback that will be called after authentication is complete
|
|
55
55
|
*/
|
|
56
|
-
onAuthComplete?:
|
|
56
|
+
onAuthComplete?: OrbixWallet.OnAuthComplete;
|
|
57
57
|
}
|
|
58
58
|
export interface AuthInfo {
|
|
59
59
|
message: string;
|
|
@@ -75,7 +75,7 @@ type PrivateKeyOpts = {
|
|
|
75
75
|
};
|
|
76
76
|
type CustomSignerOpts = {
|
|
77
77
|
mode: "customSigner";
|
|
78
|
-
signer:
|
|
78
|
+
signer: OrbixSigner;
|
|
79
79
|
publicKeyBase64: string;
|
|
80
80
|
};
|
|
81
81
|
type ViewOnlyOpts = {
|
|
@@ -88,7 +88,7 @@ type QROpts = {
|
|
|
88
88
|
granter: string;
|
|
89
89
|
expiry: Date;
|
|
90
90
|
};
|
|
91
|
-
export type
|
|
91
|
+
export type OrbixWalletInitOpts = OrbixWalletGenericOpts & (MnemonicOpts | PrivateKeyOpts | CustomSignerOpts | ViewOnlyOpts | QROpts);
|
|
92
92
|
export interface AccountInfo extends Account {
|
|
93
93
|
chainId: string;
|
|
94
94
|
}
|
|
@@ -96,20 +96,20 @@ export interface Grantee {
|
|
|
96
96
|
expiry: Date;
|
|
97
97
|
signer: OfflineDirectSigner;
|
|
98
98
|
}
|
|
99
|
-
export declare class
|
|
99
|
+
export declare class OrbixWallet {
|
|
100
100
|
network: Network;
|
|
101
101
|
configOverride: Partial<NetworkConfig>;
|
|
102
102
|
networkConfig: NetworkConfig;
|
|
103
|
-
onRequestSign?:
|
|
104
|
-
onSignComplete?:
|
|
105
|
-
onBroadcastTxSuccess?:
|
|
106
|
-
onBroadcastTxFail?:
|
|
107
|
-
onRequestAuth?:
|
|
108
|
-
onAuthComplete?:
|
|
103
|
+
onRequestSign?: OrbixWallet.OnRequestSignCallback;
|
|
104
|
+
onSignComplete?: OrbixWallet.OnSignCompleteCallback;
|
|
105
|
+
onBroadcastTxSuccess?: OrbixWallet.OnBroadcastTxSuccessCallback;
|
|
106
|
+
onBroadcastTxFail?: OrbixWallet.OnBroadcastTxFailCallback;
|
|
107
|
+
onRequestAuth?: OrbixWallet.OnRequestAuthCallback;
|
|
108
|
+
onAuthComplete?: OrbixWallet.OnAuthComplete;
|
|
109
109
|
defaultTimeoutBlocks: number;
|
|
110
110
|
mnemonic?: string;
|
|
111
111
|
privateKey?: Buffer;
|
|
112
|
-
signer:
|
|
112
|
+
signer: OrbixSigner;
|
|
113
113
|
bech32Address: string;
|
|
114
114
|
evmBech32Address: string;
|
|
115
115
|
hexAddress: string;
|
|
@@ -117,7 +117,7 @@ export declare class CarbonWallet {
|
|
|
117
117
|
accountMerged?: boolean;
|
|
118
118
|
triggerMerge?: boolean;
|
|
119
119
|
publicKey: Buffer;
|
|
120
|
-
query?:
|
|
120
|
+
query?: OrbixQueryClient;
|
|
121
121
|
txDefaultBroadCastMode?: BroadcastTxMode;
|
|
122
122
|
initialized: boolean;
|
|
123
123
|
accountInfo?: AccountInfo;
|
|
@@ -135,8 +135,8 @@ export declare class CarbonWallet {
|
|
|
135
135
|
private sequenceInvalidated;
|
|
136
136
|
private txSignManager;
|
|
137
137
|
private txDispatchManager;
|
|
138
|
-
constructor(opts:
|
|
139
|
-
initialize(queryClient:
|
|
138
|
+
constructor(opts: OrbixWalletInitOpts);
|
|
139
|
+
initialize(queryClient: OrbixQueryClient, gasFee: GasFee, fallbackConfig?: OverrideConfig | null, opts?: OrbixWalletGenericOpts): Promise<OrbixWallet>;
|
|
140
140
|
reloadJwtToken(request?: GrantRequest, authMessage?: string): Promise<void>;
|
|
141
141
|
queryViewOnlyEvmHexAddress(): Promise<void>;
|
|
142
142
|
private refreshJwtToken;
|
|
@@ -144,40 +144,40 @@ export declare class CarbonWallet {
|
|
|
144
144
|
private constructGrantRequest;
|
|
145
145
|
setGrantee(grantee?: Grantee): void;
|
|
146
146
|
isGranteeValid(): boolean;
|
|
147
|
-
updateNetwork(network: Network):
|
|
147
|
+
updateNetwork(network: Network): OrbixWallet;
|
|
148
148
|
setAuthorizedMsgs(msgs?: string[]): void;
|
|
149
|
-
getSignedTx(signerAddress: string, messages: readonly EncodeObject[], sequence: number, opts: Omit<
|
|
149
|
+
getSignedTx(signerAddress: string, messages: readonly EncodeObject[], sequence: number, opts: Omit<OrbixTx.SignTxOpts, "sequence">, granterAddress?: string): Promise<OrbixWallet.TxRaw>;
|
|
150
150
|
/**
|
|
151
151
|
* broadcast TX and wait for block confirmation
|
|
152
152
|
*
|
|
153
153
|
*/
|
|
154
|
-
broadcastTx(txRaw:
|
|
154
|
+
broadcastTx(txRaw: OrbixWallet.TxRaw, opts?: OrbixTx.BroadcastTxOpts): Promise<OrbixWallet.SendTxResponse>;
|
|
155
155
|
/**
|
|
156
156
|
* broadcast TX to mempool but doesnt wait for block confirmation
|
|
157
157
|
*
|
|
158
158
|
*/
|
|
159
|
-
broadcastTxToMempoolWithoutConfirm(txRaw:
|
|
159
|
+
broadcastTxToMempoolWithoutConfirm(txRaw: OrbixWallet.TxRaw): Promise<OrbixWallet.SendTxToMempoolWithoutConfirmResponse>;
|
|
160
160
|
/**
|
|
161
161
|
* broadcast TX but doesnt wait for block confirmation nor submission to mempool
|
|
162
162
|
*
|
|
163
163
|
*/
|
|
164
|
-
broadcastTxWithoutConfirm(txRaw:
|
|
165
|
-
signAndBroadcast(messages: EncodeObject[], signOpts?:
|
|
164
|
+
broadcastTxWithoutConfirm(txRaw: OrbixWallet.TxRaw): Promise<OrbixWallet.SendTxWithoutConfirmResponse>;
|
|
165
|
+
signAndBroadcast(messages: EncodeObject[], signOpts?: OrbixTx.SignTxOpts, broadcastOpts?: OrbixTx.BroadcastTxOpts): Promise<DeliverTxResponse | BroadcastTxSyncResponse | BroadcastTxAsyncResponse>;
|
|
166
166
|
private signTx;
|
|
167
167
|
private signWithGrantee;
|
|
168
168
|
private getBroadcastFunc;
|
|
169
169
|
private dispatchTx;
|
|
170
|
-
sendTxs(msgs: EncodeObject[], opts?:
|
|
171
|
-
sendInitialMergeAccountTx(msgs: EncodeObject[], opts?:
|
|
172
|
-
sendTxsWithoutConfirm(msgs: EncodeObject[], opts?:
|
|
173
|
-
sendTx(msg: EncodeObject, opts?:
|
|
170
|
+
sendTxs(msgs: EncodeObject[], opts?: OrbixTx.SignTxOpts): Promise<OrbixWallet.SendTxResponse>;
|
|
171
|
+
sendInitialMergeAccountTx(msgs: EncodeObject[], opts?: OrbixTx.SignTxOpts): Promise<void>;
|
|
172
|
+
sendTxsWithoutConfirm(msgs: EncodeObject[], opts?: OrbixTx.SignTxOpts): Promise<OrbixWallet.SendTxToMempoolWithoutConfirmResponse>;
|
|
173
|
+
sendTx(msg: EncodeObject, opts?: OrbixTx.SignTxOpts): Promise<OrbixWallet.SendTxResponse>;
|
|
174
174
|
waitForTx(txHash: string, throwIfNotIncludedInBlock?: boolean, timeoutMs?: number, pollIntervalMs?: number): Promise<TxResponse>;
|
|
175
|
-
getSigningClient(): Promise<
|
|
175
|
+
getSigningClient(): Promise<OrbixSigningClient>;
|
|
176
176
|
getTimeoutHeight(): Promise<number | undefined>;
|
|
177
177
|
getTmClient(reconnect?: boolean): Promise<Tendermint37Client>;
|
|
178
178
|
getChainId(): string;
|
|
179
179
|
getEvmChainId(): string;
|
|
180
|
-
isSigner(signerType:
|
|
180
|
+
isSigner(signerType: OrbixSignerTypes): boolean;
|
|
181
181
|
isLedgerSigner(): boolean;
|
|
182
182
|
isLedgerViaBrowserExtension(): boolean;
|
|
183
183
|
isPrivateKeySigner(): boolean;
|
|
@@ -203,7 +203,7 @@ export declare class CarbonWallet {
|
|
|
203
203
|
private isNonceMismatchError;
|
|
204
204
|
private getQueryClient;
|
|
205
205
|
}
|
|
206
|
-
export declare namespace
|
|
206
|
+
export declare namespace OrbixWallet {
|
|
207
207
|
type SendTxResponse = DeliverTxResponse | BroadcastTxSyncResponse | BroadcastTxAsyncResponse;
|
|
208
208
|
type SendTxToMempoolWithoutConfirmResponse = BroadcastTxSyncResponse;
|
|
209
209
|
type SendTxWithoutConfirmResponse = BroadcastTxAsyncResponse;
|
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
const
|
|
6
|
+
exports.OrbixWallet = void 0;
|
|
7
|
+
const OrbixSDK_1 = require("../OrbixSDK");
|
|
8
8
|
const codec_1 = require("../codec");
|
|
9
9
|
const auth_1 = require("../codec/cosmos/auth/v1beta1/auth");
|
|
10
10
|
const web3_1 = require("../codec/ethermint/types/v1/web3");
|
|
@@ -34,11 +34,11 @@ const dayjs_1 = __importDefault(require("dayjs"));
|
|
|
34
34
|
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
35
35
|
const ethers_1 = require("ethers");
|
|
36
36
|
const jwt_decode_1 = require("jwt-decode");
|
|
37
|
-
const
|
|
38
|
-
const
|
|
37
|
+
const OrbixSigner_1 = require("./OrbixSigner");
|
|
38
|
+
const OrbixSigningClient_1 = require("./OrbixSigningClient");
|
|
39
39
|
const bytes_1 = require("../util/bytes");
|
|
40
40
|
dayjs_1.default.extend(utc_1.default);
|
|
41
|
-
class
|
|
41
|
+
class OrbixWallet {
|
|
42
42
|
constructor(opts) {
|
|
43
43
|
this.initialized = false;
|
|
44
44
|
this.isRainbowKit = false;
|
|
@@ -103,7 +103,7 @@ class CarbonWallet {
|
|
|
103
103
|
prefix = address_1.SWTHAddress.getBech32Prefix(addressOpts?.network, addressOpts?.bech32Prefix);
|
|
104
104
|
if (!prefix)
|
|
105
105
|
throw new Error("cannot instantiate wallet signer, no prefix");
|
|
106
|
-
this.signer = new
|
|
106
|
+
this.signer = new OrbixSigner_1.OrbixPrivateKeySigner((0, bytes_1.toUint8Array)(this.privateKey), prefix);
|
|
107
107
|
break;
|
|
108
108
|
}
|
|
109
109
|
case "privateKey": {
|
|
@@ -115,7 +115,7 @@ class CarbonWallet {
|
|
|
115
115
|
prefix = address_1.SWTHAddress.getBech32Prefix(addressOpts?.network, addressOpts?.bech32Prefix);
|
|
116
116
|
if (!prefix)
|
|
117
117
|
throw new Error("cannot instantiate wallet signer, no prefix");
|
|
118
|
-
this.signer = new
|
|
118
|
+
this.signer = new OrbixSigner_1.OrbixPrivateKeySigner((0, bytes_1.toUint8Array)(this.privateKey), prefix);
|
|
119
119
|
break;
|
|
120
120
|
}
|
|
121
121
|
case "customSigner": {
|
|
@@ -125,7 +125,7 @@ class CarbonWallet {
|
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
case "viewOnly": {
|
|
128
|
-
this.signer = new
|
|
128
|
+
this.signer = new OrbixSigner_1.OrbixNonSigner();
|
|
129
129
|
this.publicKey = Buffer.from([]);
|
|
130
130
|
this.bech32Address = opts.bech32Address;
|
|
131
131
|
break;
|
|
@@ -140,7 +140,7 @@ class CarbonWallet {
|
|
|
140
140
|
prefix = address_1.SWTHAddress.getBech32Prefix(addressOpts?.network, addressOpts?.bech32Prefix);
|
|
141
141
|
if (!prefix)
|
|
142
142
|
throw new Error("cannot instantiate wallet signer, no prefix");
|
|
143
|
-
const pkSigner = new
|
|
143
|
+
const pkSigner = new OrbixSigner_1.OrbixPrivateKeySigner((0, bytes_1.toUint8Array)(util_1.AddressUtils.SWTHAddress.mnemonicToPrivateKey(opts.mnemonic)), prefix);
|
|
144
144
|
this.signer = pkSigner;
|
|
145
145
|
this.setGrantee({
|
|
146
146
|
expiry: opts.expiry,
|
|
@@ -267,7 +267,7 @@ class CarbonWallet {
|
|
|
267
267
|
const fee = opts?.fee ?? this.estimateTxFee(messages, feeDenom);
|
|
268
268
|
const txRaw = await signingClient.sign(signerAddress, messages, fee, memo, signerData, granterAddress);
|
|
269
269
|
let sig;
|
|
270
|
-
if ((0,
|
|
270
|
+
if ((0, OrbixSigner_1.isOrbixEIP712Signer)(this.signer)) {
|
|
271
271
|
if (this.signer.legacyEip712SignMode) {
|
|
272
272
|
const feePayerSigBz = web3_1.ExtensionOptionsWeb3Tx.decode(tx_2.TxBody.decode(txRaw.bodyBytes).extensionOptions[0].value).feePayerSig;
|
|
273
273
|
sig = Uint8Array.from(Buffer.from(feePayerSigBz.slice(0, -1)));
|
|
@@ -295,12 +295,12 @@ class CarbonWallet {
|
|
|
295
295
|
*/
|
|
296
296
|
async broadcastTx(txRaw, opts = {}) {
|
|
297
297
|
const { pollIntervalMs = 3000, timeoutMs = 60000 } = opts;
|
|
298
|
-
const tx =
|
|
299
|
-
const
|
|
300
|
-
const response = await
|
|
298
|
+
const tx = OrbixWallet.TxRaw.encode(txRaw).finish();
|
|
299
|
+
const orbixClient = await this.getSigningClient();
|
|
300
|
+
const response = await orbixClient.broadcastTx(tx, timeoutMs, pollIntervalMs);
|
|
301
301
|
if ((0, stargate_1.isDeliverTxFailure)(response)) {
|
|
302
302
|
// tx failed
|
|
303
|
-
throw new tx_1.
|
|
303
|
+
throw new tx_1.OrbixCustomError(`[${response.code}] ${response.rawLog}`, tx_1.ErrorType.BLOCK_FAIL, response);
|
|
304
304
|
}
|
|
305
305
|
return response;
|
|
306
306
|
}
|
|
@@ -309,12 +309,12 @@ class CarbonWallet {
|
|
|
309
309
|
*
|
|
310
310
|
*/
|
|
311
311
|
async broadcastTxToMempoolWithoutConfirm(txRaw) {
|
|
312
|
-
const tx =
|
|
312
|
+
const tx = OrbixWallet.TxRaw.encode(txRaw).finish();
|
|
313
313
|
const tmClient = await this.getTmClient();
|
|
314
314
|
const response = await tmClient.broadcastTxSync({ tx });
|
|
315
315
|
if (!(0, responses_1.broadcastTxSyncSuccess)(response)) {
|
|
316
316
|
// tx failed
|
|
317
|
-
throw new tx_1.
|
|
317
|
+
throw new tx_1.OrbixCustomError(`[${response.code}] ${response.log}`, tx_1.ErrorType.BROADCAST_FAIL, response);
|
|
318
318
|
}
|
|
319
319
|
return response;
|
|
320
320
|
}
|
|
@@ -323,7 +323,7 @@ class CarbonWallet {
|
|
|
323
323
|
*
|
|
324
324
|
*/
|
|
325
325
|
async broadcastTxWithoutConfirm(txRaw) {
|
|
326
|
-
const tx =
|
|
326
|
+
const tx = OrbixWallet.TxRaw.encode(txRaw).finish();
|
|
327
327
|
const tmClient = await this.getTmClient();
|
|
328
328
|
return tmClient.broadcastTxAsync({ tx });
|
|
329
329
|
}
|
|
@@ -349,12 +349,12 @@ class CarbonWallet {
|
|
|
349
349
|
else {
|
|
350
350
|
try {
|
|
351
351
|
if (!this.accountInfo
|
|
352
|
-
|| this.accountInfo?.address === this.evmBech32Address // refresh to check if
|
|
352
|
+
|| this.accountInfo?.address === this.evmBech32Address // refresh to check if orbix acc is present
|
|
353
353
|
|| this.sequenceInvalidated)
|
|
354
354
|
await this.reloadAccountSequence();
|
|
355
355
|
let timeoutHeight;
|
|
356
356
|
// timeoutHeight is not supported for EIP-712
|
|
357
|
-
if (!(0,
|
|
357
|
+
if (!(0, OrbixSigner_1.isOrbixEIP712Signer)(this.signer)) {
|
|
358
358
|
timeoutHeight = await this.getTimeoutHeight();
|
|
359
359
|
}
|
|
360
360
|
let sequence;
|
|
@@ -427,7 +427,7 @@ class CarbonWallet {
|
|
|
427
427
|
...signOpts?.explicitSignerData,
|
|
428
428
|
};
|
|
429
429
|
const tmClient = await this.getTmClient();
|
|
430
|
-
const signingClient = new
|
|
430
|
+
const signingClient = new OrbixSigningClient_1.OrbixSigningClient(tmClient, signer);
|
|
431
431
|
const signedTx = await signingClient.sign(granteeAddress, msgExecMessages, fee, memo, signerData, this.bech32Address);
|
|
432
432
|
this.txDispatchManager.enqueue({
|
|
433
433
|
...txRequest,
|
|
@@ -483,7 +483,7 @@ class CarbonWallet {
|
|
|
483
483
|
}
|
|
484
484
|
try {
|
|
485
485
|
const result = await this.signAndBroadcast(msgs, opts);
|
|
486
|
-
if (msgs[0].typeUrl === util_1.
|
|
486
|
+
if (msgs[0].typeUrl === util_1.OrbixTx.Types.MsgMergeAccount) {
|
|
487
487
|
this.updateMergeAccountStatus();
|
|
488
488
|
}
|
|
489
489
|
await util_1.GenericUtils.callIgnoreError(() => this.onBroadcastTxSuccess?.(msgs));
|
|
@@ -497,7 +497,7 @@ class CarbonWallet {
|
|
|
497
497
|
async sendInitialMergeAccountTx(msgs, opts) {
|
|
498
498
|
let msg;
|
|
499
499
|
await this.reloadMergeAccountStatus();
|
|
500
|
-
if (!this.accountMerged && msgs[0].typeUrl !== util_1.
|
|
500
|
+
if (!this.accountMerged && msgs[0].typeUrl !== util_1.OrbixTx.Types.MsgMergeAccount) {
|
|
501
501
|
const accountInfo = await this.reloadAccountInfo();
|
|
502
502
|
if (!accountInfo) {
|
|
503
503
|
throw new Error('Account not found!');
|
|
@@ -505,8 +505,8 @@ class CarbonWallet {
|
|
|
505
505
|
const { address, sequence, accountNumber } = accountInfo;
|
|
506
506
|
try {
|
|
507
507
|
msg = {
|
|
508
|
-
typeUrl: util_1.
|
|
509
|
-
value:
|
|
508
|
+
typeUrl: util_1.OrbixTx.Types.MsgMergeAccount,
|
|
509
|
+
value: OrbixSDK_1.Orbix.Evmmerge.MsgMergeAccount.fromPartial({
|
|
510
510
|
creator: address,
|
|
511
511
|
pubKey: this.publicKey.toString('hex'),
|
|
512
512
|
}),
|
|
@@ -554,7 +554,7 @@ class CarbonWallet {
|
|
|
554
554
|
const { result } = response;
|
|
555
555
|
const isDeliverTxFailure = result.code !== 0;
|
|
556
556
|
if (isDeliverTxFailure && throwIfNotIncludedInBlock)
|
|
557
|
-
throw new tx_1.
|
|
557
|
+
throw new tx_1.OrbixCustomError(`[${result.code}] ${result.log}`, tx_1.ErrorType.BLOCK_FAIL, response);
|
|
558
558
|
return response;
|
|
559
559
|
}
|
|
560
560
|
catch (err) {
|
|
@@ -577,7 +577,7 @@ class CarbonWallet {
|
|
|
577
577
|
async getSigningClient() {
|
|
578
578
|
const tmClient = await this.getTmClient();
|
|
579
579
|
if (!this.signingClient) {
|
|
580
|
-
this.signingClient = new
|
|
580
|
+
this.signingClient = new OrbixSigningClient_1.OrbixSigningClient(tmClient, this.signer);
|
|
581
581
|
}
|
|
582
582
|
return this.signingClient;
|
|
583
583
|
}
|
|
@@ -599,37 +599,37 @@ class CarbonWallet {
|
|
|
599
599
|
this.tmClient = await tendermint_rpc_1.Tendermint37Client.connect(this.networkConfig.tmRpcUrl);
|
|
600
600
|
const status = await this.tmClient.status();
|
|
601
601
|
this.chainId = status.nodeInfo.network;
|
|
602
|
-
this.evmChainId = constant_1.
|
|
602
|
+
this.evmChainId = constant_1.OrbixEvmChainIDs[this.network];
|
|
603
603
|
}
|
|
604
604
|
return this.tmClient;
|
|
605
605
|
}
|
|
606
606
|
getChainId() {
|
|
607
607
|
if (!this.chainId)
|
|
608
|
-
throw new Error("
|
|
608
|
+
throw new Error("OrbixWallet is not initialized");
|
|
609
609
|
return this.chainId;
|
|
610
610
|
}
|
|
611
611
|
getEvmChainId() {
|
|
612
612
|
if (!this.evmChainId)
|
|
613
|
-
throw new Error("
|
|
613
|
+
throw new Error("OrbixWallet is not initialized");
|
|
614
614
|
return this.evmChainId;
|
|
615
615
|
}
|
|
616
616
|
isSigner(signerType) {
|
|
617
617
|
return this.signer.type === signerType;
|
|
618
618
|
}
|
|
619
619
|
isLedgerSigner() {
|
|
620
|
-
return this.isSigner(
|
|
620
|
+
return this.isSigner(OrbixSigner_1.OrbixSignerTypes.Ledger) || this.isLedgerViaBrowserExtension();
|
|
621
621
|
}
|
|
622
622
|
isLedgerViaBrowserExtension() {
|
|
623
623
|
return (this.providerAgent === walletProvider_1.ProviderAgent.KeplrExtension || this.providerAgent === walletProvider_1.ProviderAgent.LeapExtension) && !(0, proto_signing_1.isOfflineDirectSigner)(this.signer);
|
|
624
624
|
}
|
|
625
625
|
isPrivateKeySigner() {
|
|
626
|
-
return this.isSigner(
|
|
626
|
+
return this.isSigner(OrbixSigner_1.OrbixSignerTypes.PrivateKey);
|
|
627
627
|
}
|
|
628
628
|
isBrowserInjectedSigner() {
|
|
629
|
-
return this.isSigner(
|
|
629
|
+
return this.isSigner(OrbixSigner_1.OrbixSignerTypes.BrowserInjected);
|
|
630
630
|
}
|
|
631
631
|
isNonSigner() {
|
|
632
|
-
return this.isSigner(
|
|
632
|
+
return this.isSigner(OrbixSigner_1.OrbixSignerTypes.PublicKey);
|
|
633
633
|
}
|
|
634
634
|
isSmartWalletEnabled() {
|
|
635
635
|
return !!(this.mnemonic || this.privateKey);
|
|
@@ -661,7 +661,7 @@ class CarbonWallet {
|
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
async reloadAccountInfo() {
|
|
664
|
-
//
|
|
664
|
+
// orbix account always takes priority
|
|
665
665
|
let evmBech32Acc = null;
|
|
666
666
|
const bech32Acc = this.bech32Address && await this.getAccount(this.bech32Address);
|
|
667
667
|
if (!bech32Acc && this.evmBech32Address) {
|
|
@@ -731,7 +731,7 @@ class CarbonWallet {
|
|
|
731
731
|
return this.providerAgent === walletProvider_1.ProviderAgent.MetamaskExtension || this.isRainbowKit;
|
|
732
732
|
}
|
|
733
733
|
isViewOnlyWallet() {
|
|
734
|
-
return this.signer.type ===
|
|
734
|
+
return this.signer.type === OrbixSigner_1.OrbixSignerTypes.PublicKey;
|
|
735
735
|
}
|
|
736
736
|
estimateTxFee(messages, feeDenom = constant_1.DEFAULT_FEE_DENOM) {
|
|
737
737
|
const denomGasPrice = this.gasFee?.getGasPrice(feeDenom);
|
|
@@ -784,7 +784,7 @@ class CarbonWallet {
|
|
|
784
784
|
return this.query;
|
|
785
785
|
}
|
|
786
786
|
}
|
|
787
|
-
exports.
|
|
788
|
-
(function (
|
|
789
|
-
|
|
790
|
-
})(
|
|
787
|
+
exports.OrbixWallet = OrbixWallet;
|
|
788
|
+
(function (OrbixWallet) {
|
|
789
|
+
OrbixWallet.TxRaw = { ...tx_2.TxRaw };
|
|
790
|
+
})(OrbixWallet || (exports.OrbixWallet = OrbixWallet = {}));
|
package/lib/wallet/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./OrbixSigner";
|
|
2
|
+
export * from "./OrbixWallet";
|
package/lib/wallet/index.js
CHANGED
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./OrbixSigner"), exports);
|
|
18
|
+
__exportStar(require("./OrbixWallet"), exports);
|
package/package.json
CHANGED
package/lib/CarbonSDK.d.ts
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import { Network, NetworkConfig, Network as _Network } from "./constant";
|
|
2
|
-
import { Tendermint37Client } from "@cosmjs/tendermint-rpc";
|
|
3
|
-
import * as clients from "./clients";
|
|
4
|
-
import { CarbonQueryClient, HydrogenClient, InsightsQueryClient, TokenClient } from "./clients";
|
|
5
|
-
import GasFee from "./clients/GasFee";
|
|
6
|
-
import GrpcQueryClient from "./clients/GrpcQueryClient";
|
|
7
|
-
import { AdminModule, AllianceModule, BankModule, BridgeModule, BrokerModule, CoinModule, EvmMergeModule, EvmModule, FeeModule, GovModule, IBCModule, LeverageModule, MarketModule, OracleModule, OrderModule, PerpspoolModule, PositionModule, SubAccountModule } from "./modules";
|
|
8
|
-
import { GrantModule } from "./modules/grant";
|
|
9
|
-
import { StakingModule } from "./modules/staking";
|
|
10
|
-
import { CosmosLedger, Keplr, LeapExtended } from "./provider";
|
|
11
|
-
import { MetaMask } from "./provider/metamask/MetaMask";
|
|
12
|
-
import RainbowKitAccount from "./provider/rainbowKit/RainbowKitAccount";
|
|
13
|
-
import { CarbonSigner, CarbonWallet, CarbonWalletGenericOpts, EvmWalletOpts, RainbowKitWalletOpts } from "./wallet";
|
|
14
|
-
export { CarbonTx } from "./util";
|
|
15
|
-
export { CarbonSigner, CarbonSignerTypes, CarbonWallet, CarbonWalletGenericOpts, CarbonWalletInitOpts } from "./wallet";
|
|
16
|
-
export * as Carbon from "./codec/carbon-models";
|
|
17
|
-
export interface CarbonSDKOpts {
|
|
18
|
-
network: Network;
|
|
19
|
-
tmClient: Tendermint37Client;
|
|
20
|
-
wallet?: CarbonWallet;
|
|
21
|
-
chainId?: string;
|
|
22
|
-
evmChainId?: string;
|
|
23
|
-
token?: TokenClient;
|
|
24
|
-
query?: CarbonQueryClient;
|
|
25
|
-
hydrogen?: HydrogenClient;
|
|
26
|
-
insights?: InsightsQueryClient;
|
|
27
|
-
config?: Partial<NetworkConfig>;
|
|
28
|
-
grpcQueryClient?: GrpcQueryClient;
|
|
29
|
-
useTmAbciQuery?: boolean;
|
|
30
|
-
defaultTimeoutBlocks?: number;
|
|
31
|
-
gasFee?: GasFee;
|
|
32
|
-
}
|
|
33
|
-
export interface CarbonSDKInitOpts {
|
|
34
|
-
network: Network;
|
|
35
|
-
tmClient?: Tendermint37Client;
|
|
36
|
-
config?: Partial<NetworkConfig>;
|
|
37
|
-
wallet?: CarbonWallet;
|
|
38
|
-
skipInit?: boolean;
|
|
39
|
-
defaultTimeoutBlocks?: number;
|
|
40
|
-
/**
|
|
41
|
-
* temporary flag to disable GRPC Query client service when required
|
|
42
|
-
* TODO: Deprecate when grpc query client is implemented across all networks
|
|
43
|
-
*/
|
|
44
|
-
useTmAbciQuery?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface OverrideConfig {
|
|
47
|
-
chainId: string;
|
|
48
|
-
evmChainId: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Carbon SDK
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
declare class CarbonSDK {
|
|
56
|
-
static DEFAULT_NETWORK: Network;
|
|
57
|
-
static DenomPrefix: {
|
|
58
|
-
LPToken: string;
|
|
59
|
-
CDPToken: string;
|
|
60
|
-
PerpPoolToken: string;
|
|
61
|
-
UserVaultToken: string;
|
|
62
|
-
};
|
|
63
|
-
initialized: boolean;
|
|
64
|
-
readonly query: CarbonQueryClient;
|
|
65
|
-
readonly useTmAbciQuery: boolean;
|
|
66
|
-
insights: InsightsQueryClient;
|
|
67
|
-
hydrogen: HydrogenClient;
|
|
68
|
-
wallet?: CarbonWallet;
|
|
69
|
-
gasFee?: GasFee;
|
|
70
|
-
network: Network;
|
|
71
|
-
configOverride: Partial<NetworkConfig>;
|
|
72
|
-
networkConfig: NetworkConfig;
|
|
73
|
-
tmClient: Tendermint37Client;
|
|
74
|
-
token: TokenClient;
|
|
75
|
-
admin: AdminModule;
|
|
76
|
-
alliance: AllianceModule;
|
|
77
|
-
order: OrderModule;
|
|
78
|
-
perpspool: PerpspoolModule;
|
|
79
|
-
grant: GrantModule;
|
|
80
|
-
subaccount: SubAccountModule;
|
|
81
|
-
leverage: LeverageModule;
|
|
82
|
-
market: MarketModule;
|
|
83
|
-
broker: BrokerModule;
|
|
84
|
-
position: PositionModule;
|
|
85
|
-
coin: CoinModule;
|
|
86
|
-
oracle: OracleModule;
|
|
87
|
-
gov: GovModule;
|
|
88
|
-
staking: StakingModule;
|
|
89
|
-
bank: BankModule;
|
|
90
|
-
fee: FeeModule;
|
|
91
|
-
ibc: IBCModule;
|
|
92
|
-
evm: EvmModule;
|
|
93
|
-
evmmerge: EvmMergeModule;
|
|
94
|
-
bridge: BridgeModule;
|
|
95
|
-
chainId: string;
|
|
96
|
-
evmChainId: string;
|
|
97
|
-
constructor(opts: CarbonSDKOpts);
|
|
98
|
-
static instance(opts?: CarbonSDKInitOpts): Promise<CarbonSDK>;
|
|
99
|
-
static instanceWithWallet(wallet: CarbonWallet, sdkOpts?: CarbonSDKInitOpts): Promise<ConnectedCarbonSDK>;
|
|
100
|
-
static instanceWithPrivateKey(privateKey: string | Buffer, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
101
|
-
static instanceWithMnemonic(mnemonic: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
102
|
-
static instanceWithSigner(signer: CarbonSigner, publicKeyBase64: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
103
|
-
static instanceWithLedger(ledger: CosmosLedger, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
104
|
-
static instanceWithKeplr(keplr: Keplr, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
105
|
-
static instanceWithLeap(leap: LeapExtended, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
106
|
-
static instanceWithMetamask(metamask: MetaMask, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
107
|
-
static instanceWithRainbowKit(rainbowKit: RainbowKitAccount, sdkOpts: CarbonSDKInitOpts | undefined, rainbowKitWalletOpts: RainbowKitWalletOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
108
|
-
static instanceViewOnly(bech32Address: string, sdkOpts?: CarbonSDKInitOpts, walletOpts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
109
|
-
initialize(): Promise<CarbonSDK>;
|
|
110
|
-
getGasFee(): Promise<GasFee>;
|
|
111
|
-
clone(): CarbonSDK;
|
|
112
|
-
generateOpts(): CarbonSDKOpts;
|
|
113
|
-
connect(wallet: CarbonWallet, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
114
|
-
disconnect(): CarbonSDK;
|
|
115
|
-
connectWithPrivateKey(privateKey: string | Buffer, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
116
|
-
connectWithMnemonic(mnemonic: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
117
|
-
connectWithSigner(signer: CarbonSigner, publicKeyBase64: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
118
|
-
connectWithLedger(ledger: CosmosLedger, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
119
|
-
connectWithKeplr(keplr: Keplr, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
120
|
-
connectWithLeap(leap: LeapExtended, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
121
|
-
connectWithMetamask(metamask: MetaMask, opts?: CarbonWalletGenericOpts, evmWalletOpts?: EvmWalletOpts): Promise<ConnectedCarbonSDK>;
|
|
122
|
-
connectWithRainbowKit(rainbowKit: RainbowKitAccount, rainbowKitWalletOpts: RainbowKitWalletOpts, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
123
|
-
connectViewOnly(bech32Address: string, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
124
|
-
connectWithQr(granteeMnemonic: string, granterAddress: string, expiry: Date, opts?: CarbonWalletGenericOpts): Promise<ConnectedCarbonSDK>;
|
|
125
|
-
getConfig(): NetworkConfig;
|
|
126
|
-
getTokenClient(): TokenClient;
|
|
127
|
-
getConnectedWallet(): CarbonWallet;
|
|
128
|
-
log(...args: any[]): void;
|
|
129
|
-
private checkWallet;
|
|
130
|
-
static parseNetwork: (network: string, defaultNetwork?: Network | null) => Network | null;
|
|
131
|
-
}
|
|
132
|
-
export declare class ConnectedCarbonSDK extends CarbonSDK {
|
|
133
|
-
wallet: CarbonWallet;
|
|
134
|
-
constructor(wallet: CarbonWallet, opts: CarbonSDKOpts);
|
|
135
|
-
clone(): ConnectedCarbonSDK;
|
|
136
|
-
}
|
|
137
|
-
declare namespace CarbonSDK {
|
|
138
|
-
export import Network = _Network;
|
|
139
|
-
export import CarbonQueryClient = clients.CarbonQueryClient;
|
|
140
|
-
export import ETHClient = clients.ETHClient;
|
|
141
|
-
export import HydrogenClient = clients.HydrogenClient;
|
|
142
|
-
export import InsightsQueryClient = clients.InsightsQueryClient;
|
|
143
|
-
export import TokenClient = clients.TokenClient;
|
|
144
|
-
}
|
|
145
|
-
export default CarbonSDK;
|
|
File without changes
|
|
File without changes
|