Skip to content

Commit 720a428

Browse files
authored
chore: Add costUnits to transaction classes (#3748)
* chore: add costUnits to transaction classes * chore: linting
1 parent 6f265af commit 720a428

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/connection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,6 +1093,8 @@ export type ParsedTransactionMeta = {
10931093
loadedAddresses?: LoadedAddresses;
10941094
/** The compute units consumed after processing the transaction */
10951095
computeUnitsConsumed?: number;
1096+
/** The cost units consumed after processing the transaction */
1097+
costUnits?: number;
10961098
};
10971099

10981100
export type CompiledInnerInstruction = {
@@ -1124,6 +1126,8 @@ export type ConfirmedTransactionMeta = {
11241126
loadedAddresses?: LoadedAddresses;
11251127
/** The compute units consumed after processing the transaction */
11261128
computeUnitsConsumed?: number;
1129+
/** The cost units consumed after processing the transaction */
1130+
costUnits?: number;
11271131
};
11281132

11291133
/**
@@ -2369,6 +2373,7 @@ const ConfirmedTransactionMetaResult = pick({
23692373
postTokenBalances: optional(nullable(array(TokenBalanceResult))),
23702374
loadedAddresses: optional(LoadedAddressesResult),
23712375
computeUnitsConsumed: optional(number()),
2376+
costUnits: optional(number()),
23722377
});
23732378

23742379
/**
@@ -2394,6 +2399,7 @@ const ParsedConfirmedTransactionMetaResult = pick({
23942399
postTokenBalances: optional(nullable(array(TokenBalanceResult))),
23952400
loadedAddresses: optional(LoadedAddressesResult),
23962401
computeUnitsConsumed: optional(number()),
2402+
costUnits: optional(number()),
23972403
});
23982404

23992405
const TransactionVersionStruct = union([literal(0), literal('legacy')]);

0 commit comments

Comments
 (0)