@solana/transaction-messages 2.1.1-canary-20250425210025 → 2.1.1-canary-20250428190618
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.
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs.map +1 -1
- package/dist/types/addresses-by-lookup-table-address.d.ts +4 -0
- package/dist/types/addresses-by-lookup-table-address.d.ts.map +1 -1
- package/dist/types/blockhash.d.ts +82 -0
- package/dist/types/blockhash.d.ts.map +1 -1
- package/dist/types/codecs/message.d.ts +20 -0
- package/dist/types/codecs/message.d.ts.map +1 -1
- package/dist/types/codecs/transaction-version.d.ts +19 -0
- package/dist/types/codecs/transaction-version.d.ts.map +1 -1
- package/dist/types/compilable-transaction-message.d.ts +5 -0
- package/dist/types/compilable-transaction-message.d.ts.map +1 -1
- package/dist/types/compile/address-table-lookups.d.ts +3 -0
- package/dist/types/compile/address-table-lookups.d.ts.map +1 -1
- package/dist/types/compile/header.d.ts +24 -0
- package/dist/types/compile/header.d.ts.map +1 -1
- package/dist/types/compile/instructions.d.ts +9 -0
- package/dist/types/compile/instructions.d.ts.map +1 -1
- package/dist/types/compile/message.d.ts +31 -0
- package/dist/types/compile/message.d.ts.map +1 -1
- package/dist/types/compress-transaction-message.d.ts +28 -0
- package/dist/types/compress-transaction-message.d.ts.map +1 -1
- package/dist/types/create-transaction-message.d.ts +11 -0
- package/dist/types/create-transaction-message.d.ts.map +1 -1
- package/dist/types/decompile-message.d.ts +23 -0
- package/dist/types/decompile-message.d.ts.map +1 -1
- package/dist/types/durable-nonce.d.ts +122 -0
- package/dist/types/durable-nonce.d.ts.map +1 -1
- package/dist/types/fee-payer.d.ts +18 -0
- package/dist/types/fee-payer.d.ts.map +1 -1
- package/dist/types/index.d.ts +29 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/instructions.d.ts +96 -0
- package/dist/types/instructions.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fee-payer.d.ts","sourceRoot":"","sources":["../../src/fee-payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,MAAM,WAAW,+BAA+B,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC7E,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED,wBAAgB,6BAA6B,CACzC,gBAAgB,SAAS,MAAM,EAC/B,mBAAmB,SAAS,sBAAsB,GAAG,OAAO,CAAC,+BAA+B,CAAC,EAE7F,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,kBAAkB,EAAE,mBAAmB,GACxC,+BAA+B,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAe3F"}
|
|
1
|
+
{"version":3,"file":"fee-payer.d.ts","sourceRoot":"","sources":["../../src/fee-payer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,+BAA+B,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC7E,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,6BAA6B,CACzC,gBAAgB,SAAS,MAAM,EAC/B,mBAAmB,SAAS,sBAAsB,GAAG,OAAO,CAAC,+BAA+B,CAAC,EAE7F,QAAQ,EAAE,OAAO,CAAC,gBAAgB,CAAC,EACnC,kBAAkB,EAAE,mBAAmB,GACxC,+BAA+B,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC,mBAAmB,EAAE,UAAU,CAAC,CAe3F"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This package contains types and functions for creating transaction messages.
|
|
3
|
+
* It can be used standalone, but it is also exported as part of Kit
|
|
4
|
+
* [`@solana/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* Transaction messages are built one step at a time using the transform functions offered by this
|
|
8
|
+
* package. To make it more ergonomic to apply consecutive transforms to your transaction messages,
|
|
9
|
+
* consider using a pipelining helper like the one in `@solana/functional`.
|
|
10
|
+
*
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { pipe } from '@solana/functional';
|
|
13
|
+
* import {
|
|
14
|
+
* appendTransactionMessageInstruction,
|
|
15
|
+
* createTransactionMessage,
|
|
16
|
+
* setTransactionMessageFeePayer,
|
|
17
|
+
* setTransactionMessageLifetimeUsingBlockhash,
|
|
18
|
+
* } from '@solana/transaction-messages';
|
|
19
|
+
*
|
|
20
|
+
* const transferTransactionMessage = pipe(
|
|
21
|
+
* createTransactionMessage({ version: 0 }),
|
|
22
|
+
* m => setTransactionMessageFeePayer(myAddress, m),
|
|
23
|
+
* m => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, m),
|
|
24
|
+
* m => appendTransactionMessageInstruction(getTransferSolInstruction({ source, destination, amount }), m),
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @packageDocumentation
|
|
29
|
+
*/
|
|
1
30
|
export * from './addresses-by-lookup-table-address';
|
|
2
31
|
export * from './blockhash';
|
|
3
32
|
export * from './codecs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,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,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,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,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,9 +1,105 @@
|
|
|
1
1
|
import { TransactionMessageWithDurableNonceLifetime } from './durable-nonce';
|
|
2
2
|
import { BaseTransactionMessage } from './transaction-message';
|
|
3
|
+
/**
|
|
4
|
+
* Given an instruction, this method will return a new transaction message with that instruction
|
|
5
|
+
* having been added to the end of the list of existing instructions.
|
|
6
|
+
*
|
|
7
|
+
* @see {@link appendTransactionInstructions} if you need to append multiple instructions to a
|
|
8
|
+
* transaction message.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { address } from '@solana/addresses';
|
|
13
|
+
* import { appendTransactionMessageInstruction } from '@solana/transaction-messages';
|
|
14
|
+
*
|
|
15
|
+
* const memoTransaction = appendTransactionMessageInstruction(
|
|
16
|
+
* {
|
|
17
|
+
* data: new TextEncoder().encode('Hello world!'),
|
|
18
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
19
|
+
* },
|
|
20
|
+
* tx,
|
|
21
|
+
* );
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
3
24
|
export declare function appendTransactionMessageInstruction<TTransactionMessage extends BaseTransactionMessage>(instruction: TTransactionMessage['instructions'][number], transactionMessage: TTransactionMessage): TTransactionMessage;
|
|
25
|
+
/**
|
|
26
|
+
* Given an array of instructions, this method will return a new transaction message with those
|
|
27
|
+
* instructions having been added to the end of the list of existing instructions.
|
|
28
|
+
*
|
|
29
|
+
* @see {@link appendTransactionInstruction} if you only need to append one instruction to a
|
|
30
|
+
* transaction message.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { address } from '@solana/addresses';
|
|
35
|
+
* import { appendTransactionMessageInstructions } from '@solana/transaction-messages';
|
|
36
|
+
*
|
|
37
|
+
* const memoTransaction = appendTransactionMessageInstructions(
|
|
38
|
+
* [
|
|
39
|
+
* {
|
|
40
|
+
* data: new TextEncoder().encode('Hello world!'),
|
|
41
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
42
|
+
* },
|
|
43
|
+
* {
|
|
44
|
+
* data: new TextEncoder().encode('How are you?'),
|
|
45
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
46
|
+
* },
|
|
47
|
+
* ],
|
|
48
|
+
* tx,
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
4
52
|
export declare function appendTransactionMessageInstructions<TTransactionMessage extends BaseTransactionMessage>(instructions: ReadonlyArray<TTransactionMessage['instructions'][number]>, transactionMessage: TTransactionMessage): TTransactionMessage;
|
|
5
53
|
type ExcludeDurableNonce<T> = T extends TransactionMessageWithDurableNonceLifetime ? BaseTransactionMessage & Omit<T, keyof TransactionMessageWithDurableNonceLifetime> : T;
|
|
54
|
+
/**
|
|
55
|
+
* Given an instruction, this method will return a new transaction message with that instruction
|
|
56
|
+
* having been added to the beginning of the list of existing instructions.
|
|
57
|
+
*
|
|
58
|
+
* @see {@link prependTransactionInstructions} if you need to prepend multiple instructions to a
|
|
59
|
+
* transaction message.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* import { address } from '@solana/addresses';
|
|
64
|
+
* import { prependTransactionMessageInstruction } from '@solana/transaction-messages';
|
|
65
|
+
*
|
|
66
|
+
* const memoTransaction = prependTransactionMessageInstruction(
|
|
67
|
+
* {
|
|
68
|
+
* data: new TextEncoder().encode('Hello world!'),
|
|
69
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
70
|
+
* },
|
|
71
|
+
* tx,
|
|
72
|
+
* );
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
6
75
|
export declare function prependTransactionMessageInstruction<TTransactionMessage extends BaseTransactionMessage>(instruction: TTransactionMessage['instructions'][number], transactionMessage: TTransactionMessage): ExcludeDurableNonce<TTransactionMessage>;
|
|
76
|
+
/**
|
|
77
|
+
* Given an array of instructions, this method will return a new transaction message with those
|
|
78
|
+
* instructions having been added to the beginning of the list of existing instructions.
|
|
79
|
+
*
|
|
80
|
+
* @see {@link prependTransactionInstruction} if you only need to prepend one instruction to a
|
|
81
|
+
* transaction message.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { address } from '@solana/addresses';
|
|
86
|
+
* import { prependTransactionMessageInstructions } from '@solana/transaction-messages';
|
|
87
|
+
*
|
|
88
|
+
* const memoTransaction = prependTransactionMessageInstructions(
|
|
89
|
+
* [
|
|
90
|
+
* {
|
|
91
|
+
* data: new TextEncoder().encode('Hello world!'),
|
|
92
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
93
|
+
* },
|
|
94
|
+
* {
|
|
95
|
+
* data: new TextEncoder().encode('How are you?'),
|
|
96
|
+
* programAddress: address('MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr'),
|
|
97
|
+
* },
|
|
98
|
+
* ],
|
|
99
|
+
* tx,
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
7
103
|
export declare function prependTransactionMessageInstructions<TTransactionMessage extends BaseTransactionMessage>(instructions: ReadonlyArray<TTransactionMessage['instructions'][number]>, transactionMessage: TTransactionMessage): ExcludeDurableNonce<TTransactionMessage>;
|
|
8
104
|
export {};
|
|
9
105
|
//# sourceMappingURL=instructions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructions.d.ts","sourceRoot":"","sources":["../../src/instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0CAA0C,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAE/D,wBAAgB,mCAAmC,CAAC,mBAAmB,SAAS,sBAAsB,EAClG,WAAW,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,EACxD,kBAAkB,EAAE,mBAAmB,GACxC,mBAAmB,CAErB;AAED,wBAAgB,oCAAoC,CAAC,mBAAmB,SAAS,sBAAsB,EACnG,YAAY,EAAE,aAAa,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,EACxE,kBAAkB,EAAE,mBAAmB,GACxC,mBAAmB,CAKrB;AAID,KAAK,mBAAmB,CAAC,CAAC,IAAI,CAAC,SAAS,0CAA0C,GAC5E,sBAAsB,GAAG,IAAI,CAAC,CAAC,EAAE,MAAM,0CAA0C,CAAC,G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,sBAAsB,EACnG,WAAW,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,EACxD,kBAAkB,EAAE,mBAAmB,GACxC,mBAAmB,CAAC,mBAAmB,CAAC,CAE1C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,qCAAqC,CAAC,mBAAmB,SAAS,sBAAsB,EACpG,YAAY,EAAE,aAAa,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC,EACxE,kBAAkB,EAAE,mBAAmB,GACxC,mBAAmB,CAAC,mBAAmB,CAAC,CAK1C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/transaction-messages",
|
|
3
|
-
"version": "2.1.1-canary-
|
|
3
|
+
"version": "2.1.1-canary-20250428190618",
|
|
4
4
|
"description": "Helpers for creating transaction messages",
|
|
5
5
|
"exports": {
|
|
6
6
|
"edge-light": {
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"maintained node versions"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@solana/
|
|
58
|
-
"@solana/codecs-
|
|
59
|
-
"@solana/codecs-
|
|
60
|
-
"@solana/
|
|
61
|
-
"@solana/codecs-
|
|
62
|
-
"@solana/functional": "2.1.1-canary-
|
|
63
|
-
"@solana/
|
|
64
|
-
"@solana/
|
|
57
|
+
"@solana/errors": "2.1.1-canary-20250428190618",
|
|
58
|
+
"@solana/codecs-core": "2.1.1-canary-20250428190618",
|
|
59
|
+
"@solana/codecs-data-structures": "2.1.1-canary-20250428190618",
|
|
60
|
+
"@solana/addresses": "2.1.1-canary-20250428190618",
|
|
61
|
+
"@solana/codecs-numbers": "2.1.1-canary-20250428190618",
|
|
62
|
+
"@solana/functional": "2.1.1-canary-20250428190618",
|
|
63
|
+
"@solana/rpc-types": "2.1.1-canary-20250428190618",
|
|
64
|
+
"@solana/instructions": "2.1.1-canary-20250428190618"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"typescript": ">=5.3.3"
|