@solana/instructions 2.0.0-experimental.bfaffe0 → 2.0.0-experimental.c098656

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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2018 Solana Labs, Inc
1
+ Copyright (c) 2023 Solana Labs, Inc
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
@@ -1,7 +1,7 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { AccountRole } from './roles';
1
+ import { Address } from '@solana/addresses';
2
+ import { AccountRole } from './roles.js';
3
3
  export interface IAccountMeta<TAddress extends string = string> {
4
- readonly address: Base58EncodedAddress<TAddress>;
4
+ readonly address: Address<TAddress>;
5
5
  readonly role: AccountRole;
6
6
  }
7
7
  export type ReadonlyAccount<TAddress extends string = string> = IAccountMeta<TAddress> & {
@@ -17,9 +17,9 @@ export type WritableSignerAccount<TAddress extends string = string> = IAccountMe
17
17
  role: AccountRole.WRITABLE_SIGNER;
18
18
  };
19
19
  export interface IAccountLookupMeta<TAddress extends string = string, TLookupTableAddress extends string = string> {
20
- readonly address: Base58EncodedAddress<TAddress>;
20
+ readonly address: Address<TAddress>;
21
21
  readonly addressIndex: number;
22
- readonly lookupTableAddress: Base58EncodedAddress<TLookupTableAddress>;
22
+ readonly lookupTableAddress: Address<TLookupTableAddress>;
23
23
  readonly role: AccountRole.READONLY | AccountRole.WRITABLE;
24
24
  }
25
25
  export type ReadonlyAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & {
@@ -1 +1 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAA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,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG;IAC3F,IAAI,EAAE,WAAW,CAAC,eAAe,CAAC;CACrC,CAAC;AAEF,MAAM,WAAW,kBAAkB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAAE,mBAAmB,SAAS,MAAM,GAAG,MAAM;IAC7G,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAC1D,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;CAC9D;AAED,MAAM,MAAM,qBAAqB,CAC7B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,mBAAmB,SAAS,MAAM,GAAG,MAAM,IAC3C,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;CAAE,CAAC;AAChG,MAAM,MAAM,qBAAqB,CAC7B,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChC,mBAAmB,SAAS,MAAM,GAAG,MAAM,IAC3C,kBAAkB,CAAC,QAAQ,EAAE,mBAAmB,CAAC,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;CAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- export * from './accounts';
2
- export * from './instruction';
3
- export * from './roles';
1
+ export * from './accounts.js';
2
+ export * from './instruction.js';
3
+ export * from './roles.js';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
- import { Base58EncodedAddress } from '@solana/addresses';
2
- import { IAccountLookupMeta, IAccountMeta } from './accounts';
3
- export interface IInstruction<TProgramAddress extends string = string> {
4
- readonly accounts?: readonly (IAccountMeta | IAccountLookupMeta)[];
1
+ import { Address } from '@solana/addresses';
2
+ import { IAccountLookupMeta, IAccountMeta } from './accounts.js';
3
+ export interface IInstruction<TProgramAddress extends string = string, TAccounts extends readonly (IAccountMeta | IAccountLookupMeta)[] = readonly (IAccountMeta | IAccountLookupMeta)[]> {
4
+ readonly accounts?: TAccounts;
5
5
  readonly data?: Uint8Array;
6
- readonly programAddress: Base58EncodedAddress<TProgramAddress>;
6
+ readonly programAddress: Address<TProgramAddress>;
7
7
  }
8
8
  export interface IInstructionWithAccounts<TAccounts extends readonly (IAccountMeta | IAccountLookupMeta)[]> extends IInstruction {
9
9
  readonly accounts: TAccounts;
@@ -1 +1 @@
1
- {"version":3,"file":"instruction.d.ts","sourceRoot":"","sources":["../../src/instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,YAAY,CAAC,eAAe,SAAS,MAAM,GAAG,MAAM;IACjE,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE,CAAC;IACnE,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,oBAAoB,CAAC,eAAe,CAAC,CAAC;CAClE;AAED,MAAM,WAAW,wBAAwB,CAAC,SAAS,SAAS,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE,CACtG,SAAQ,YAAY;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,UAAU,CAAE,SAAQ,YAAY;IAChF,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACxB"}
1
+ {"version":3,"file":"instruction.d.ts","sourceRoot":"","sources":["../../src/instruction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE9D,MAAM,WAAW,YAAY,CACzB,eAAe,SAAS,MAAM,GAAG,MAAM,EACvC,SAAS,SAAS,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE,GAAG,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE;IAEjH,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;CACrD;AAED,MAAM,WAAW,wBAAwB,CAAC,SAAS,SAAS,SAAS,CAAC,YAAY,GAAG,kBAAkB,CAAC,EAAE,CACtG,SAAQ,YAAY;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB,CAAC,KAAK,SAAS,UAAU,CAAE,SAAQ,YAAY;IAChF,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACxB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/instructions",
3
- "version": "2.0.0-experimental.bfaffe0",
3
+ "version": "2.0.0-experimental.c098656",
4
4
  "description": "Helpers for creating transaction instructions",
5
5
  "exports": {
6
6
  "browser": {
@@ -45,27 +45,6 @@
45
45
  "supports bigint and not dead",
46
46
  "maintained node versions"
47
47
  ],
48
- "devDependencies": {
49
- "@solana/eslint-config-solana": "^1.0.2",
50
- "@swc/jest": "^0.2.28",
51
- "@types/jest": "^29.5.5",
52
- "@typescript-eslint/eslint-plugin": "^6.7.0",
53
- "@typescript-eslint/parser": "^6.3.0",
54
- "agadoo": "^3.0.0",
55
- "eslint": "^8.45.0",
56
- "eslint-plugin-sort-keys-fix": "^1.1.2",
57
- "jest": "^29.7.0",
58
- "jest-runner-eslint": "^2.1.0",
59
- "jest-runner-prettier": "^1.0.0",
60
- "prettier": "^2.8",
61
- "tsup": "7.2.0",
62
- "typescript": "^5.2.2",
63
- "version-from-git": "^1.1.1",
64
- "@solana/addresses": "2.0.0-experimental.bfaffe0",
65
- "build-scripts": "0.0.0",
66
- "test-config": "0.0.0",
67
- "tsconfig": "0.0.0"
68
- },
69
48
  "bundlewatch": {
70
49
  "defaultCompression": "gzip",
71
50
  "files": [
@@ -75,18 +54,18 @@
75
54
  ]
76
55
  },
77
56
  "scripts": {
78
- "compile:js": "tsup --config build-scripts/tsup.config.library.ts",
79
- "compile:typedefs": "tsc -p ./tsconfig.declarations.json",
80
- "dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
81
- "publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
82
- "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/*",
83
- "test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
84
- "test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
57
+ "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
58
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
59
+ "dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
60
+ "publish-packages": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
61
+ "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
62
+ "test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
63
+ "test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
85
64
  "test:treeshakability:browser": "agadoo dist/index.browser.js",
86
65
  "test:treeshakability:native": "agadoo dist/index.native.js",
87
66
  "test:treeshakability:node": "agadoo dist/index.node.js",
88
67
  "test:typecheck": "tsc --noEmit",
89
- "test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
90
- "test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
68
+ "test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
69
+ "test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
91
70
  }
92
71
  }
@@ -1,54 +0,0 @@
1
- this.globalThis = this.globalThis || {};
2
- this.globalThis.solanaWeb3 = (function (exports) {
3
- 'use strict';
4
-
5
- // src/roles.ts
6
- var AccountRole = /* @__PURE__ */ ((AccountRole2) => {
7
- AccountRole2[AccountRole2["WRITABLE_SIGNER"] = /* 3 */
8
- 3] = "WRITABLE_SIGNER";
9
- AccountRole2[AccountRole2["READONLY_SIGNER"] = /* 2 */
10
- 2] = "READONLY_SIGNER";
11
- AccountRole2[AccountRole2["WRITABLE"] = /* 1 */
12
- 1] = "WRITABLE";
13
- AccountRole2[AccountRole2["READONLY"] = /* 0 */
14
- 0] = "READONLY";
15
- return AccountRole2;
16
- })(AccountRole || {});
17
- var IS_SIGNER_BITMASK = 2;
18
- var IS_WRITABLE_BITMASK = 1;
19
- function downgradeRoleToNonSigner(role) {
20
- return role & ~IS_SIGNER_BITMASK;
21
- }
22
- function downgradeRoleToReadonly(role) {
23
- return role & ~IS_WRITABLE_BITMASK;
24
- }
25
- function isSignerRole(role) {
26
- return role >= 2 /* READONLY_SIGNER */;
27
- }
28
- function isWritableRole(role) {
29
- return (role & IS_WRITABLE_BITMASK) !== 0;
30
- }
31
- function mergeRoles(roleA, roleB) {
32
- return roleA | roleB;
33
- }
34
- function upgradeRoleToSigner(role) {
35
- return role | IS_SIGNER_BITMASK;
36
- }
37
- function upgradeRoleToWritable(role) {
38
- return role | IS_WRITABLE_BITMASK;
39
- }
40
-
41
- exports.AccountRole = AccountRole;
42
- exports.downgradeRoleToNonSigner = downgradeRoleToNonSigner;
43
- exports.downgradeRoleToReadonly = downgradeRoleToReadonly;
44
- exports.isSignerRole = isSignerRole;
45
- exports.isWritableRole = isWritableRole;
46
- exports.mergeRoles = mergeRoles;
47
- exports.upgradeRoleToSigner = upgradeRoleToSigner;
48
- exports.upgradeRoleToWritable = upgradeRoleToWritable;
49
-
50
- return exports;
51
-
52
- })({});
53
- //# sourceMappingURL=out.js.map
54
- //# sourceMappingURL=index.development.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/roles.ts"],"names":["AccountRole"],"mappings":";AAIO,IAAK,cAAL,kBAAKA,iBAAL;AAEH,EAAAA,0BAAA;AAAA,EAA0B,KAA1B;AACA,EAAAA,0BAAA;AAAA,EAA0B,KAA1B;AACA,EAAAA,0BAAA;AAAA,EAA0B,KAA1B;AACA,EAAAA,0BAAA;AAAA,EAA0B,KAA1B;AALQ,SAAAA;AAAA,GAAA;AAQZ,IAAM,oBAAoB;AAC1B,IAAM,sBAAsB;AAKrB,SAAS,yBAAyB,MAAgC;AACrE,SAAO,OAAO,CAAC;AACnB;AAKO,SAAS,wBAAwB,MAAgC;AACpE,SAAO,OAAO,CAAC;AACnB;AAEO,SAAS,aAAa,MAAsF;AAC/G,SAAO,QAAQ;AACnB;AAEO,SAAS,eAAe,MAA+E;AAC1G,UAAQ,OAAO,yBAAyB;AAC5C;AAYO,SAAS,WAAW,OAAoB,OAAiC;AAC5E,SAAO,QAAQ;AACnB;AAKO,SAAS,oBAAoB,MAAgC;AAChE,SAAO,OAAO;AAClB;AAKO,SAAS,sBAAsB,MAAgC;AAClE,SAAO,OAAO;AAClB","sourcesContent":["/**\n * Quick primer on bitwise operations: https://stackoverflow.com/a/1436448/802047\n */\n\nexport enum AccountRole {\n // Bitflag guide: is signer ⌄⌄ is writable\n WRITABLE_SIGNER = /* 3 */ 0b11, // prettier-ignore\n READONLY_SIGNER = /* 2 */ 0b10, // prettier-ignore\n WRITABLE = /* 1 */ 0b01, // prettier-ignore\n READONLY = /* 0 */ 0b00, // prettier-ignore\n}\n\nconst IS_SIGNER_BITMASK = 0b10;\nconst IS_WRITABLE_BITMASK = 0b01;\n\nexport function downgradeRoleToNonSigner(role: AccountRole.READONLY_SIGNER): AccountRole.READONLY;\nexport function downgradeRoleToNonSigner(role: AccountRole.WRITABLE_SIGNER): AccountRole.WRITABLE;\nexport function downgradeRoleToNonSigner(role: AccountRole): AccountRole;\nexport function downgradeRoleToNonSigner(role: AccountRole): AccountRole {\n return role & ~IS_SIGNER_BITMASK;\n}\n\nexport function downgradeRoleToReadonly(role: AccountRole.WRITABLE): AccountRole.READONLY;\nexport function downgradeRoleToReadonly(role: AccountRole.WRITABLE_SIGNER): AccountRole.READONLY_SIGNER;\nexport function downgradeRoleToReadonly(role: AccountRole): AccountRole;\nexport function downgradeRoleToReadonly(role: AccountRole): AccountRole {\n return role & ~IS_WRITABLE_BITMASK;\n}\n\nexport function isSignerRole(role: AccountRole): role is AccountRole.READONLY_SIGNER | AccountRole.WRITABLE_SIGNER {\n return role >= AccountRole.READONLY_SIGNER;\n}\n\nexport function isWritableRole(role: AccountRole): role is AccountRole.WRITABLE | AccountRole.WRITABLE_SIGNER {\n return (role & IS_WRITABLE_BITMASK) !== 0;\n}\n\nexport function mergeRoles(roleA: AccountRole.WRITABLE, roleB: AccountRole.READONLY_SIGNER): AccountRole.WRITABLE_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole.READONLY_SIGNER, roleB: AccountRole.WRITABLE): AccountRole.WRITABLE_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole, roleB: AccountRole.WRITABLE_SIGNER): AccountRole.WRITABLE_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole.WRITABLE_SIGNER, roleB: AccountRole): AccountRole.WRITABLE_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole, roleB: AccountRole.READONLY_SIGNER): AccountRole.READONLY_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole.READONLY_SIGNER, roleB: AccountRole): AccountRole.READONLY_SIGNER; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole, roleB: AccountRole.WRITABLE): AccountRole.WRITABLE; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole.WRITABLE, roleB: AccountRole): AccountRole.WRITABLE; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole.READONLY, roleB: AccountRole.READONLY): AccountRole.READONLY; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole, roleB: AccountRole): AccountRole; // prettier-ignore\nexport function mergeRoles(roleA: AccountRole, roleB: AccountRole): AccountRole {\n return roleA | roleB;\n}\n\nexport function upgradeRoleToSigner(role: AccountRole.READONLY): AccountRole.READONLY_SIGNER;\nexport function upgradeRoleToSigner(role: AccountRole.WRITABLE): AccountRole.WRITABLE_SIGNER;\nexport function upgradeRoleToSigner(role: AccountRole): AccountRole;\nexport function upgradeRoleToSigner(role: AccountRole): AccountRole {\n return role | IS_SIGNER_BITMASK;\n}\n\nexport function upgradeRoleToWritable(role: AccountRole.READONLY): AccountRole.WRITABLE;\nexport function upgradeRoleToWritable(role: AccountRole.READONLY_SIGNER): AccountRole.WRITABLE_SIGNER;\nexport function upgradeRoleToWritable(role: AccountRole): AccountRole;\nexport function upgradeRoleToWritable(role: AccountRole): AccountRole {\n return role | IS_WRITABLE_BITMASK;\n}\n"]}
@@ -1,18 +0,0 @@
1
- this.globalThis = this.globalThis || {};
2
- this.globalThis.solanaWeb3 = (function (exports) {
3
- 'use strict';
4
-
5
- var n=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(n||{});function l(o){return o&-3}function A(o){return o&-2}function r(o){return o>=2}function u(o){return (o&1)!==0}function E(o,R){return o|R}function I(o){return o|2}function N(o){return o|1}
6
-
7
- exports.AccountRole = n;
8
- exports.downgradeRoleToNonSigner = l;
9
- exports.downgradeRoleToReadonly = A;
10
- exports.isSignerRole = r;
11
- exports.isWritableRole = u;
12
- exports.mergeRoles = E;
13
- exports.upgradeRoleToSigner = I;
14
- exports.upgradeRoleToWritable = N;
15
-
16
- return exports;
17
-
18
- })({});