Skip to content

Commit 798b914

Browse files
authored
Merge pull request #150 from theforager/unordered-updates
Update Cosmos signer for v53 Unordered Trxn Options
2 parents 799829b + 76d8288 commit 798b914

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

networks/cosmos/src/base/tx-builder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ export abstract class BaseCosmosTxBuilder<SignDoc>
145145
timeoutHeight: options?.timeoutHeight?.value,
146146
extensionOptions: options?.extensionOptions,
147147
nonCriticalExtensionOptions: options?.nonCriticalExtensionOptions,
148+
timeoutTimestamp: options?.timeoutTimestamp?.value,
149+
unordered: options?.unordered ?? false,
148150
});
149151
return {
150152
txBody,

networks/cosmos/src/types/signer.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,11 @@ export interface TimeoutHeightOption {
137137
value: bigint;
138138
}
139139

140+
export interface TimeoutTimestampOption {
141+
type: 'absolute';
142+
value: Date;
143+
}
144+
140145
export type TxOptions = {
141146
/**
142147
* timeout is the block height after which this transaction will not
@@ -147,6 +152,17 @@ export type TxOptions = {
147152
* - type `absolute`: this.value = TxBody.timeoutHeight
148153
*/
149154
timeoutHeight?: TimeoutHeightOption;
155+
/**
156+
* timeoutTimestamp is the time after which this transaction will not
157+
* be processed by the chain; for use with unordered transactions.
158+
*/
159+
timeoutTimestamp?: TimeoutTimestampOption;
160+
/**
161+
* unordered is set to true when the transaction is not ordered.
162+
* Note: this requires the timeoutTimestamp to be set
163+
* and the sequence to be set to 0
164+
*/
165+
unordered?: boolean;
150166
/**
151167
* extension_options are arbitrary options that can be added by chains
152168
* when the default options are not sufficient. If any of these are present

0 commit comments

Comments
 (0)