example-js-sdk 0.0.6 → 0.0.7
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 +3 -3
- 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
package/lib/modules/admin.js
CHANGED
|
@@ -10,7 +10,7 @@ exports.transfromSetTradingFlagParams = transfromSetTradingFlagParams;
|
|
|
10
10
|
exports.transfromSetMsgGasCostParams = transfromSetMsgGasCostParams;
|
|
11
11
|
exports.transfromSetMinGasPriceParams = transfromSetMinGasPriceParams;
|
|
12
12
|
exports.transformCommunityPoolSpendAmount = transformCommunityPoolSpendAmount;
|
|
13
|
-
const
|
|
13
|
+
const OrbixSDK_1 = require("../OrbixSDK");
|
|
14
14
|
const tx_1 = require("../codec/cosmos/staking/v1beta1/tx");
|
|
15
15
|
const util_1 = require("../util");
|
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
|
@@ -19,35 +19,35 @@ const base_1 = __importDefault(require("./base"));
|
|
|
19
19
|
class AdminModule extends base_1.default {
|
|
20
20
|
async createOracle(params, opts) {
|
|
21
21
|
const wallet = this.getWallet();
|
|
22
|
-
const value =
|
|
22
|
+
const value = OrbixSDK_1.Orbix.Oracle.MsgCreateOracle.fromPartial({
|
|
23
23
|
creator: wallet.bech32Address,
|
|
24
24
|
createOracleParams: transfromCreateOracleParams(params, wallet.bech32Address),
|
|
25
25
|
});
|
|
26
26
|
return await wallet.sendTx({
|
|
27
|
-
typeUrl: util_1.
|
|
27
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateOracle,
|
|
28
28
|
value,
|
|
29
29
|
}, opts);
|
|
30
30
|
}
|
|
31
31
|
async createToken(params, opts) {
|
|
32
32
|
const wallet = this.getWallet();
|
|
33
|
-
const value =
|
|
33
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgCreateToken.fromPartial({
|
|
34
34
|
creator: wallet.bech32Address,
|
|
35
35
|
createTokenParams: transfromCreateTokenParams(params, wallet.bech32Address),
|
|
36
36
|
});
|
|
37
37
|
return await wallet.sendTx({
|
|
38
|
-
typeUrl: util_1.
|
|
38
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateToken,
|
|
39
39
|
value,
|
|
40
40
|
}, opts);
|
|
41
41
|
}
|
|
42
42
|
async createTokens(params, opts) {
|
|
43
43
|
const wallet = this.getWallet();
|
|
44
44
|
const msgs = params.map((param) => {
|
|
45
|
-
const value =
|
|
45
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgCreateToken.fromPartial({
|
|
46
46
|
creator: wallet.bech32Address,
|
|
47
47
|
createTokenParams: transfromCreateTokenParams(param, wallet.bech32Address),
|
|
48
48
|
});
|
|
49
49
|
return {
|
|
50
|
-
typeUrl: util_1.
|
|
50
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateToken,
|
|
51
51
|
value,
|
|
52
52
|
};
|
|
53
53
|
});
|
|
@@ -55,30 +55,30 @@ class AdminModule extends base_1.default {
|
|
|
55
55
|
}
|
|
56
56
|
async bindToken(params, opts) {
|
|
57
57
|
const wallet = this.getWallet();
|
|
58
|
-
const value =
|
|
58
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgBindToken.fromPartial({
|
|
59
59
|
creator: wallet.bech32Address,
|
|
60
60
|
sourceDenom: params.sourceDenom,
|
|
61
61
|
wrappedDenom: params.wrappedDenom,
|
|
62
62
|
});
|
|
63
63
|
return await wallet.sendTx({
|
|
64
|
-
typeUrl: util_1.
|
|
64
|
+
typeUrl: util_1.OrbixTx.Types.MsgBindToken,
|
|
65
65
|
value,
|
|
66
66
|
}, opts);
|
|
67
67
|
}
|
|
68
68
|
async unbindToken(params, opts) {
|
|
69
69
|
const wallet = this.getWallet();
|
|
70
|
-
const value =
|
|
70
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgUnbindToken.fromPartial({
|
|
71
71
|
creator: wallet.bech32Address,
|
|
72
72
|
wrappedDenom: params.wrappedDenom,
|
|
73
73
|
});
|
|
74
74
|
return await wallet.sendTx({
|
|
75
|
-
typeUrl: util_1.
|
|
75
|
+
typeUrl: util_1.OrbixTx.Types.MsgUnbindToken,
|
|
76
76
|
value,
|
|
77
77
|
}, opts);
|
|
78
78
|
}
|
|
79
79
|
async updateToken(params, opts) {
|
|
80
80
|
const wallet = this.getWallet();
|
|
81
|
-
const value =
|
|
81
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgUpdateToken.fromPartial({
|
|
82
82
|
updater: wallet.bech32Address,
|
|
83
83
|
denom: params.denom,
|
|
84
84
|
updateTokenParams: {
|
|
@@ -89,13 +89,13 @@ class AdminModule extends base_1.default {
|
|
|
89
89
|
},
|
|
90
90
|
});
|
|
91
91
|
return await wallet.sendTx({
|
|
92
|
-
typeUrl: util_1.
|
|
92
|
+
typeUrl: util_1.OrbixTx.Types.MsgUpdateToken,
|
|
93
93
|
value,
|
|
94
94
|
}, opts);
|
|
95
95
|
}
|
|
96
96
|
async createMarket(params, opts) {
|
|
97
97
|
const wallet = this.getWallet();
|
|
98
|
-
const value =
|
|
98
|
+
const value = OrbixSDK_1.Orbix.Market.MsgCreateMarket.fromPartial({
|
|
99
99
|
creator: wallet.bech32Address,
|
|
100
100
|
marketType: params.marketType,
|
|
101
101
|
base: params.base,
|
|
@@ -106,14 +106,14 @@ class AdminModule extends base_1.default {
|
|
|
106
106
|
expiryTime: params.expiryTime ?? new Date(0),
|
|
107
107
|
});
|
|
108
108
|
return await wallet.sendTx({
|
|
109
|
-
typeUrl: util_1.
|
|
109
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateMarket,
|
|
110
110
|
value,
|
|
111
111
|
}, opts);
|
|
112
112
|
}
|
|
113
113
|
async createMarkets(params, opts) {
|
|
114
114
|
const wallet = this.getWallet();
|
|
115
115
|
const msgs = params.map((param) => {
|
|
116
|
-
const value =
|
|
116
|
+
const value = OrbixSDK_1.Orbix.Market.MsgCreateMarket.fromPartial({
|
|
117
117
|
creator: wallet.bech32Address,
|
|
118
118
|
marketType: param.marketType,
|
|
119
119
|
base: param.base,
|
|
@@ -124,7 +124,7 @@ class AdminModule extends base_1.default {
|
|
|
124
124
|
...(param.expiryTime && { expiryTime: param.expiryTime }),
|
|
125
125
|
});
|
|
126
126
|
return {
|
|
127
|
-
typeUrl: util_1.
|
|
127
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateMarket,
|
|
128
128
|
value,
|
|
129
129
|
};
|
|
130
130
|
});
|
|
@@ -132,9 +132,9 @@ class AdminModule extends base_1.default {
|
|
|
132
132
|
}
|
|
133
133
|
async setTradingFlag(params, opts) {
|
|
134
134
|
const wallet = this.getWallet();
|
|
135
|
-
const value =
|
|
135
|
+
const value = OrbixSDK_1.Orbix.Order.MsgSetTradingFlag.fromPartial(transfromSetTradingFlagParams(params, wallet.bech32Address));
|
|
136
136
|
return await wallet.sendTx({
|
|
137
|
-
typeUrl: util_1.
|
|
137
|
+
typeUrl: util_1.OrbixTx.Types.MsgSetTradingFlag,
|
|
138
138
|
value,
|
|
139
139
|
}, opts);
|
|
140
140
|
}
|
|
@@ -143,45 +143,45 @@ class AdminModule extends base_1.default {
|
|
|
143
143
|
}
|
|
144
144
|
async setMsgGasCost(params, opts) {
|
|
145
145
|
const wallet = this.getWallet();
|
|
146
|
-
const value =
|
|
146
|
+
const value = OrbixSDK_1.Orbix.Fee.MsgSetGasCost.fromPartial({
|
|
147
147
|
creator: wallet.bech32Address,
|
|
148
148
|
setGasCostParams: transfromSetMsgGasCostParams(params),
|
|
149
149
|
});
|
|
150
150
|
return await wallet.sendTx({
|
|
151
|
-
typeUrl: util_1.
|
|
151
|
+
typeUrl: util_1.OrbixTx.Types.MsgSetGasCost,
|
|
152
152
|
value,
|
|
153
153
|
}, opts);
|
|
154
154
|
}
|
|
155
155
|
async setMinGasPrice(params, opts) {
|
|
156
156
|
const wallet = this.getWallet();
|
|
157
|
-
const value =
|
|
157
|
+
const value = OrbixSDK_1.Orbix.Fee.MsgSetMinGasPrice.fromPartial({
|
|
158
158
|
creator: wallet.bech32Address,
|
|
159
159
|
setMinGasPriceParams: transfromSetMinGasPriceParams(params),
|
|
160
160
|
});
|
|
161
161
|
return await wallet.sendTx({
|
|
162
|
-
typeUrl: util_1.
|
|
162
|
+
typeUrl: util_1.OrbixTx.Types.MsgSetMinGasPrice,
|
|
163
163
|
value,
|
|
164
164
|
}, opts);
|
|
165
165
|
}
|
|
166
166
|
async removeMsgGasCost(params, opts) {
|
|
167
167
|
const wallet = this.getWallet();
|
|
168
|
-
const value =
|
|
168
|
+
const value = OrbixSDK_1.Orbix.Fee.MsgRemoveGasCost.fromPartial({
|
|
169
169
|
creator: wallet.bech32Address,
|
|
170
170
|
msgType: params.msgType,
|
|
171
171
|
});
|
|
172
172
|
return await wallet.sendTx({
|
|
173
|
-
typeUrl: util_1.
|
|
173
|
+
typeUrl: util_1.OrbixTx.Types.MsgRemoveGasCost,
|
|
174
174
|
value,
|
|
175
175
|
}, opts);
|
|
176
176
|
}
|
|
177
177
|
async removeMinGasPrice(params, opts) {
|
|
178
178
|
const wallet = this.getWallet();
|
|
179
|
-
const value =
|
|
179
|
+
const value = OrbixSDK_1.Orbix.Fee.MsgRemoveMinGasPrice.fromPartial({
|
|
180
180
|
creator: wallet.bech32Address,
|
|
181
181
|
denom: params.denom,
|
|
182
182
|
});
|
|
183
183
|
return await wallet.sendTx({
|
|
184
|
-
typeUrl: util_1.
|
|
184
|
+
typeUrl: util_1.OrbixTx.Types.MsgRemoveMinGasPrice,
|
|
185
185
|
value,
|
|
186
186
|
}, opts);
|
|
187
187
|
}
|
|
@@ -208,7 +208,7 @@ class AdminModule extends base_1.default {
|
|
|
208
208
|
}),
|
|
209
209
|
});
|
|
210
210
|
return await wallet.sendTx({
|
|
211
|
-
typeUrl: util_1.
|
|
211
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateValidator,
|
|
212
212
|
value,
|
|
213
213
|
}, opts);
|
|
214
214
|
}
|
|
@@ -221,93 +221,93 @@ class AdminModule extends base_1.default {
|
|
|
221
221
|
minSelfDelegation: params.minSelfDelegation.toString(10),
|
|
222
222
|
});
|
|
223
223
|
return await wallet.sendTx({
|
|
224
|
-
typeUrl: util_1.
|
|
224
|
+
typeUrl: util_1.OrbixTx.Types.MsgEditValidator,
|
|
225
225
|
value,
|
|
226
226
|
}, opts);
|
|
227
227
|
}
|
|
228
228
|
async authorizeBridge(params, opts) {
|
|
229
229
|
const wallet = this.getWallet();
|
|
230
|
-
const value =
|
|
230
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgAuthorizeBridge.fromPartial({
|
|
231
231
|
creator: wallet.bech32Address,
|
|
232
232
|
bridgeId: new long_1.default(params.bridgeId),
|
|
233
233
|
chainId: new long_1.default(params.chainId),
|
|
234
234
|
chainName: params.chainName,
|
|
235
235
|
});
|
|
236
236
|
return await wallet.sendTx({
|
|
237
|
-
typeUrl: util_1.
|
|
237
|
+
typeUrl: util_1.OrbixTx.Types.MsgAuthorizeBridge,
|
|
238
238
|
value,
|
|
239
239
|
}, opts);
|
|
240
240
|
}
|
|
241
241
|
async deauthorizeBridge(params, opts) {
|
|
242
242
|
const wallet = this.getWallet();
|
|
243
|
-
const value =
|
|
243
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgDeauthorizeBridge.fromPartial({
|
|
244
244
|
initiator: wallet.bech32Address,
|
|
245
245
|
bridgeId: new long_1.default(params.bridgeId),
|
|
246
246
|
chainId: new long_1.default(params.chainId),
|
|
247
247
|
});
|
|
248
248
|
return await wallet.sendTx({
|
|
249
|
-
typeUrl: util_1.
|
|
249
|
+
typeUrl: util_1.OrbixTx.Types.MsgDeauthorizeBridge,
|
|
250
250
|
value,
|
|
251
251
|
}, opts);
|
|
252
252
|
}
|
|
253
253
|
async createNewGroup(params, opts) {
|
|
254
254
|
const wallet = this.getWallet();
|
|
255
|
-
const value =
|
|
255
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgCreateGroup.fromPartial({
|
|
256
256
|
creator: params.creator ?? wallet.bech32Address,
|
|
257
257
|
name: params.name,
|
|
258
258
|
chequeTokenSymbol: params.chequeTokenSymbol,
|
|
259
259
|
oracleId: params.oracleId,
|
|
260
260
|
});
|
|
261
261
|
return await wallet.sendTx({
|
|
262
|
-
typeUrl: util_1.
|
|
262
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateGroup,
|
|
263
263
|
value,
|
|
264
264
|
}, opts);
|
|
265
265
|
}
|
|
266
266
|
async updateGroup(params, opts) {
|
|
267
267
|
const wallet = this.getWallet();
|
|
268
|
-
const value =
|
|
268
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgUpdateGroup.fromPartial({
|
|
269
269
|
creator: params.creator ?? wallet.bech32Address,
|
|
270
270
|
groupId: params.groupId,
|
|
271
271
|
updateGroupParams: params.updateGroupParams,
|
|
272
272
|
});
|
|
273
273
|
return await wallet.sendTx({
|
|
274
|
-
typeUrl: util_1.
|
|
274
|
+
typeUrl: util_1.OrbixTx.Types.MsgUpdateGroup,
|
|
275
275
|
value,
|
|
276
276
|
}, opts);
|
|
277
277
|
}
|
|
278
278
|
async registerToGroup(params, opts) {
|
|
279
279
|
const wallet = this.getWallet();
|
|
280
|
-
const value =
|
|
280
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgRegisterToGroup.fromPartial({
|
|
281
281
|
creator: params.creator ?? wallet.bech32Address,
|
|
282
282
|
groupId: params.groupId,
|
|
283
283
|
denom: params.denom,
|
|
284
284
|
});
|
|
285
285
|
return await wallet.sendTx({
|
|
286
|
-
typeUrl: util_1.
|
|
286
|
+
typeUrl: util_1.OrbixTx.Types.MsgRegisterToGroup,
|
|
287
287
|
value,
|
|
288
288
|
}, opts);
|
|
289
289
|
}
|
|
290
290
|
async deregisterFromGroup(params, opts) {
|
|
291
291
|
const wallet = this.getWallet();
|
|
292
|
-
const value =
|
|
292
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgDeregisterFromGroup.fromPartial({
|
|
293
293
|
creator: params.creator ?? wallet.bech32Address,
|
|
294
294
|
groupId: params.groupId,
|
|
295
295
|
denom: params.denom,
|
|
296
296
|
});
|
|
297
297
|
return await wallet.sendTx({
|
|
298
|
-
typeUrl: util_1.
|
|
298
|
+
typeUrl: util_1.OrbixTx.Types.MsgDeregisterFromGroup,
|
|
299
299
|
value,
|
|
300
300
|
}, opts);
|
|
301
301
|
}
|
|
302
302
|
async updateGroupConfig(params, opts) {
|
|
303
303
|
const wallet = this.getWallet();
|
|
304
|
-
const value =
|
|
304
|
+
const value = OrbixSDK_1.Orbix.Coin.MsgUpdateGroupedTokenConfig.fromPartial({
|
|
305
305
|
creator: params.creator ?? wallet.bech32Address,
|
|
306
306
|
denom: params.denom,
|
|
307
307
|
updateGroupedTokenConfigParams: params.updateGroupedTokenConfigParams,
|
|
308
308
|
});
|
|
309
309
|
return await wallet.sendTx({
|
|
310
|
-
typeUrl: util_1.
|
|
310
|
+
typeUrl: util_1.OrbixTx.Types.MsgUpdateGroupedTokenConfig,
|
|
311
311
|
value,
|
|
312
312
|
}, opts);
|
|
313
313
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OrbixTx } from "../util";
|
|
3
3
|
import BaseModule from "./base";
|
|
4
4
|
export declare class AllianceModule extends BaseModule {
|
|
5
|
-
delegateTokens(params: AllianceModule.DelegateTokensParams, opts?:
|
|
6
|
-
undelegateTokens(params: AllianceModule.DelegateTokensParams, opts?:
|
|
7
|
-
redelegateTokens(params: AllianceModule.RedelegateTokensParams, opts?:
|
|
8
|
-
claimRewards(params: AllianceModule.ClaimRewardsParams, opts?:
|
|
9
|
-
withdrawAllRewards(params: AllianceModule.WithdrawAllRewardsParams, opts?:
|
|
5
|
+
delegateTokens(params: AllianceModule.DelegateTokensParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
6
|
+
undelegateTokens(params: AllianceModule.DelegateTokensParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
7
|
+
redelegateTokens(params: AllianceModule.RedelegateTokensParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
8
|
+
claimRewards(params: AllianceModule.ClaimRewardsParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
9
|
+
withdrawAllRewards(params: AllianceModule.WithdrawAllRewardsParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
10
10
|
}
|
|
11
11
|
export declare namespace AllianceModule {
|
|
12
12
|
interface DelegateTokensParams {
|
package/lib/modules/alliance.js
CHANGED
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AllianceModule = void 0;
|
|
7
|
-
const
|
|
7
|
+
const OrbixSDK_1 = require("../OrbixSDK");
|
|
8
8
|
const codec_1 = require("../codec");
|
|
9
9
|
const alliance_1 = require("../util/alliance");
|
|
10
10
|
const base_1 = __importDefault(require("./base"));
|
|
11
11
|
class AllianceModule extends base_1.default {
|
|
12
12
|
async delegateTokens(params, opts) {
|
|
13
13
|
const wallet = this.getWallet();
|
|
14
|
-
const value =
|
|
14
|
+
const value = OrbixSDK_1.Orbix.Alliance.MsgDelegate.fromPartial({
|
|
15
15
|
delegatorAddress: params.delegatorAddress ?? wallet.bech32Address,
|
|
16
16
|
validatorAddress: params.validatorAddress,
|
|
17
17
|
amount: {
|
|
@@ -26,7 +26,7 @@ class AllianceModule extends base_1.default {
|
|
|
26
26
|
}
|
|
27
27
|
async undelegateTokens(params, opts) {
|
|
28
28
|
const wallet = this.getWallet();
|
|
29
|
-
const value =
|
|
29
|
+
const value = OrbixSDK_1.Orbix.Alliance.MsgUndelegate.fromPartial({
|
|
30
30
|
delegatorAddress: params.delegatorAddress ?? wallet.bech32Address,
|
|
31
31
|
validatorAddress: params.validatorAddress,
|
|
32
32
|
amount: {
|
|
@@ -41,7 +41,7 @@ class AllianceModule extends base_1.default {
|
|
|
41
41
|
}
|
|
42
42
|
async redelegateTokens(params, opts) {
|
|
43
43
|
const wallet = this.getWallet();
|
|
44
|
-
const value =
|
|
44
|
+
const value = OrbixSDK_1.Orbix.Alliance.MsgRedelegate.fromPartial({
|
|
45
45
|
delegatorAddress: params.delegatorAddress ?? wallet.bech32Address,
|
|
46
46
|
validatorSrcAddress: params.validatorSrcAddress,
|
|
47
47
|
validatorDstAddress: params.validatorDstAddress,
|
|
@@ -57,7 +57,7 @@ class AllianceModule extends base_1.default {
|
|
|
57
57
|
}
|
|
58
58
|
async claimRewards(params, opts) {
|
|
59
59
|
const wallet = this.getWallet();
|
|
60
|
-
const value =
|
|
60
|
+
const value = OrbixSDK_1.Orbix.Alliance.MsgClaimDelegationRewards.fromPartial({
|
|
61
61
|
delegatorAddress: params.delegatorAddress ?? wallet.bech32Address,
|
|
62
62
|
validatorAddress: params.validatorAddress,
|
|
63
63
|
denom: params.denom,
|
package/lib/modules/bank.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrbixTx } from "../util";
|
|
2
2
|
import { Coin } from "@cosmjs/amino";
|
|
3
3
|
import BaseModule from "./base";
|
|
4
4
|
export declare class BankModule extends BaseModule {
|
|
5
|
-
sendTokens(params: BankModule.SendTokensParams, opts?:
|
|
5
|
+
sendTokens(params: BankModule.SendTokensParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
6
6
|
}
|
|
7
7
|
export declare namespace BankModule {
|
|
8
8
|
interface SendTokensParams {
|
package/lib/modules/bank.js
CHANGED
package/lib/modules/base.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { SDKProvider } from "../provider";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { OrbixTx } from "../util";
|
|
3
|
+
import { OrbixWallet } from "../wallet";
|
|
4
4
|
import { EncodeObject } from "@cosmjs/proto-signing";
|
|
5
5
|
declare class BaseModule {
|
|
6
6
|
readonly sdkProvider: SDKProvider;
|
|
7
7
|
constructor(sdkProvider: SDKProvider);
|
|
8
|
-
protected getWallet():
|
|
8
|
+
protected getWallet(): OrbixWallet;
|
|
9
9
|
protected log(...args: any[]): void;
|
|
10
|
-
protected sendTx(msg: EncodeObject, opts:
|
|
10
|
+
protected sendTx(msg: EncodeObject, opts: OrbixTx.SignTxOpts): Promise<unknown>;
|
|
11
11
|
}
|
|
12
12
|
export default BaseModule;
|
package/lib/modules/bridge.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import BigNumber from "bignumber.js";
|
|
2
|
-
import {
|
|
2
|
+
import { OrbixTx } from "../util";
|
|
3
3
|
import BaseModule from "./base";
|
|
4
4
|
export declare class BridgeModule extends BaseModule {
|
|
5
5
|
getRelayFees(relayDenom: string, connectionId: string): Promise<BridgeModule.BridgeRelayFees>;
|
|
6
|
-
withdraw(params: BridgeModule.WithdrawParams, opts?:
|
|
7
|
-
withdrawAndExecute(params: BridgeModule.WithdrawAndExecuteParams, opts?:
|
|
6
|
+
withdraw(params: BridgeModule.WithdrawParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
7
|
+
withdrawAndExecute(params: BridgeModule.WithdrawAndExecuteParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
8
8
|
}
|
|
9
9
|
export declare namespace BridgeModule {
|
|
10
10
|
interface WithdrawParams {
|
package/lib/modules/bridge.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.BridgeModule = void 0;
|
|
7
|
-
const
|
|
7
|
+
const OrbixSDK_1 = require("../OrbixSDK");
|
|
8
8
|
const codec_1 = require("../codec");
|
|
9
9
|
const long_1 = __importDefault(require("long"));
|
|
10
10
|
const util_1 = require("../util");
|
|
@@ -37,7 +37,7 @@ class BridgeModule extends base_1.default {
|
|
|
37
37
|
denom: relayDenom,
|
|
38
38
|
amount: relayAmount.toString(10),
|
|
39
39
|
};
|
|
40
|
-
const value =
|
|
40
|
+
const value = OrbixSDK_1.Orbix.Bridge.MsgWithdrawToken.fromPartial({
|
|
41
41
|
creator: walletAddress,
|
|
42
42
|
connectionId,
|
|
43
43
|
receiver,
|
|
@@ -46,7 +46,7 @@ class BridgeModule extends base_1.default {
|
|
|
46
46
|
expiryDuration,
|
|
47
47
|
});
|
|
48
48
|
return await wallet.sendTx({
|
|
49
|
-
typeUrl: util_1.
|
|
49
|
+
typeUrl: util_1.OrbixTx.Types.MsgWithdrawToken,
|
|
50
50
|
value,
|
|
51
51
|
}, opts);
|
|
52
52
|
}
|
|
@@ -59,7 +59,7 @@ class BridgeModule extends base_1.default {
|
|
|
59
59
|
const expiryDuration = codec_1.Duration.fromPartial({
|
|
60
60
|
seconds: new long_1.default(expirySeconds),
|
|
61
61
|
});
|
|
62
|
-
const value =
|
|
62
|
+
const value = OrbixSDK_1.Orbix.Bridge.MsgExecuteFromCarbon.fromPartial({
|
|
63
63
|
creator: walletAddress,
|
|
64
64
|
connectionId,
|
|
65
65
|
executionContract,
|
|
@@ -76,7 +76,7 @@ class BridgeModule extends base_1.default {
|
|
|
76
76
|
expiryDuration,
|
|
77
77
|
});
|
|
78
78
|
return await wallet.sendTx({
|
|
79
|
-
typeUrl: util_1.
|
|
79
|
+
typeUrl: util_1.OrbixTx.Types.MsgExecuteFromCarbon,
|
|
80
80
|
value,
|
|
81
81
|
}, opts);
|
|
82
82
|
}
|
package/lib/modules/broker.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrbixTx } from "../util";
|
|
2
2
|
import BaseModule from "./base";
|
|
3
3
|
export declare class BrokerModule extends BaseModule {
|
|
4
|
-
initiateLiquidation(params: BrokerModule.InitiateLiquidationParams, opts?:
|
|
5
|
-
initiateLiquidations(params: BrokerModule.InitiateLiquidationParams[], opts?:
|
|
4
|
+
initiateLiquidation(params: BrokerModule.InitiateLiquidationParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
5
|
+
initiateLiquidations(params: BrokerModule.InitiateLiquidationParams[], opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
6
6
|
}
|
|
7
7
|
export declare namespace BrokerModule {
|
|
8
8
|
export interface InitiateLiquidationParams {
|
package/lib/modules/broker.js
CHANGED
|
@@ -15,7 +15,7 @@ class BrokerModule extends base_1.default {
|
|
|
15
15
|
positions: params.positions,
|
|
16
16
|
});
|
|
17
17
|
return await wallet.sendTx({
|
|
18
|
-
typeUrl: util_1.
|
|
18
|
+
typeUrl: util_1.OrbixTx.Types.MsgInitiateLiquidation,
|
|
19
19
|
value,
|
|
20
20
|
}, opts);
|
|
21
21
|
}
|
|
@@ -27,7 +27,7 @@ class BrokerModule extends base_1.default {
|
|
|
27
27
|
positions: param.positions,
|
|
28
28
|
});
|
|
29
29
|
return {
|
|
30
|
-
typeUrl: util_1.
|
|
30
|
+
typeUrl: util_1.OrbixTx.Types.MsgInitiateLiquidation,
|
|
31
31
|
value,
|
|
32
32
|
};
|
|
33
33
|
});
|
package/lib/modules/coin.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { Coin } from "../codec/cosmos/base/v1beta1/coin";
|
|
2
|
-
import {
|
|
2
|
+
import { OrbixTx } from "../util";
|
|
3
3
|
import BigNumber from "bignumber.js";
|
|
4
4
|
import BaseModule from "./base";
|
|
5
5
|
import Long from "long";
|
|
6
6
|
export declare class CoinModule extends BaseModule {
|
|
7
|
-
createWithdrawal(params: CoinModule.CreateWithdrawalParams, opts?:
|
|
8
|
-
mintToken(params: CoinModule.MintTokenParams, opts?:
|
|
9
|
-
depositToGroup(params: CoinModule.DepositToGroupParams, opts?:
|
|
10
|
-
convertToGroup(params: CoinModule.DepositToGroupParams[], opts?:
|
|
11
|
-
withdrawFromGroup(params: CoinModule.WithdrawFromGroupParams, opts?:
|
|
12
|
-
addBridgeAddress(params: CoinModule.AddBridgeAddressParams, opts?:
|
|
13
|
-
createToken(params: CoinModule.CreateTokenParams, opts?:
|
|
7
|
+
createWithdrawal(params: CoinModule.CreateWithdrawalParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
8
|
+
mintToken(params: CoinModule.MintTokenParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
9
|
+
depositToGroup(params: CoinModule.DepositToGroupParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
10
|
+
convertToGroup(params: CoinModule.DepositToGroupParams[], opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
11
|
+
withdrawFromGroup(params: CoinModule.WithdrawFromGroupParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
12
|
+
addBridgeAddress(params: CoinModule.AddBridgeAddressParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
13
|
+
createToken(params: CoinModule.CreateTokenParams, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
14
14
|
}
|
|
15
15
|
export declare namespace CoinModule {
|
|
16
16
|
interface CreateWithdrawalParams {
|
package/lib/modules/coin.js
CHANGED
|
@@ -21,7 +21,7 @@ class CoinModule extends base_1.default {
|
|
|
21
21
|
feeDenom: params.feeDenom,
|
|
22
22
|
});
|
|
23
23
|
return await wallet.sendTx({
|
|
24
|
-
typeUrl: util_1.
|
|
24
|
+
typeUrl: util_1.OrbixTx.Types.MsgWithdraw,
|
|
25
25
|
value,
|
|
26
26
|
}, opts);
|
|
27
27
|
}
|
|
@@ -34,7 +34,7 @@ class CoinModule extends base_1.default {
|
|
|
34
34
|
to: params.to ?? wallet.bech32Address,
|
|
35
35
|
});
|
|
36
36
|
return await wallet.sendTx({
|
|
37
|
-
typeUrl: util_1.
|
|
37
|
+
typeUrl: util_1.OrbixTx.Types.MsgMintToken,
|
|
38
38
|
value,
|
|
39
39
|
}, opts);
|
|
40
40
|
}
|
|
@@ -45,14 +45,14 @@ class CoinModule extends base_1.default {
|
|
|
45
45
|
depositCoin: params.depositCoin,
|
|
46
46
|
});
|
|
47
47
|
return await wallet.sendTx({
|
|
48
|
-
typeUrl: util_1.
|
|
48
|
+
typeUrl: util_1.OrbixTx.Types.MsgDepositToGroup,
|
|
49
49
|
value,
|
|
50
50
|
}, opts);
|
|
51
51
|
}
|
|
52
52
|
async convertToGroup(params, opts) {
|
|
53
53
|
const wallet = this.getWallet();
|
|
54
54
|
const messages = params.map(param => ({
|
|
55
|
-
typeUrl: util_1.
|
|
55
|
+
typeUrl: util_1.OrbixTx.Types.MsgDepositToGroup,
|
|
56
56
|
value: tx_1.MsgDepositToGroup.fromPartial({
|
|
57
57
|
creator: param.creator ?? wallet.bech32Address,
|
|
58
58
|
depositCoin: param.depositCoin,
|
|
@@ -67,7 +67,7 @@ class CoinModule extends base_1.default {
|
|
|
67
67
|
sourceCoin: params.sourceCoin,
|
|
68
68
|
});
|
|
69
69
|
return await wallet.sendTx({
|
|
70
|
-
typeUrl: util_1.
|
|
70
|
+
typeUrl: util_1.OrbixTx.Types.MsgWithdrawFromGroup,
|
|
71
71
|
value,
|
|
72
72
|
}, opts);
|
|
73
73
|
}
|
|
@@ -80,7 +80,7 @@ class CoinModule extends base_1.default {
|
|
|
80
80
|
bridgeAddress: params.bridgeAddress,
|
|
81
81
|
});
|
|
82
82
|
return await wallet.sendTx({
|
|
83
|
-
typeUrl: util_1.
|
|
83
|
+
typeUrl: util_1.OrbixTx.Types.MsgAddBridgeAddress,
|
|
84
84
|
value,
|
|
85
85
|
}, opts);
|
|
86
86
|
}
|
|
@@ -100,7 +100,7 @@ class CoinModule extends base_1.default {
|
|
|
100
100
|
},
|
|
101
101
|
});
|
|
102
102
|
return await wallet.sendTx({
|
|
103
|
-
typeUrl: util_1.
|
|
103
|
+
typeUrl: util_1.OrbixTx.Types.MsgCreateToken,
|
|
104
104
|
value,
|
|
105
105
|
}, opts);
|
|
106
106
|
}
|
package/lib/modules/evm.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Any } from "../codec";
|
|
2
2
|
import { AccessListTx, DynamicFeeTx, LegacyTx } from "../codec/ethermint/evm/v1/tx";
|
|
3
|
-
import {
|
|
3
|
+
import { OrbixTx } from "../util";
|
|
4
4
|
import { ethers } from "ethers";
|
|
5
5
|
import BaseModule from "./base";
|
|
6
6
|
export type TxData = LegacyTx | AccessListTx | DynamicFeeTx;
|
|
7
7
|
export declare class EvmModule extends BaseModule {
|
|
8
|
-
sendEvmTx(req: ethers.providers.TransactionRequest, opts?:
|
|
8
|
+
sendEvmTx(req: ethers.providers.TransactionRequest, opts?: OrbixTx.SignTxOpts): Promise<import("..").OrbixWallet.SendTxResponse>;
|
|
9
9
|
}
|
|
10
10
|
export declare function constructTxDataAny(req: ethers.providers.TransactionRequest): Any;
|
|
11
11
|
export declare namespace EvmModule {
|
package/lib/modules/evm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OrbixTx } from "../util";
|
|
2
2
|
import BaseModule from "./base";
|
|
3
3
|
export declare class EvmMergeModule extends BaseModule {
|
|
4
|
-
mergeAccount(params: EvmMergeModule.MergeAccountParams, opts?:
|
|
4
|
+
mergeAccount(params: EvmMergeModule.MergeAccountParams, opts?: OrbixTx.SignTxOpts): Promise<import("../OrbixSDK").OrbixWallet.SendTxResponse>;
|
|
5
5
|
}
|
|
6
6
|
export declare namespace EvmMergeModule {
|
|
7
7
|
interface MergeAccountParams {
|