@solana/transaction-messages 2.3.0 → 2.4.0-canary-20250709085912

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.
@@ -1,5 +1,5 @@
1
1
  import { VariableSizeCodec, VariableSizeDecoder, VariableSizeEncoder } from '@solana/codecs-core';
2
- import { CompiledTransactionMessage } from '../compile/message';
2
+ import { CompiledTransactionMessage, CompiledTransactionMessageWithLifetime } from '../compile/message';
3
3
  /**
4
4
  * Returns an encoder that you can use to encode a {@link CompiledTransactionMessage} to a byte
5
5
  * array.
@@ -7,7 +7,7 @@ import { CompiledTransactionMessage } from '../compile/message';
7
7
  * The wire format of a Solana transaction consists of signatures followed by a compiled transaction
8
8
  * message. The byte array produced by this encoder is the message part.
9
9
  */
10
- export declare function getCompiledTransactionMessageEncoder(): VariableSizeEncoder<CompiledTransactionMessage>;
10
+ export declare function getCompiledTransactionMessageEncoder(): VariableSizeEncoder<CompiledTransactionMessage | (CompiledTransactionMessage & CompiledTransactionMessageWithLifetime)>;
11
11
  /**
12
12
  * Returns a decoder that you can use to decode a byte array representing a
13
13
  * {@link CompiledTransactionMessage}.
@@ -15,12 +15,12 @@ export declare function getCompiledTransactionMessageEncoder(): VariableSizeEnco
15
15
  * The wire format of a Solana transaction consists of signatures followed by a compiled transaction
16
16
  * message. You can use this decoder to decode the message part.
17
17
  */
18
- export declare function getCompiledTransactionMessageDecoder(): VariableSizeDecoder<CompiledTransactionMessage>;
18
+ export declare function getCompiledTransactionMessageDecoder(): VariableSizeDecoder<CompiledTransactionMessage & CompiledTransactionMessageWithLifetime>;
19
19
  /**
20
20
  * Returns a codec that you can use to encode from or decode to {@link CompiledTransactionMessage}
21
21
  *
22
22
  * @see {@link getCompiledTransactionMessageDecoder}
23
23
  * @see {@link getCompiledTransactionMessageEncoder}
24
24
  */
25
- export declare function getCompiledTransactionMessageCodec(): VariableSizeCodec<CompiledTransactionMessage>;
25
+ export declare function getCompiledTransactionMessageCodec(): VariableSizeCodec<CompiledTransactionMessage | (CompiledTransactionMessage & CompiledTransactionMessageWithLifetime), CompiledTransactionMessage & CompiledTransactionMessageWithLifetime>;
26
26
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/codecs/message.ts"],"names":[],"mappings":"AACA,OAAO,EAQH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAM7B,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAyDhE;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,mBAAmB,CAAC,0BAA0B,CAAC,CAiBtG;AAED;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,mBAAmB,CAAC,0BAA0B,CAAC,CAetG;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,IAAI,iBAAiB,CAAC,0BAA0B,CAAC,CAElG"}
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/codecs/message.ts"],"names":[],"mappings":"AACA,OAAO,EAQH,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACtB,MAAM,qBAAqB,CAAC;AAa7B,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,oBAAoB,CAAC;AA2ExG;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,mBAAmB,CACvE,0BAA0B,GAAG,CAAC,0BAA0B,GAAG,sCAAsC,CAAC,CACrG,CAiBA;AAED;;;;;;GAMG;AACH,wBAAgB,oCAAoC,IAAI,mBAAmB,CACvE,0BAA0B,GAAG,sCAAsC,CACtE,CAeA;AAED;;;;;GAKG;AACH,wBAAgB,kCAAkC,IAAI,iBAAiB,CACnE,0BAA0B,GAAG,CAAC,0BAA0B,GAAG,sCAAsC,CAAC,EAClG,0BAA0B,GAAG,sCAAsC,CACtE,CAEA"}
@@ -1,4 +1,6 @@
1
- import { CompilableTransactionMessage } from '../compilable-transaction-message';
1
+ import { TransactionMessageWithFeePayer } from '../fee-payer';
2
+ import { TransactionMessageWithLifetime } from '../lifetime';
3
+ import { BaseTransactionMessage } from '../transaction-message';
2
4
  import { getCompiledAddressTableLookups } from './address-table-lookups';
3
5
  import { getCompiledMessageHeader } from './header';
4
6
  import { getCompiledInstructions } from './instructions';
@@ -11,14 +13,6 @@ type BaseCompiledTransactionMessage = Readonly<{
11
13
  */
12
14
  header: ReturnType<typeof getCompiledMessageHeader>;
13
15
  instructions: ReturnType<typeof getCompiledInstructions>;
14
- /**
15
- * 32 bytes of data observed by the transaction proposed that makes a transaction eligible to
16
- * land on the network.
17
- *
18
- * In the case of a transaction message with a nonce lifetime constraint, this will be the value
19
- * of the nonce itself. In all other cases this will be a recent blockhash.
20
- */
21
- lifetimeToken: ReturnType<typeof getCompiledLifetimeToken>;
22
16
  /** A list of addresses indicating which accounts to load */
23
17
  staticAccounts: ReturnType<typeof getCompiledStaticAccounts>;
24
18
  }>;
@@ -30,6 +24,16 @@ type BaseCompiledTransactionMessage = Readonly<{
30
24
  * accounts sourced from account lookup tables are lost to compilation.
31
25
  */
32
26
  export type CompiledTransactionMessage = LegacyCompiledTransactionMessage | VersionedCompiledTransactionMessage;
27
+ export type CompiledTransactionMessageWithLifetime = Readonly<{
28
+ /**
29
+ * 32 bytes of data observed by the transaction proposed that makes a transaction eligible to
30
+ * land on the network.
31
+ *
32
+ * In the case of a transaction message with a nonce lifetime constraint, this will be the value
33
+ * of the nonce itself. In all other cases this will be a recent blockhash.
34
+ */
35
+ lifetimeToken: ReturnType<typeof getCompiledLifetimeToken>;
36
+ }>;
33
37
  type LegacyCompiledTransactionMessage = BaseCompiledTransactionMessage & Readonly<{
34
38
  version: 'legacy';
35
39
  }>;
@@ -49,9 +53,11 @@ type VersionedCompiledTransactionMessage = BaseCompiledTransactionMessage & Read
49
53
  *
50
54
  * @see {@link decompileTransactionMessage}
51
55
  */
52
- export declare function compileTransactionMessage(transactionMessage: CompilableTransactionMessage & Readonly<{
56
+ export declare function compileTransactionMessage<TTransactionMessage extends BaseTransactionMessage & TransactionMessageWithFeePayer>(transactionMessage: TTransactionMessage): CompiledTransactionMessageFromTransactionMessage<TTransactionMessage>;
57
+ type CompiledTransactionMessageFromTransactionMessage<TTransactionMessage extends BaseTransactionMessage> = ForwardTransactionMessageLifetime<ForwardTransactionMessageVersion<TTransactionMessage>, TTransactionMessage>;
58
+ type ForwardTransactionMessageVersion<TTransactionMessage extends BaseTransactionMessage> = TTransactionMessage extends Readonly<{
53
59
  version: 'legacy';
54
- }>): LegacyCompiledTransactionMessage;
55
- export declare function compileTransactionMessage(transactionMessage: CompilableTransactionMessage): VersionedCompiledTransactionMessage;
60
+ }> ? LegacyCompiledTransactionMessage : VersionedCompiledTransactionMessage;
61
+ type ForwardTransactionMessageLifetime<TCompiledTransactionMessage extends CompiledTransactionMessage, TTransactionMessage extends BaseTransactionMessage> = TTransactionMessage extends TransactionMessageWithLifetime ? CompiledTransactionMessageWithLifetime & TCompiledTransactionMessage : TCompiledTransactionMessage;
56
62
  export {};
57
63
  //# sourceMappingURL=message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/compile/message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AAEjF,OAAO,EAAE,8BAA8B,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAC;AAE9D,KAAK,8BAA8B,GAAG,QAAQ,CAAC;IAC3C;;;OAGG;IACH,MAAM,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC;IACpD,YAAY,EAAE,UAAU,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gC,GAChC,mCAAmC,CAAC;AAE9C,KAAK,iCAAiC,CAClC,2BAA2B,SAAS,0BAA0B,EAC9D,mBAAmB,SAAS,sBAAsB,IAClD,mBAAmB,SAAS,8BAA8B,GACxD,sCAAsC,GAAG,2BAA2B,GACpE,2BAA2B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { AddressesByLookupTableAddress } from './addresses-by-lookup-table-address';
2
- import { CompilableTransactionMessage } from './compilable-transaction-message';
3
- import { CompiledTransactionMessage } from './compile';
2
+ import { CompiledTransactionMessage, CompiledTransactionMessageWithLifetime } from './compile';
3
+ import { TransactionMessageWithFeePayer } from './fee-payer';
4
+ import { TransactionMessageWithLifetime } from './lifetime';
5
+ import { BaseTransactionMessage } from './transaction-message';
4
6
  export type DecompileTransactionMessageConfig = {
5
7
  /**
6
8
  * If the compiled message loads addresses from one or more address lookup tables, you will have
@@ -28,5 +30,5 @@ export type DecompileTransactionMessageConfig = {
28
30
  *
29
31
  * @see {@link compileTransactionMessage}
30
32
  */
31
- export declare function decompileTransactionMessage(compiledTransactionMessage: CompiledTransactionMessage, config?: DecompileTransactionMessageConfig): CompilableTransactionMessage;
33
+ export declare function decompileTransactionMessage(compiledTransactionMessage: CompiledTransactionMessage & CompiledTransactionMessageWithLifetime, config?: DecompileTransactionMessageConfig): BaseTransactionMessage & TransactionMessageWithFeePayer & TransactionMessageWithLifetime;
32
34
  //# sourceMappingURL=decompile-message.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"decompile-message.d.ts","sourceRoot":"","sources":["../../src/decompile-message.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AA4KvD,MAAM,MAAM,iCAAiC,GAAG;IAC5C;;;;;;OAMG;IACH,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;IAC9D;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACvC,0BAA0B,EAAE,0BAA0B,EACtD,MAAM,CAAC,EAAE,iCAAiC,GAC3C,4BAA4B,CA0C9B"}
1
+ {"version":3,"file":"decompile-message.d.ts","sourceRoot":"","sources":["../../src/decompile-message.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,sCAAsC,EAAE,MAAM,WAAW,CAAC;AAK/F,OAAO,EAAiC,8BAA8B,EAAE,MAAM,aAAa,CAAC;AAE5F,OAAO,EAAE,8BAA8B,EAAE,MAAM,YAAY,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAsB,MAAM,uBAAuB,CAAC;AAqKnF,MAAM,MAAM,iCAAiC,GAAG;IAC5C;;;;;;OAMG;IACH,6BAA6B,CAAC,EAAE,6BAA6B,CAAC;IAC9D;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,wBAAgB,2BAA2B,CACvC,0BAA0B,EAAE,0BAA0B,GAAG,sCAAsC,EAC/F,MAAM,CAAC,EAAE,iCAAiC,GAC3C,sBAAsB,GAAG,8BAA8B,GAAG,8BAA8B,CA0C1F"}
@@ -39,6 +39,7 @@ export * from './durable-nonce';
39
39
  export { isAdvanceNonceAccountInstruction } from './durable-nonce-instruction';
40
40
  export * from './fee-payer';
41
41
  export * from './instructions';
42
+ export * from './lifetime';
42
43
  export * from './transaction-message-size';
43
44
  export * from './transaction-message';
44
45
  export * from './deprecated';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AAGtC,cAAc,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,kCAAkC,CAAC;AACjD,cAAc,WAAW,CAAC;AAC1B,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AAC/E,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AAGtC,cAAc,cAAc,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/transaction-messages",
3
- "version": "2.3.0",
3
+ "version": "2.4.0-canary-20250709085912",
4
4
  "description": "Helpers for creating transaction messages",
5
5
  "exports": {
6
6
  "edge-light": {
@@ -54,15 +54,15 @@
54
54
  "maintained node versions"
55
55
  ],
56
56
  "dependencies": {
57
- "@solana/addresses": "2.3.0",
58
- "@solana/codecs-data-structures": "2.3.0",
59
- "@solana/codecs-numbers": "2.3.0",
60
- "@solana/codecs-core": "2.3.0",
61
- "@solana/errors": "2.3.0",
62
- "@solana/functional": "2.3.0",
63
- "@solana/instructions": "2.3.0",
64
- "@solana/rpc-types": "2.3.0",
65
- "@solana/nominal-types": "2.3.0"
57
+ "@solana/addresses": "2.4.0-canary-20250709085912",
58
+ "@solana/codecs-core": "2.4.0-canary-20250709085912",
59
+ "@solana/codecs-data-structures": "2.4.0-canary-20250709085912",
60
+ "@solana/codecs-numbers": "2.4.0-canary-20250709085912",
61
+ "@solana/errors": "2.4.0-canary-20250709085912",
62
+ "@solana/functional": "2.4.0-canary-20250709085912",
63
+ "@solana/nominal-types": "2.4.0-canary-20250709085912",
64
+ "@solana/instructions": "2.4.0-canary-20250709085912",
65
+ "@solana/rpc-types": "2.4.0-canary-20250709085912"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "typescript": ">=5.3.3"