Class: Transaction
Defined in: packages/txm/lib/Transaction.ts:112
Accessors
attemptCount
Get Signature
get attemptCount(): number;
Defined in: packages/txm/lib/Transaction.ts:314
Returns
number
lastAttempt
Get Signature
get lastAttempt(): undefined | Attempt;
Defined in: packages/txm/lib/Transaction.ts:318
Returns
undefined
| Attempt
Constructors
Constructor
new Transaction(config: TransactionConstructorConfig & {
attempts?: Attempt[];
chainId: number;
collectionBlock?: bigint;
createdAt?: Date;
from: `0x${string}`;
intentId?: UUID;
notPersisted?: boolean;
pendingFlush?: boolean;
status?: TransactionStatus | undefined;
updatedAt?: Date;
}, abiManager: ABIManager): Transaction;
Defined in: packages/txm/lib/Transaction.ts:172
Parameters
config
TransactionConstructorConfig
& {
attempts?
: Attempt
[];
chainId
: number
;
collectionBlock?
: bigint
;
createdAt?
: Date
;
from
: `0x${string}`
;
intentId?
: UUID
;
notPersisted?
: boolean
;
pendingFlush?
: boolean
;
status?
: TransactionStatus | undefined;
updatedAt?
: Date
;
}
abiManager
ABIManager
Returns
Transaction
Methods
addAttempt()
addAttempt(attempt: Attempt): void;
Defined in: packages/txm/lib/Transaction.ts:226
Parameters
attempt
Attempt
Returns
void
addCollectionBlock()
addCollectionBlock(blockNumber: bigint): void;
Defined in: packages/txm/lib/Transaction.ts:231
Parameters
blockNumber
bigint
Returns
void
changeStatus()
changeStatus(status: TransactionStatus): void;
Defined in: packages/txm/lib/Transaction.ts:255
Parameters
status
Returns
void
getInAirAttempts()
getInAirAttempts(): Attempt[];
Defined in: packages/txm/lib/Transaction.ts:244
Returns
Attempt
[]
isExpired()
isExpired(block: LatestBlock, blockTime: bigint): boolean;
Defined in: packages/txm/lib/Transaction.ts:250
Parameters
block
blockTime
bigint
Returns
boolean
markFlushed()
markFlushed(): void;
Defined in: packages/txm/lib/Transaction.ts:322
Returns
void
on()
on(status: TransactionStatus, callback: (transaction: Transaction) => void): void;
Defined in: packages/txm/lib/Transaction.ts:296
Parameters
status
callback
(transaction
: Transaction
) => void
Returns
void
removeAttempt()
removeAttempt(hash: `0x${string}`): void;
Defined in: packages/txm/lib/Transaction.ts:236
Parameters
hash
`0x${string}`
Returns
void
toDbRow()
toDbRow(): {
address: `0x${string}`;
attempts: string;
calldata: `0x${string}`;
chainId: number;
createdAt: number;
from: `0x${string}`;
intentId: UUID;
status: TransactionStatus;
updatedAt: number;
value: string;
} & {
args?: string;
collectionBlock?: number;
contractName?: string;
deadline?: number;
functionName?: string;
metadata?: string;
};
Defined in: packages/txm/lib/Transaction.ts:338
Returns
{
address
: `0x${string}`
;
attempts
: string
;
calldata
: `0x${string}`
;
chainId
: number
;
createdAt
: number
;
from
: `0x${string}`
;
intentId
: UUID
;
status
: TransactionStatus
;
updatedAt
: number
;
value
: string
;
} & {
args?
: string
;
collectionBlock?
: number
;
contractName?
: string
;
deadline?
: number
;
functionName?
: string
;
metadata?
: string
;
}
toJson()
toJson(): string;
Defined in: packages/txm/lib/Transaction.ts:377
Returns
string
waitForFinalization()
waitForFinalization(timeoutMs?: number): Promise<Result<Transaction, Error>>;
Defined in: packages/txm/lib/Transaction.ts:300
Parameters
timeoutMs?
number
Returns
Promise
<Result
<Transaction
, Error
>>
fromDbRow()
static fromDbRow(row: {
address: `0x${string}`;
args: undefined | string;
attempts: string;
calldata: `0x${string}`;
chainId: number;
collectionBlock: undefined | number;
contractName: undefined | string;
createdAt: number;
deadline: undefined | number;
from: `0x${string}`;
functionName: undefined | string;
intentId: UUID;
metadata: undefined | string;
status: TransactionStatus;
updatedAt: number;
value: string;
}, abiManager: ABIManager): Transaction;
Defined in: packages/txm/lib/Transaction.ts:359
Parameters
row
address
`0x${string}`
args
undefined
| string
attempts
string
calldata
`0x${string}`
chainId
number
collectionBlock
undefined
| number
contractName
undefined
| string
createdAt
number
deadline
undefined
| number
from
`0x${string}`
functionName
undefined
| string
intentId
UUID
metadata
undefined
| string
status
updatedAt
number
value
string
abiManager
ABIManager
Returns
Transaction
Properties
address
readonly address: `0x${string}`;
Defined in: packages/txm/lib/Transaction.ts:119
args?
readonly optional args: readonly unknown[];
Defined in: packages/txm/lib/Transaction.ts:123
attempts
readonly attempts: Attempt[];
Defined in: packages/txm/lib/Transaction.ts:136
calldata
readonly calldata: `0x${string}`;
Defined in: packages/txm/lib/Transaction.ts:128
chainId
readonly chainId: number;
Defined in: packages/txm/lib/Transaction.ts:117
collectionBlock
collectionBlock: undefined | bigint;
Defined in: packages/txm/lib/Transaction.ts:140
contractName?
readonly optional contractName: string;
Defined in: packages/txm/lib/Transaction.ts:126
createdAt
createdAt: Date;
Defined in: packages/txm/lib/Transaction.ts:150
deadline
readonly deadline: undefined | number;
Defined in: packages/txm/lib/Transaction.ts:132
from
readonly from: `0x${string}`;
Defined in: packages/txm/lib/Transaction.ts:115
functionName?
readonly optional functionName: string;
Defined in: packages/txm/lib/Transaction.ts:121
intentId
readonly intentId: UUID;
Defined in: packages/txm/lib/Transaction.ts:113
metadata
readonly metadata: Record<string, unknown>;
Defined in: packages/txm/lib/Transaction.ts:158
Stores additional information for the transaction. Enables originators to provide extra details, such as gas limits, which can be leveraged by customizable services.
notPersisted
notPersisted: boolean;
Defined in: packages/txm/lib/Transaction.ts:148
pendingFlush
pendingFlush: boolean;
Defined in: packages/txm/lib/Transaction.ts:144
status
status: TransactionStatus;
Defined in: packages/txm/lib/Transaction.ts:134
updatedAt
updatedAt: Date;
Defined in: packages/txm/lib/Transaction.ts:152
value
readonly value: bigint;
Defined in: packages/txm/lib/Transaction.ts:130