Skip to content

Commit 9029dc1

Browse files
update compat readme to include instructions (#57)
* docs: readme * Update packages/compat/README.md Co-authored-by: Callum McIntyre <mcintyre1994@gmail.com> --------- Co-authored-by: Callum McIntyre <mcintyre1994@gmail.com>
1 parent 1e47a5e commit 9029dc1

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

.changeset/rotten-dryers-fix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@solana/compat': patch
3+
---
4+
5+
updated readme to include instruction compat functions

packages/compat/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { fromLegacyKeypair } from '@solana/compat';
3333
const { privateKey, publicKey } = await fromLegacyKeypair(Keypair.generate());
3434
```
3535

36-
### `fromVersionedTransaction`
36+
### `fromVersionedTransaction()`
3737

3838
This can be used to convert a legacy `VersionedTransaction` object to a `Transaction` object.
3939

@@ -44,3 +44,15 @@ import { fromVersionedTransaction } from '@solana/compat';
4444
const legacyVersionedTransaction = getMyLegacyVersionedTransaction();
4545
const transaction = fromVersionedTransaction(legacyVersionedTransaction);
4646
```
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+
```

0 commit comments

Comments
 (0)