@solana/instruction-plans 3.0.0-canary-20250808140800 → 3.0.0-canary-20250808141109
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/types/index.d.ts +48 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Instruction plans describe operations that go beyond a
|
|
3
|
+
* single instruction and may even span multiple transactions.
|
|
4
|
+
*
|
|
5
|
+
* They define a set of instructions that must be executed following a specific order.
|
|
6
|
+
* For instance, imagine we wanted to create an instruction plan for a simple escrow
|
|
7
|
+
* transfer between Alice and Bob. First, both would need to deposit their assets
|
|
8
|
+
* into a vault. This could happen in any order. Then and only then, the vault can be
|
|
9
|
+
* activated to switch the assets. Alice and Bob can now both withdraw each other’s assets
|
|
10
|
+
* (again, in any order). Here’s how we could describe an instruction plan for such an operation.
|
|
11
|
+
*
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const instructionPlan = sequentialInstructionPlan([
|
|
14
|
+
* parallelInstructionPlan([
|
|
15
|
+
* depositFromAlice,
|
|
16
|
+
* depositFromBob,
|
|
17
|
+
* ]),
|
|
18
|
+
* activateVault,
|
|
19
|
+
* parallelInstructionPlan([
|
|
20
|
+
* withdrawToAlice,
|
|
21
|
+
* withdrawToBob,
|
|
22
|
+
* ]),
|
|
23
|
+
* ]);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* As you can see, instruction plans don’t concern themselves with:
|
|
27
|
+
* - Adding structural instructions — e.g. compute budget limits and prices.
|
|
28
|
+
* - Building transaction messages from these instructions.
|
|
29
|
+
* That is planning how many can fit into a single instruction, adding a fee payer, a lifetime, etc.
|
|
30
|
+
* - Compiling, signing and sending transactions to the network.
|
|
31
|
+
*
|
|
32
|
+
* Instead, they solely focus on describing operations and delegate
|
|
33
|
+
* all that to two components introduced in this package:
|
|
34
|
+
* - **Transaction planner**: builds transaction messages from an
|
|
35
|
+
* instruction plan and returns an appropriate transaction plan.
|
|
36
|
+
* - **Transaction plan executor**: compiles, signs and sends
|
|
37
|
+
* transaction plans and returns a detailed result of this operation.
|
|
38
|
+
*
|
|
39
|
+
* ```typescript
|
|
40
|
+
* // Plan instructions into transactions.
|
|
41
|
+
* const transactionPlan = await transactionPlanner(instructionPlan);
|
|
42
|
+
*
|
|
43
|
+
* // Execute transactions.
|
|
44
|
+
* const transactionPlanResult = await transactionPlanExecutor(transactionPlan);
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* This separation of concerns not only improves the developer experience but also
|
|
48
|
+
* allows program maintainers to offer helper functions that go beyond a single instruction,
|
|
49
|
+
* while leaving their consumers to decide how they want these operations to materialise.
|
|
3
50
|
*
|
|
4
51
|
* @packageDocumentation
|
|
5
52
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/instruction-plans",
|
|
3
|
-
"version": "3.0.0-canary-
|
|
3
|
+
"version": "3.0.0-canary-20250808141109",
|
|
4
4
|
"description": "Construct, plan and execute transactions from multiple instructions.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"edge-light": {
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"maintained node versions"
|
|
55
55
|
],
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@solana/errors": "3.0.0-canary-
|
|
58
|
-
"@solana/instructions": "3.0.0-canary-
|
|
59
|
-
"@solana/
|
|
60
|
-
"@solana/
|
|
61
|
-
"@solana/transaction-messages": "3.0.0-canary-
|
|
57
|
+
"@solana/errors": "3.0.0-canary-20250808141109",
|
|
58
|
+
"@solana/instructions": "3.0.0-canary-20250808141109",
|
|
59
|
+
"@solana/promises": "3.0.0-canary-20250808141109",
|
|
60
|
+
"@solana/transactions": "3.0.0-canary-20250808141109",
|
|
61
|
+
"@solana/transaction-messages": "3.0.0-canary-20250808141109"
|
|
62
62
|
},
|
|
63
63
|
"peerDependencies": {
|
|
64
64
|
"typescript": ">=5.3.3"
|