Upgrade v4 clients and @cosmjs packages (#243)

* Upgrade v4-client and @cosmjs packages

* add comments
This commit is contained in:
Bill
2024-01-24 15:29:43 -08:00
committed by GitHub
parent da1ac0d087
commit 48e67f5681
4 changed files with 192 additions and 63 deletions
+7 -1
View File
@@ -198,7 +198,13 @@ export const useSubaccountContext = ({ localDydxWallet }: { localDydxWallet?: Lo
);
const ibcMsg: EncodeObject = {
typeUrl: transaction.msgTypeUrl,
value: transaction.msg,
value: {
...transaction.msg,
timeoutTimestamp: transaction.msg.timeoutTimestamp
// Squid returns timeoutTimestamp as Long, but the signer expects BigInt
? BigInt(Long.fromValue(transaction.msg.timeoutTimestamp).toString())
: undefined,
},
};
return await compositeClient.send(
+18 -2
View File
@@ -173,6 +173,10 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
return parsedObj as T;
}
if (typeof x === 'bigint') {
return x.toString() as T;
}
throw new Error(`Unsupported data type: ${typeof x}`);
}
@@ -363,7 +367,13 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
try {
const ibcMsg = {
typeUrl: params.msgTypeUrl, // '/ibc.applications.transfer.v1.MsgTransfer',
value: params.msg,
value: {
...params.msg,
timeoutTimestamp: params.msg.timeoutTimestamp
// Squid returns timeoutTimestamp as Long, but the signer expects BigInt
? BigInt(Long.fromValue(params.msg.timeoutTimestamp).toString())
: undefined,
},
};
const fee = await this.nobleClient.simulateTransaction([ibcMsg]);
@@ -413,7 +423,13 @@ class DydxChainTransactions implements AbacusDYDXChainTransactionsProtocol {
);
const ibcMsg: EncodeObject = {
typeUrl: parsedIbcPayload.msgTypeUrl,
value: parsedIbcPayload.msg,
value: {
...parsedIbcPayload.msg,
timeoutTimestamp: parsedIbcPayload.msg.timeoutTimestamp
// Squid returns timeoutTimestamp as Long, but the signer expects BigInt
? BigInt(Long.fromValue(parsedIbcPayload.msg.timeoutTimestamp).toString())
: undefined,
},
};
const tx = await this.compositeClient.send(