File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @solana/compat ' : patch
3
+ ---
4
+
5
+ updated readme to include instruction compat functions
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ import { fromLegacyKeypair } from '@solana/compat';
33
33
const { privateKey, publicKey } = await fromLegacyKeypair (Keypair .generate ());
34
34
```
35
35
36
- ### ` fromVersionedTransaction `
36
+ ### ` fromVersionedTransaction() `
37
37
38
38
This can be used to convert a legacy ` VersionedTransaction ` object to a ` Transaction ` object.
39
39
@@ -44,3 +44,15 @@ import { fromVersionedTransaction } from '@solana/compat';
44
44
const legacyVersionedTransaction = getMyLegacyVersionedTransaction ();
45
45
const transaction = fromVersionedTransaction (legacyVersionedTransaction );
46
46
```
47
+
48
+ ### ` fromLegacyTransactionInstruction() `
49
+
50
+ This can be used to convert a legacy ` TransactionInstruction ` object to a ` IInstruction ` object.
51
+
52
+ ``` ts
53
+ import { fromLegacyTransactionInstruction } from ' @solana/compat' ;
54
+
55
+ // imagine a function that returns a legacy `TransactionInstruction`
56
+ const legacyInstruction = getMyLegacyInstruction ();
57
+ const instruction = fromLegacyTransactionInstruction (legacyInstruction );
58
+ ```
You can’t perform that action at this time.
0 commit comments