@solana/instructions 8.3.0-canary-20260909094827 → 8.3.0
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/README.md +4 -0
- package/dist/types/accounts.d.ts +27 -3
- package/dist/types/accounts.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/accounts.ts +32 -3
package/README.md
CHANGED
|
@@ -45,6 +45,10 @@ For example, you could type the rent sysvar account like this:
|
|
|
45
45
|
type RentSysvar = ReadonlyAccount<'SysvarRent111111111111111111111111111111111'>;
|
|
46
46
|
```
|
|
47
47
|
|
|
48
|
+
### `AccountNonSignerMeta<TAddress>`
|
|
49
|
+
|
|
50
|
+
This type represents an `AccountMeta` whose role is guaranteed not to be a signer role — i.e. `ReadonlyAccount<TAddress> | WritableAccount<TAddress>`. It is the counterpart of the `AccountSignerMeta` type from `@solana/signers`, which narrows the role to the two signer roles. Use this type when an account meta must only describe the mutability of an account — e.g. when overriding the writable flag of a non-signer account in a generated program client.
|
|
51
|
+
|
|
48
52
|
### `AccountLookupMeta<TAddress, TLookupTableAddress>`
|
|
49
53
|
|
|
50
54
|
This type represents a lookup of the account's address in an address lookup table. It specifies which lookup table account in which to perform the lookup, the index of the desired account address in that table, and metadata about its mutability. Notably, account addresses obtained via lookups may not act as signers.
|
package/dist/types/accounts.d.ts
CHANGED
|
@@ -32,20 +32,44 @@ export type ReadonlyAccount<TAddress extends string = string> = AccountMeta<TAdd
|
|
|
32
32
|
* @see {@link AccountMeta}
|
|
33
33
|
*/
|
|
34
34
|
export type WritableAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
35
|
-
role: AccountRole.WRITABLE;
|
|
35
|
+
readonly role: AccountRole.WRITABLE;
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
38
38
|
* @see {@link AccountMeta}
|
|
39
39
|
*/
|
|
40
40
|
export type ReadonlySignerAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
41
|
-
role: AccountRole.READONLY_SIGNER;
|
|
41
|
+
readonly role: AccountRole.READONLY_SIGNER;
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* @see {@link AccountMeta}
|
|
45
45
|
*/
|
|
46
46
|
export type WritableSignerAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
47
|
-
role: AccountRole.WRITABLE_SIGNER;
|
|
47
|
+
readonly role: AccountRole.WRITABLE_SIGNER;
|
|
48
48
|
};
|
|
49
|
+
/**
|
|
50
|
+
* Represents an {@link AccountMeta} whose role is guaranteed not to be a signer role.
|
|
51
|
+
*
|
|
52
|
+
* This is the counterpart of the `AccountSignerMeta` type from `@solana/signers`, which
|
|
53
|
+
* narrows the role to the two signer roles. Use this type when an account meta must only
|
|
54
|
+
* describe the mutability of an account — e.g. when overriding the writable flag of a
|
|
55
|
+
* non-signer account in a generated program client.
|
|
56
|
+
*
|
|
57
|
+
* @typeParam TAddress - Supply a string literal to define an account having a particular address.
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { address } from '@solana/addresses';
|
|
62
|
+
* import { AccountNonSignerMeta, AccountRole } from '@solana/instructions';
|
|
63
|
+
*
|
|
64
|
+
* const meta: AccountNonSignerMeta = {
|
|
65
|
+
* address: address('mpngsFd4tmbUfzDYJayjKZwZcaR7aWb2793J6grLsGu'),
|
|
66
|
+
* role: AccountRole.READONLY,
|
|
67
|
+
* };
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @see {@link AccountMeta}
|
|
71
|
+
*/
|
|
72
|
+
export type AccountNonSignerMeta<TAddress extends string = string> = ReadonlyAccount<TAddress> | WritableAccount<TAddress>;
|
|
49
73
|
/**
|
|
50
74
|
* Represents a lookup of the account's address in an address lookup table. It specifies which
|
|
51
75
|
* lookup table account in which to perform the lookup, the index of the desired account address in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/accounts.ts"],"names":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,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;CAAE,CAAC;AAC/F;;GAEG;AACH,MAAM,MAAM,qBAAqB,CAC7B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,mBAAmB,SAAS,MAAM,GAAG,MAAM,IAC3C,iBAAiB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;CAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/instructions",
|
|
3
|
-
"version": "8.3.0
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"description": "Helpers for creating transaction instructions",
|
|
5
5
|
"homepage": "https://www.solanakit.com/api#solanainstructions",
|
|
6
6
|
"exports": {
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
"maintained node versions"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@solana/codecs-core": "8.3.0
|
|
60
|
-
"@solana/errors": "8.3.0
|
|
59
|
+
"@solana/codecs-core": "8.3.0",
|
|
60
|
+
"@solana/errors": "8.3.0"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
63
|
"typescript": ">=5.4.0"
|
package/src/accounts.ts
CHANGED
|
@@ -34,20 +34,49 @@ export type ReadonlyAccount<TAddress extends string = string> = AccountMeta<TAdd
|
|
|
34
34
|
/**
|
|
35
35
|
* @see {@link AccountMeta}
|
|
36
36
|
*/
|
|
37
|
-
export type WritableAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
37
|
+
export type WritableAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
38
|
+
readonly role: AccountRole.WRITABLE;
|
|
39
|
+
};
|
|
38
40
|
/**
|
|
39
41
|
* @see {@link AccountMeta}
|
|
40
42
|
*/
|
|
41
43
|
export type ReadonlySignerAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
42
|
-
role: AccountRole.READONLY_SIGNER;
|
|
44
|
+
readonly role: AccountRole.READONLY_SIGNER;
|
|
43
45
|
};
|
|
44
46
|
/**
|
|
45
47
|
* @see {@link AccountMeta}
|
|
46
48
|
*/
|
|
47
49
|
export type WritableSignerAccount<TAddress extends string = string> = AccountMeta<TAddress> & {
|
|
48
|
-
role: AccountRole.WRITABLE_SIGNER;
|
|
50
|
+
readonly role: AccountRole.WRITABLE_SIGNER;
|
|
49
51
|
};
|
|
50
52
|
|
|
53
|
+
/**
|
|
54
|
+
* Represents an {@link AccountMeta} whose role is guaranteed not to be a signer role.
|
|
55
|
+
*
|
|
56
|
+
* This is the counterpart of the `AccountSignerMeta` type from `@solana/signers`, which
|
|
57
|
+
* narrows the role to the two signer roles. Use this type when an account meta must only
|
|
58
|
+
* describe the mutability of an account — e.g. when overriding the writable flag of a
|
|
59
|
+
* non-signer account in a generated program client.
|
|
60
|
+
*
|
|
61
|
+
* @typeParam TAddress - Supply a string literal to define an account having a particular address.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* ```ts
|
|
65
|
+
* import { address } from '@solana/addresses';
|
|
66
|
+
* import { AccountNonSignerMeta, AccountRole } from '@solana/instructions';
|
|
67
|
+
*
|
|
68
|
+
* const meta: AccountNonSignerMeta = {
|
|
69
|
+
* address: address('mpngsFd4tmbUfzDYJayjKZwZcaR7aWb2793J6grLsGu'),
|
|
70
|
+
* role: AccountRole.READONLY,
|
|
71
|
+
* };
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @see {@link AccountMeta}
|
|
75
|
+
*/
|
|
76
|
+
export type AccountNonSignerMeta<TAddress extends string = string> =
|
|
77
|
+
| ReadonlyAccount<TAddress>
|
|
78
|
+
| WritableAccount<TAddress>;
|
|
79
|
+
|
|
51
80
|
/**
|
|
52
81
|
* Represents a lookup of the account's address in an address lookup table. It specifies which
|
|
53
82
|
* lookup table account in which to perform the lookup, the index of the desired account address in
|