@skip-go/client 1.6.0-alpha.3 → 1.6.0-alpha.4
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/cjs/api/getAssets.cjs +16 -0
- package/dist/cjs/api/getAssetsBetweenChains.cjs +12 -0
- package/dist/cjs/api/getBridges.cjs +12 -0
- package/dist/cjs/api/getChains.cjs +12 -0
- package/dist/cjs/api/getVenues.cjs +12 -0
- package/dist/cjs/api/postAssetsFromSource.cjs +13 -0
- package/dist/cjs/api/postBalances.cjs +12 -0
- package/dist/cjs/api/postIbcOriginAssets.cjs +12 -0
- package/dist/cjs/api/postMessages.cjs +12 -0
- package/dist/cjs/api/postMessagesDirect.cjs +12 -0
- package/dist/cjs/api/postRecommendAssets.cjs +12 -0
- package/dist/cjs/api/postRoute.cjs +12 -0
- package/dist/cjs/api/postSubmitTransaction.cjs +12 -0
- package/dist/cjs/api/postTrackTransaction.cjs +12 -0
- package/dist/cjs/api/postTransactionStatus.cjs +12 -0
- package/dist/cjs/chunk-25TA7Z7R.cjs +460 -0
- package/dist/cjs/chunk-2QPPD3BB.cjs +210 -0
- package/dist/cjs/chunk-2SA3OAIJ.cjs +18 -0
- package/dist/cjs/chunk-3KO2DHFX.cjs +1495 -0
- package/dist/cjs/chunk-477CU2G2.cjs +280 -0
- package/dist/cjs/chunk-4BWE7SOV.cjs +68 -0
- package/dist/cjs/chunk-4GHUZDDP.cjs +16 -0
- package/dist/cjs/chunk-4ZIVDKQN.cjs +387 -0
- package/dist/cjs/chunk-6T4SBY5H.cjs +214 -0
- package/dist/cjs/chunk-A3UNNRKD.cjs +574 -0
- package/dist/cjs/chunk-A5S6SIYN.cjs +12 -0
- package/dist/cjs/chunk-ASDMDYTC.cjs +11 -0
- package/dist/cjs/chunk-ATW6UNT5.cjs +136 -0
- package/dist/cjs/chunk-AUTOIM57.cjs +22 -0
- package/dist/cjs/chunk-AVWWCQ5P.cjs +2264 -0
- package/dist/cjs/chunk-CIZTNJ3K.cjs +24 -0
- package/dist/cjs/chunk-CK6CQWQU.cjs +49 -0
- package/dist/cjs/chunk-EAZQ2ECA.cjs +185 -0
- package/dist/cjs/chunk-F3EB2AQG.cjs +28 -0
- package/dist/cjs/chunk-FCTBCHOT.cjs +12 -0
- package/dist/cjs/chunk-IJIBMN2F.cjs +12 -0
- package/dist/cjs/chunk-IUMMXFGP.cjs +189 -0
- package/dist/cjs/chunk-JRXPJ45U.cjs +12 -0
- package/dist/cjs/chunk-LJV45UGL.cjs +582 -0
- package/dist/cjs/chunk-MUJBB64F.cjs +291 -0
- package/dist/cjs/chunk-NCFH5MGF.cjs +39 -0
- package/dist/cjs/chunk-NM4PISTQ.cjs +3359 -0
- package/dist/cjs/chunk-OJISEAMX.cjs +13 -0
- package/dist/cjs/chunk-OVKHTOBP.cjs +99 -0
- package/dist/cjs/chunk-PDNKS5R2.cjs +13 -0
- package/dist/cjs/chunk-TELXDMYL.cjs +55 -0
- package/dist/cjs/chunk-UXW4XVHF.cjs +15 -0
- package/dist/cjs/index.cjs +349 -0
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +27 -0
- package/dist/cjs/public-functions/executeRoute.cjs +27 -0
- package/dist/cjs/public-functions/getCosmosGasAmountForMessage.cjs +16 -0
- package/dist/cjs/public-functions/getEvmGasAmountForMessage.cjs +11 -0
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +14 -0
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +15 -0
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +41 -0
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +15 -0
- package/dist/cjs/public-functions/setApiOptions.cjs +12 -0
- package/dist/cjs/public-functions/setClientOptions.cjs +16 -0
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +26 -0
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +18 -0
- package/dist/cjs/public-functions/waitForTransaction.cjs +18 -0
- package/dist/esm/api/getAssets.d.ts +19 -0
- package/dist/esm/api/getAssets.js +3 -0
- package/dist/esm/api/getAssetsBetweenChains.d.ts +56 -0
- package/dist/esm/api/getAssetsBetweenChains.js +3 -0
- package/dist/esm/api/getBridges.d.ts +55 -0
- package/dist/esm/api/getBridges.js +3 -0
- package/dist/esm/api/getChains.d.ts +41 -0
- package/dist/esm/api/getChains.js +3 -0
- package/dist/esm/api/getVenues.d.ts +13 -0
- package/dist/esm/api/getVenues.js +3 -0
- package/dist/esm/api/postAssetsFromSource.d.ts +22 -0
- package/dist/esm/api/postAssetsFromSource.js +4 -0
- package/dist/esm/api/postBalances.d.ts +35 -0
- package/dist/esm/api/postBalances.js +3 -0
- package/dist/esm/api/postIbcOriginAssets.d.ts +32 -0
- package/dist/esm/api/postIbcOriginAssets.js +3 -0
- package/dist/esm/api/postMessages.d.ts +101 -0
- package/dist/esm/api/postMessages.js +3 -0
- package/dist/esm/api/postMessagesDirect.d.ts +640 -0
- package/dist/esm/api/postMessagesDirect.js +3 -0
- package/dist/esm/api/postRecommendAssets.d.ts +40 -0
- package/dist/esm/api/postRecommendAssets.js +3 -0
- package/dist/esm/api/postRoute.d.ts +530 -0
- package/dist/esm/api/postRoute.js +3 -0
- package/dist/esm/api/postSubmitTransaction.d.ts +17 -0
- package/dist/esm/api/postSubmitTransaction.js +3 -0
- package/dist/esm/api/postTrackTransaction.d.ts +12 -0
- package/dist/esm/api/postTrackTransaction.js +3 -0
- package/dist/esm/api/postTransactionStatus.d.ts +639 -0
- package/dist/esm/api/postTransactionStatus.js +3 -0
- package/dist/esm/apiState-1VvikVK-.d.ts +8 -0
- package/dist/esm/callbacks-DdC6QMlE.d.ts +158 -0
- package/dist/esm/chunk-3DIX6KRJ.js +566 -0
- package/dist/esm/chunk-3JHLVPRG.js +10 -0
- package/dist/esm/chunk-5WYMRZIO.js +97 -0
- package/dist/esm/chunk-A5NZMSTI.js +10 -0
- package/dist/esm/chunk-BU5RCZQH.js +187 -0
- package/dist/esm/chunk-CGJRRAFS.js +22 -0
- package/dist/esm/chunk-DMJMN4J3.js +379 -0
- package/dist/esm/chunk-E4NRDAVO.js +65 -0
- package/dist/esm/chunk-ETBJVFQP.js +10 -0
- package/dist/esm/chunk-F2LQB2DP.js +3323 -0
- package/dist/esm/chunk-F66EKL3W.js +203 -0
- package/dist/esm/chunk-G665WTT3.js +212 -0
- package/dist/esm/chunk-GPEO2I4P.js +272 -0
- package/dist/esm/chunk-GV2QOWB4.js +26 -0
- package/dist/esm/chunk-GZJLX2CP.js +2258 -0
- package/dist/esm/chunk-HNU2Y3JI.js +13 -0
- package/dist/esm/chunk-IZUHXTBP.js +53 -0
- package/dist/esm/chunk-J24LYWJE.js +130 -0
- package/dist/esm/chunk-KZKAL5ZN.js +16 -0
- package/dist/esm/chunk-N4PTRCNT.js +11 -0
- package/dist/esm/chunk-NUHMTWHP.js +180 -0
- package/dist/esm/chunk-P36PE4CR.js +37 -0
- package/dist/esm/chunk-QYXGDTUU.js +47 -0
- package/dist/esm/chunk-RH7PDDI5.js +433 -0
- package/dist/esm/chunk-RTDD7HZ3.js +275 -0
- package/dist/esm/chunk-SXBG57J3.js +20 -0
- package/dist/esm/chunk-TGTOO2ZQ.js +14 -0
- package/dist/esm/chunk-UHCKOKBM.js +9 -0
- package/dist/esm/chunk-ULUX2CVU.js +557 -0
- package/dist/esm/chunk-UN46DUOV.js +11 -0
- package/dist/esm/chunk-XIVAEU6S.js +1492 -0
- package/dist/esm/chunk-XNU3TKKM.js +10 -0
- package/dist/esm/client-types-D03Tellv.d.ts +114 -0
- package/dist/esm/generateApi-Bv02Xt5y.d.ts +56 -0
- package/dist/esm/index.d.ts +1859 -0
- package/dist/esm/index.js +32 -0
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +80 -0
- package/dist/esm/public-functions/executeMultipleRoutes.js +18 -0
- package/dist/esm/public-functions/executeRoute.d.ts +12 -0
- package/dist/esm/public-functions/executeRoute.js +18 -0
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +8 -0
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.js +3 -0
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +14 -0
- package/dist/esm/public-functions/getEvmGasAmountForMessage.js +2 -0
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +9 -0
- package/dist/esm/public-functions/getFeeInfoForChain.js +5 -0
- package/dist/esm/public-functions/getRecommendedGasPrice.d.ts +9 -0
- package/dist/esm/public-functions/getRecommendedGasPrice.js +6 -0
- package/dist/esm/public-functions/getRouteWithGasOnReceive.d.ts +20 -0
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +32 -0
- package/dist/esm/public-functions/getSigningStargateClient.d.ts +13 -0
- package/dist/esm/public-functions/getSigningStargateClient.js +6 -0
- package/dist/esm/public-functions/setApiOptions.d.ts +9 -0
- package/dist/esm/public-functions/setApiOptions.js +3 -0
- package/dist/esm/public-functions/setClientOptions.d.ts +11 -0
- package/dist/esm/public-functions/setClientOptions.js +7 -0
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +12 -0
- package/dist/esm/public-functions/subscribeToRouteStatus.js +5 -0
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +44 -0
- package/dist/esm/public-functions/validateCosmosGasBalance.js +9 -0
- package/dist/esm/public-functions/waitForTransaction.d.ts +1279 -0
- package/dist/esm/public-functions/waitForTransaction.js +5 -0
- package/dist/esm/setClientOptions-CTwe8YVX.d.ts +76 -0
- package/dist/esm/swaggerTypes-CzGbnX_b.d.ts +2067 -0
- package/package.json +1 -1
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkNM4PISTQ_cjs = require('./chunk-NM4PISTQ.cjs');
|
|
4
|
+
var chunkMUJBB64F_cjs = require('./chunk-MUJBB64F.cjs');
|
|
5
|
+
require('@cosmjs/stargate');
|
|
6
|
+
var encoding = require('@cosmjs/encoding');
|
|
7
|
+
var tx_js$2 = require('cosmjs-types/cosmos/bank/v1beta1/tx.js');
|
|
8
|
+
var tx_js$1 = require('cosmjs-types/cosmwasm/wasm/v1/tx.js');
|
|
9
|
+
var tx_js = require('cosmjs-types/ibc/applications/transfer/v1/tx.js');
|
|
10
|
+
var _m0 = require('protobufjs/minimal.js');
|
|
11
|
+
|
|
12
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
|
|
14
|
+
var _m0__default = /*#__PURE__*/_interopDefault(_m0);
|
|
15
|
+
|
|
16
|
+
function createBaseClawbackVestingAccount() {
|
|
17
|
+
return {
|
|
18
|
+
baseVestingAccount: void 0,
|
|
19
|
+
funderAddress: "",
|
|
20
|
+
startTime: /* @__PURE__ */ new Date(),
|
|
21
|
+
lockupPeriods: [],
|
|
22
|
+
vestingPeriods: []
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
var ClawbackVestingAccount = {
|
|
26
|
+
typeUrl: "/evmos.vesting.v2.ClawbackVestingAccount",
|
|
27
|
+
encode(message, writer = _m0__default.default.Writer.create()) {
|
|
28
|
+
if (message.baseVestingAccount !== void 0) {
|
|
29
|
+
chunkNM4PISTQ_cjs.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim();
|
|
30
|
+
}
|
|
31
|
+
if (message.funderAddress !== "") {
|
|
32
|
+
writer.uint32(18).string(message.funderAddress);
|
|
33
|
+
}
|
|
34
|
+
if (message.startTime !== void 0) {
|
|
35
|
+
chunkNM4PISTQ_cjs.Timestamp.encode(chunkMUJBB64F_cjs.toTimestamp(message.startTime), writer.uint32(26).fork()).ldelim();
|
|
36
|
+
}
|
|
37
|
+
for (const v of message.lockupPeriods) {
|
|
38
|
+
chunkNM4PISTQ_cjs.Period.encode(v, writer.uint32(34).fork()).ldelim();
|
|
39
|
+
}
|
|
40
|
+
for (const v of message.vestingPeriods) {
|
|
41
|
+
chunkNM4PISTQ_cjs.Period.encode(v, writer.uint32(42).fork()).ldelim();
|
|
42
|
+
}
|
|
43
|
+
return writer;
|
|
44
|
+
},
|
|
45
|
+
decode(input, length) {
|
|
46
|
+
const reader = input instanceof _m0__default.default.Reader ? input : new _m0__default.default.Reader(input);
|
|
47
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
48
|
+
const message = createBaseClawbackVestingAccount();
|
|
49
|
+
while (reader.pos < end) {
|
|
50
|
+
const tag = reader.uint32();
|
|
51
|
+
switch (tag >>> 3) {
|
|
52
|
+
case 1:
|
|
53
|
+
message.baseVestingAccount = chunkNM4PISTQ_cjs.BaseVestingAccount.decode(reader, reader.uint32());
|
|
54
|
+
break;
|
|
55
|
+
case 2:
|
|
56
|
+
message.funderAddress = reader.string();
|
|
57
|
+
break;
|
|
58
|
+
case 3:
|
|
59
|
+
message.startTime = chunkMUJBB64F_cjs.fromTimestamp(chunkNM4PISTQ_cjs.Timestamp.decode(reader, reader.uint32()));
|
|
60
|
+
break;
|
|
61
|
+
case 4:
|
|
62
|
+
message.lockupPeriods.push(chunkNM4PISTQ_cjs.Period.decode(reader, reader.uint32()));
|
|
63
|
+
break;
|
|
64
|
+
case 5:
|
|
65
|
+
message.vestingPeriods.push(chunkNM4PISTQ_cjs.Period.decode(reader, reader.uint32()));
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
reader.skipType(tag & 7);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return message;
|
|
73
|
+
},
|
|
74
|
+
fromJSON(object) {
|
|
75
|
+
return {
|
|
76
|
+
baseVestingAccount: chunkMUJBB64F_cjs.isSet(object.baseVestingAccount) ? chunkNM4PISTQ_cjs.BaseVestingAccount.fromJSON(object.baseVestingAccount) : void 0,
|
|
77
|
+
funderAddress: chunkMUJBB64F_cjs.isSet(object.funderAddress) ? String(object.funderAddress) : "",
|
|
78
|
+
startTime: chunkMUJBB64F_cjs.isSet(object.startTime) ? chunkMUJBB64F_cjs.fromJsonTimestamp(object.startTime) : void 0,
|
|
79
|
+
lockupPeriods: Array.isArray(object?.lockupPeriods) ? object.lockupPeriods.map((e) => chunkNM4PISTQ_cjs.Period.fromJSON(e)) : [],
|
|
80
|
+
vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e) => chunkNM4PISTQ_cjs.Period.fromJSON(e)) : []
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
toJSON(message) {
|
|
84
|
+
const obj = {};
|
|
85
|
+
message.baseVestingAccount !== void 0 && (obj.baseVestingAccount = message.baseVestingAccount ? chunkNM4PISTQ_cjs.BaseVestingAccount.toJSON(message.baseVestingAccount) : void 0);
|
|
86
|
+
message.funderAddress !== void 0 && (obj.funderAddress = message.funderAddress);
|
|
87
|
+
message.startTime !== void 0 && (obj.startTime = message.startTime.toISOString());
|
|
88
|
+
if (message.lockupPeriods) {
|
|
89
|
+
obj.lockupPeriods = message.lockupPeriods.map((e) => e ? chunkNM4PISTQ_cjs.Period.toJSON(e) : void 0);
|
|
90
|
+
} else {
|
|
91
|
+
obj.lockupPeriods = [];
|
|
92
|
+
}
|
|
93
|
+
if (message.vestingPeriods) {
|
|
94
|
+
obj.vestingPeriods = message.vestingPeriods.map((e) => e ? chunkNM4PISTQ_cjs.Period.toJSON(e) : void 0);
|
|
95
|
+
} else {
|
|
96
|
+
obj.vestingPeriods = [];
|
|
97
|
+
}
|
|
98
|
+
return obj;
|
|
99
|
+
},
|
|
100
|
+
fromPartial(object) {
|
|
101
|
+
const message = createBaseClawbackVestingAccount();
|
|
102
|
+
message.baseVestingAccount = object.baseVestingAccount !== void 0 && object.baseVestingAccount !== null ? chunkNM4PISTQ_cjs.BaseVestingAccount.fromPartial(object.baseVestingAccount) : void 0;
|
|
103
|
+
message.funderAddress = object.funderAddress ?? "";
|
|
104
|
+
message.startTime = object.startTime ?? void 0;
|
|
105
|
+
message.lockupPeriods = object.lockupPeriods?.map((e) => chunkNM4PISTQ_cjs.Period.fromPartial(e)) || [];
|
|
106
|
+
message.vestingPeriods = object.vestingPeriods?.map((e) => chunkNM4PISTQ_cjs.Period.fromPartial(e)) || [];
|
|
107
|
+
return message;
|
|
108
|
+
},
|
|
109
|
+
fromAmino(object) {
|
|
110
|
+
const message = createBaseClawbackVestingAccount();
|
|
111
|
+
if (object.base_vesting_account !== void 0 && object.base_vesting_account !== null) {
|
|
112
|
+
message.baseVestingAccount = chunkNM4PISTQ_cjs.BaseVestingAccount.fromAmino(object.base_vesting_account);
|
|
113
|
+
}
|
|
114
|
+
if (object.funder_address !== void 0 && object.funder_address !== null) {
|
|
115
|
+
message.funderAddress = object.funder_address;
|
|
116
|
+
}
|
|
117
|
+
if (object.start_time !== void 0 && object.start_time !== null) {
|
|
118
|
+
message.startTime = chunkMUJBB64F_cjs.fromTimestamp(chunkNM4PISTQ_cjs.Timestamp.fromAmino(object.start_time));
|
|
119
|
+
}
|
|
120
|
+
message.lockupPeriods = object.lockup_periods?.map((e) => chunkNM4PISTQ_cjs.Period.fromAmino(e)) || [];
|
|
121
|
+
message.vestingPeriods = object.vesting_periods?.map((e) => chunkNM4PISTQ_cjs.Period.fromAmino(e)) || [];
|
|
122
|
+
return message;
|
|
123
|
+
},
|
|
124
|
+
toAmino(message) {
|
|
125
|
+
const obj = {};
|
|
126
|
+
obj.base_vesting_account = message.baseVestingAccount ? chunkNM4PISTQ_cjs.BaseVestingAccount.toAmino(message.baseVestingAccount) : void 0;
|
|
127
|
+
obj.funder_address = message.funderAddress === "" ? void 0 : message.funderAddress;
|
|
128
|
+
obj.start_time = message.startTime ? chunkNM4PISTQ_cjs.Timestamp.toAmino(chunkMUJBB64F_cjs.toTimestamp(message.startTime)) : void 0;
|
|
129
|
+
if (message.lockupPeriods) {
|
|
130
|
+
obj.lockup_periods = message.lockupPeriods.map((e) => e ? chunkNM4PISTQ_cjs.Period.toAmino(e) : void 0);
|
|
131
|
+
} else {
|
|
132
|
+
obj.lockup_periods = message.lockupPeriods;
|
|
133
|
+
}
|
|
134
|
+
if (message.vestingPeriods) {
|
|
135
|
+
obj.vesting_periods = message.vestingPeriods.map((e) => e ? chunkNM4PISTQ_cjs.Period.toAmino(e) : void 0);
|
|
136
|
+
} else {
|
|
137
|
+
obj.vesting_periods = message.vestingPeriods;
|
|
138
|
+
}
|
|
139
|
+
return obj;
|
|
140
|
+
},
|
|
141
|
+
fromAminoMsg(object) {
|
|
142
|
+
return ClawbackVestingAccount.fromAmino(object.value);
|
|
143
|
+
},
|
|
144
|
+
toAminoMsg(message) {
|
|
145
|
+
return {
|
|
146
|
+
type: "vesting/ClawbackVestingAccount",
|
|
147
|
+
value: ClawbackVestingAccount.toAmino(message)
|
|
148
|
+
};
|
|
149
|
+
},
|
|
150
|
+
fromProtoMsg(message) {
|
|
151
|
+
return ClawbackVestingAccount.decode(message.value);
|
|
152
|
+
},
|
|
153
|
+
toProto(message) {
|
|
154
|
+
return ClawbackVestingAccount.encode(message).finish();
|
|
155
|
+
},
|
|
156
|
+
toProtoMsg(message) {
|
|
157
|
+
return {
|
|
158
|
+
typeUrl: "/evmos.vesting.v2.ClawbackVestingAccount",
|
|
159
|
+
value: ClawbackVestingAccount.encode(message).finish()
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
// src/private-functions/cosmos/getEncodeObjectFromCosmosMessage.ts
|
|
165
|
+
function getEncodeObjectFromCosmosMessage(message) {
|
|
166
|
+
const msgJson = JSON.parse(message.msg ?? "");
|
|
167
|
+
if (message.msgTypeUrl === "/ibc.applications.transfer.v1.MsgTransfer") {
|
|
168
|
+
return {
|
|
169
|
+
typeUrl: "/ibc.applications.transfer.v1.MsgTransfer",
|
|
170
|
+
value: tx_js.MsgTransfer.fromJSON({
|
|
171
|
+
sourcePort: msgJson.source_port,
|
|
172
|
+
sourceChannel: msgJson.source_channel,
|
|
173
|
+
token: msgJson.token,
|
|
174
|
+
sender: msgJson.sender,
|
|
175
|
+
receiver: msgJson.receiver,
|
|
176
|
+
timeoutHeight: msgJson.timeout_height,
|
|
177
|
+
timeoutTimestamp: msgJson.timeout_timestamp,
|
|
178
|
+
memo: msgJson.memo
|
|
179
|
+
})
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
if (message.msgTypeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract") {
|
|
183
|
+
return {
|
|
184
|
+
typeUrl: message.msgTypeUrl,
|
|
185
|
+
value: tx_js$1.MsgExecuteContract.fromPartial({
|
|
186
|
+
sender: msgJson.sender,
|
|
187
|
+
contract: msgJson.contract,
|
|
188
|
+
msg: encoding.toUtf8(JSON.stringify(msgJson.msg)),
|
|
189
|
+
funds: msgJson.funds
|
|
190
|
+
})
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
if (message.msgTypeUrl === "/cosmos.bank.v1beta1.MsgSend") {
|
|
194
|
+
return {
|
|
195
|
+
typeUrl: message.msgTypeUrl,
|
|
196
|
+
value: tx_js$2.MsgSend.fromPartial({
|
|
197
|
+
fromAddress: msgJson.from_address,
|
|
198
|
+
toAddress: msgJson.to_address,
|
|
199
|
+
amount: msgJson.amount
|
|
200
|
+
})
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurn") {
|
|
204
|
+
return {
|
|
205
|
+
typeUrl: message.msgTypeUrl,
|
|
206
|
+
value: chunkNM4PISTQ_cjs.MsgDepositForBurn.fromAmino(msgJson)
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurnWithCaller") {
|
|
210
|
+
return {
|
|
211
|
+
typeUrl: message.msgTypeUrl,
|
|
212
|
+
value: chunkNM4PISTQ_cjs.MsgDepositForBurnWithCaller.fromAmino(msgJson)
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
if (message.msgTypeUrl === "/initia.move.v1.MsgExecute") {
|
|
216
|
+
return {
|
|
217
|
+
typeUrl: message.msgTypeUrl,
|
|
218
|
+
value: chunkNM4PISTQ_cjs.MsgExecute.fromPartial({
|
|
219
|
+
sender: msgJson.sender,
|
|
220
|
+
moduleAddress: msgJson.module_address,
|
|
221
|
+
moduleName: msgJson.module_name,
|
|
222
|
+
functionName: msgJson.function_name,
|
|
223
|
+
args: msgJson.args
|
|
224
|
+
})
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
if (message.msgTypeUrl === "/opinit.ophost.v1.MsgInitiateTokenDeposit") {
|
|
228
|
+
return {
|
|
229
|
+
typeUrl: message.msgTypeUrl,
|
|
230
|
+
value: chunkNM4PISTQ_cjs.MsgInitiateTokenDeposit.fromPartial({
|
|
231
|
+
sender: msgJson.sender,
|
|
232
|
+
to: msgJson.to,
|
|
233
|
+
amount: msgJson.amount,
|
|
234
|
+
bridgeId: msgJson.bridge_id
|
|
235
|
+
})
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
if (message.msgTypeUrl === "/evmos.vesting.v2.ClawbackVestingAccount") {
|
|
239
|
+
return {
|
|
240
|
+
typeUrl: message.msgTypeUrl,
|
|
241
|
+
value: ClawbackVestingAccount.fromPartial({
|
|
242
|
+
baseVestingAccount: msgJson.base_vesting_account,
|
|
243
|
+
funderAddress: msgJson.funder_address,
|
|
244
|
+
lockupPeriods: msgJson.lockup_periods,
|
|
245
|
+
startTime: msgJson.start_time,
|
|
246
|
+
vestingPeriods: msgJson.vesting_periods
|
|
247
|
+
})
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
return {
|
|
251
|
+
typeUrl: message.msgTypeUrl ?? "",
|
|
252
|
+
value: msgJson
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
// src/public-functions/getCosmosGasAmountForMessage.ts
|
|
257
|
+
var DEFAULT_GAS_MULTIPLIER = 1.5;
|
|
258
|
+
async function getCosmosGasAmountForMessage(client, signerAddress, chainId, messages, encodedMsgs, multiplier = DEFAULT_GAS_MULTIPLIER) {
|
|
259
|
+
if (!messages && !encodedMsgs) {
|
|
260
|
+
throw new Error("Either message or encodedMsg must be provided");
|
|
261
|
+
}
|
|
262
|
+
const _encodedMsgs = messages?.map((message) => getEncodeObjectFromCosmosMessage(message));
|
|
263
|
+
encodedMsgs = encodedMsgs || _encodedMsgs;
|
|
264
|
+
if (!encodedMsgs) {
|
|
265
|
+
throw new Error("Either message or encodedMsg must be provided");
|
|
266
|
+
}
|
|
267
|
+
if (chainId.includes("evmos") || chainId.includes("injective") || chainId.includes("dymension") || chainId.includes("sunrise-1") || process?.env.NODE_ENV === "test") {
|
|
268
|
+
if (messages?.find((i) => i.msgTypeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract")) {
|
|
269
|
+
return "2400000";
|
|
270
|
+
}
|
|
271
|
+
return "300000";
|
|
272
|
+
}
|
|
273
|
+
const estimatedGas = await client.simulate(signerAddress, encodedMsgs, "");
|
|
274
|
+
const estimatedGasWithBuffer = estimatedGas * multiplier;
|
|
275
|
+
return Math.ceil(estimatedGasWithBuffer).toFixed(0);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
exports.DEFAULT_GAS_MULTIPLIER = DEFAULT_GAS_MULTIPLIER;
|
|
279
|
+
exports.getCosmosGasAmountForMessage = getCosmosGasAmountForMessage;
|
|
280
|
+
exports.getEncodeObjectFromCosmosMessage = getEncodeObjectFromCosmosMessage;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkAUTOIM57_cjs = require('./chunk-AUTOIM57.cjs');
|
|
4
|
+
var chunkPDNKS5R2_cjs = require('./chunk-PDNKS5R2.cjs');
|
|
5
|
+
var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
|
|
6
|
+
|
|
7
|
+
// src/public-functions/waitForTransaction.ts
|
|
8
|
+
var waitForTransaction = async ({
|
|
9
|
+
chainId,
|
|
10
|
+
txHash,
|
|
11
|
+
explorerLink,
|
|
12
|
+
doNotTrack = false,
|
|
13
|
+
onStatusUpdated,
|
|
14
|
+
onError,
|
|
15
|
+
onTransactionTracked,
|
|
16
|
+
isCancelled,
|
|
17
|
+
...trackTxPollingOptions
|
|
18
|
+
}) => {
|
|
19
|
+
try {
|
|
20
|
+
if (!explorerLink && !doNotTrack) {
|
|
21
|
+
const response = await chunkAUTOIM57_cjs.trackTransaction({
|
|
22
|
+
chainId,
|
|
23
|
+
txHash,
|
|
24
|
+
...trackTxPollingOptions
|
|
25
|
+
});
|
|
26
|
+
explorerLink = response.explorerLink;
|
|
27
|
+
await onTransactionTracked?.({ txHash, chainId, explorerLink });
|
|
28
|
+
}
|
|
29
|
+
} catch (error) {
|
|
30
|
+
console.warn(`track failed for txHash:${txHash}, chainId: ${chainId}`);
|
|
31
|
+
}
|
|
32
|
+
while (true) {
|
|
33
|
+
if (isCancelled?.()) {
|
|
34
|
+
throw new Error("waitForTransaction was aborted");
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
const txStatusResponse = await chunkPDNKS5R2_cjs.transactionStatus({
|
|
38
|
+
chainId,
|
|
39
|
+
txHash
|
|
40
|
+
});
|
|
41
|
+
onStatusUpdated?.(txStatusResponse);
|
|
42
|
+
if (txStatusResponse.state === "STATE_COMPLETED_SUCCESS") {
|
|
43
|
+
return txStatusResponse;
|
|
44
|
+
}
|
|
45
|
+
if (txStatusResponse.state === "STATE_COMPLETED_ERROR") {
|
|
46
|
+
throw new Error(`${txStatusResponse.error?.type}: ${txStatusResponse.error?.message}`);
|
|
47
|
+
}
|
|
48
|
+
if (txStatusResponse.state === "STATE_ABANDONED") {
|
|
49
|
+
throw new Error("Tracking for the transaction has been abandoned");
|
|
50
|
+
}
|
|
51
|
+
await chunk2QPPD3BB_cjs.wait(1e3);
|
|
52
|
+
} catch (error) {
|
|
53
|
+
onError?.(error);
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var waitForTransactionWithCancel = (props) => {
|
|
59
|
+
let isCancelled = false;
|
|
60
|
+
const cancel = () => {
|
|
61
|
+
isCancelled = true;
|
|
62
|
+
};
|
|
63
|
+
const wrappedPromise = waitForTransaction({ ...props, isCancelled: () => isCancelled });
|
|
64
|
+
return { promise: wrappedPromise, cancel };
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.waitForTransaction = waitForTransaction;
|
|
68
|
+
exports.waitForTransactionWithCancel = waitForTransactionWithCancel;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
4
|
+
var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
|
|
5
|
+
|
|
6
|
+
// src/api/postAssetsFromSource.ts
|
|
7
|
+
var assetsFromSource = chunk2QPPD3BB_cjs.api({
|
|
8
|
+
methodName: "assetsFromSource",
|
|
9
|
+
method: "post",
|
|
10
|
+
path: "v2/fungible/assets_from_source",
|
|
11
|
+
transformResponse(response) {
|
|
12
|
+
return chunkATW6UNT5_cjs.transformAssetsMap(response.destAssets);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
exports.assetsFromSource = assetsFromSource;
|