@skip-go/client 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -295,7 +295,7 @@ declare class SkipClient {
|
|
|
295
295
|
getGasPrice?: GetGasPrice;
|
|
296
296
|
gasAmountMultiplier?: number;
|
|
297
297
|
getFallbackGasAmount?: GetFallbackGasAmount;
|
|
298
|
-
}): Promise<Coin
|
|
298
|
+
}): Promise<Record<number, Coin>>;
|
|
299
299
|
validateCosmosGasBalance({ chainID, client, signerAddress, messages, getGasPrice, gasAmountMultiplier, getFallbackGasAmount, }: {
|
|
300
300
|
client: SigningStargateClient;
|
|
301
301
|
signerAddress: string;
|
package/dist/index.js
CHANGED
|
@@ -3098,9 +3098,9 @@ var SkipClient = class {
|
|
|
3098
3098
|
gasAmountMultiplier = chunkTUX4SN3U_js.DEFAULT_GAS_MULTIPLIER,
|
|
3099
3099
|
getFallbackGasAmount
|
|
3100
3100
|
} = options;
|
|
3101
|
-
let
|
|
3101
|
+
let gasTokenRecord;
|
|
3102
3102
|
if (validateGasBalance) {
|
|
3103
|
-
|
|
3103
|
+
gasTokenRecord = yield this.validateGasBalances({
|
|
3104
3104
|
txs,
|
|
3105
3105
|
userAddresses,
|
|
3106
3106
|
getOfflineSigner: options.getCosmosSigner,
|
|
@@ -3111,6 +3111,7 @@ var SkipClient = class {
|
|
|
3111
3111
|
}
|
|
3112
3112
|
for (let i = 0; i < txs.length; i++) {
|
|
3113
3113
|
const tx = txs[i];
|
|
3114
|
+
let gasTokenUsed = gasTokenRecord == null ? void 0 : gasTokenRecord[i];
|
|
3114
3115
|
if (!tx) {
|
|
3115
3116
|
raise(`executeRoute error: invalid message at index ${i}`);
|
|
3116
3117
|
}
|
|
@@ -4231,6 +4232,7 @@ var SkipClient = class {
|
|
|
4231
4232
|
getFallbackGasAmount
|
|
4232
4233
|
}) {
|
|
4233
4234
|
var _a;
|
|
4235
|
+
let gasTokenRecord = {};
|
|
4234
4236
|
for (let i = 0; i < txs.length; i++) {
|
|
4235
4237
|
const tx = txs[i];
|
|
4236
4238
|
if (!tx) {
|
|
@@ -4263,7 +4265,7 @@ var SkipClient = class {
|
|
|
4263
4265
|
)) == null ? void 0 : _a.address) || raise(
|
|
4264
4266
|
`validateGasBalance error: invalid address for chain '${tx.cosmosTx.chainID}'`
|
|
4265
4267
|
);
|
|
4266
|
-
|
|
4268
|
+
const coinUsed = yield this.validateCosmosGasBalance({
|
|
4267
4269
|
client,
|
|
4268
4270
|
signerAddress: currentAddress,
|
|
4269
4271
|
chainID: tx.cosmosTx.chainID,
|
|
@@ -4272,8 +4274,10 @@ var SkipClient = class {
|
|
|
4272
4274
|
gasAmountMultiplier,
|
|
4273
4275
|
getFallbackGasAmount
|
|
4274
4276
|
});
|
|
4277
|
+
gasTokenRecord[i] = coinUsed;
|
|
4275
4278
|
}
|
|
4276
4279
|
}
|
|
4280
|
+
return gasTokenRecord;
|
|
4277
4281
|
});
|
|
4278
4282
|
}
|
|
4279
4283
|
validateCosmosGasBalance(_0) {
|
package/package.json
CHANGED