@solana/codecs 2.0.0-experimental.f2a2e5b → 2.0.0-experimental.fbbf6ba

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/codecs",
3
- "version": "2.0.0-experimental.f2a2e5b",
3
+ "version": "2.0.0-experimental.fbbf6ba",
4
4
  "description": "A library for encoding and decoding any data structure",
5
5
  "exports": {
6
6
  "browser": {
@@ -46,28 +46,11 @@
46
46
  "maintained node versions"
47
47
  ],
48
48
  "dependencies": {
49
- "@solana/codecs-core": "2.0.0-development",
50
- "@solana/codecs-data-structures": "2.0.0-development",
51
- "@solana/codecs-numbers": "2.0.0-development",
52
- "@solana/codecs-strings": "2.0.0-development",
53
- "@solana/options": "2.0.0-development"
54
- },
55
- "devDependencies": {
56
- "@solana/eslint-config-solana": "^1.0.2",
57
- "@typescript-eslint/eslint-plugin": "^6.13.2",
58
- "@typescript-eslint/parser": "^6.3.0",
59
- "agadoo": "^3.0.0",
60
- "eslint": "^8.45.0",
61
- "eslint-plugin-jest": "^27.4.2",
62
- "eslint-plugin-sort-keys-fix": "^1.1.2",
63
- "jest": "^29.7.0",
64
- "prettier": "^3.1",
65
- "tsup": "^8.0.1",
66
- "typescript": "^5.2.2",
67
- "version-from-git": "^1.1.1",
68
- "build-scripts": "0.0.0",
69
- "test-config": "0.0.0",
70
- "tsconfig": "0.0.0"
49
+ "@solana/codecs-core": "2.0.0-experimental.fbbf6ba",
50
+ "@solana/codecs-numbers": "2.0.0-experimental.fbbf6ba",
51
+ "@solana/options": "2.0.0-experimental.fbbf6ba",
52
+ "@solana/codecs-strings": "2.0.0-experimental.fbbf6ba",
53
+ "@solana/codecs-data-structures": "2.0.0-experimental.fbbf6ba"
71
54
  },
72
55
  "bundlewatch": {
73
56
  "defaultCompression": "gzip",
@@ -79,12 +62,13 @@
79
62
  },
80
63
  "scripts": {
81
64
  "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
82
- "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
83
- "dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
84
- "publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
65
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
66
+ "dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
67
+ "publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
68
+ "publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
85
69
  "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
86
- "test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
87
- "test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
70
+ "test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
71
+ "test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
88
72
  "test:treeshakability:browser": "agadoo dist/index.browser.js",
89
73
  "test:treeshakability:native": "agadoo dist/index.native.js",
90
74
  "test:treeshakability:node": "agadoo dist/index.node.js",
@@ -1,31 +0,0 @@
1
- import { Address } from '@solana/addresses';
2
- import { AccountRole } from './roles.js.js.js.js';
3
- export interface IAccountMeta<TAddress extends string = string> {
4
- readonly address: Address<TAddress>;
5
- readonly role: AccountRole;
6
- }
7
- export type ReadonlyAccount<TAddress extends string = string> = IAccountMeta<TAddress> & {
8
- readonly role: AccountRole.READONLY;
9
- };
10
- export type WritableAccount<TAddress extends string = string> = IAccountMeta<TAddress> & {
11
- role: AccountRole.WRITABLE;
12
- };
13
- export type ReadonlySignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & {
14
- role: AccountRole.READONLY_SIGNER;
15
- };
16
- export type WritableSignerAccount<TAddress extends string = string> = IAccountMeta<TAddress> & {
17
- role: AccountRole.WRITABLE_SIGNER;
18
- };
19
- export interface IAccountLookupMeta<TAddress extends string = string, TLookupTableAddress extends string = string> {
20
- readonly address: Address<TAddress>;
21
- readonly addressIndex: number;
22
- readonly lookupTableAddress: Address<TLookupTableAddress>;
23
- readonly role: AccountRole.READONLY | AccountRole.WRITABLE;
24
- }
25
- export type ReadonlyAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & {
26
- readonly role: AccountRole.READONLY;
27
- };
28
- export type WritableAccountLookup<TAddress extends string = string, TLookupTableAddress extends string = string> = IAccountLookupMeta<TAddress, TLookupTableAddress> & {
29
- readonly role: AccountRole.WRITABLE;
30
- };
31
- //# sourceMappingURL=accounts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"accounts.d.ts","sourceRoot":"","sources":["../../src/accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,YAAY,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM;IAC1D,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;CAC9B;AAED,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG;IACrF,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAC;CACvC,CAAC;AACF,MAAM,MAAM,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC,QAAQ,CAAA;CAAE,CAAC;AACxH,MAAM,MAA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ends string = string, TAccounts extends readonly (IAccountMeta | IAccountLookupMeta)[] = readonly (IAccountMeta | IAccountLookupMeta)[]> {
4
- readonly accounts?: TAccounts;
5
- readonly data?: Uint8Array;
6
- readonly programAddress: Address<TProgramAddress>;
7
- }
8
- export interface IInstructionWithAccounts<TAccounts extends readonly (IAccountMeta | IAccountLookupMeta)[]> extends IInstruction {
9
- readonly accounts: TAccounts;
10
- }
11
- export interface IInstructionWithData<TData extends Uint8Array> extends IInstruction {
12
- readonly data: TData;
13
- }
14
- //# sourceMappingURL=instruction.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,34 +0,0 @@
1
- /**
2
- * Quick primer on bitwise operations: https://stackoverflow.com/a/1436448/802047
3
- */
4
- export declare enum AccountRole {
5
- WRITABLE_SIGNER = 3,
6
- READONLY_SIGNER = 2,
7
- WRITABLE = 1,
8
- READONLY = 0
9
- }
10
- export declare function downgradeRoleToNonSigner(role: AccountRole.READONLY_SIGNER): AccountRole.READONLY;
11
- export declare function downgradeRoleToNonSigner(role: AccountRole.WRITABLE_SIGNER): AccountRole.WRITABLE;
12
- export declare function downgradeRoleToNonSigner(role: AccountRole): AccountRole;
13
- export declare function downgradeRoleToReadonly(role: AccountRole.WRITABLE): AccountRole.READONLY;
14
- export declare function downgradeRoleToReadonly(role: AccountRole.WRITABLE_SIGNER): AccountRole.READONLY_SIGNER;
15
- export declare function downgradeRoleToReadonly(role: AccountRole): AccountRole;
16
- export declare function isSignerRole(role: AccountRole): role is AccountRole.READONLY_SIGNER | AccountRole.WRITABLE_SIGNER;
17
- export declare function isWritableRole(role: AccountRole): role is AccountRole.WRITABLE | AccountRole.WRITABLE_SIGNER;
18
- export declare function mergeRoles(roleA: AccountRole.WRITABLE, roleB: AccountRole.READONLY_SIGNER): AccountRole.WRITABLE_SIGNER;
19
- export declare function mergeRoles(roleA: AccountRole.READONLY_SIGNER, roleB: AccountRole.WRITABLE): AccountRole.WRITABLE_SIGNER;
20
- export declare function mergeRoles(roleA: AccountRole, roleB: AccountRole.WRITABLE_SIGNER): AccountRole.WRITABLE_SIGNER;
21
- export declare function mergeRoles(roleA: AccountRole.WRITABLE_SIGNER, roleB: AccountRole): AccountRole.WRITABLE_SIGNER;
22
- export declare function mergeRoles(roleA: AccountRole, roleB: AccountRole.READONLY_SIGNER): AccountRole.READONLY_SIGNER;
23
- export declare function mergeRoles(roleA: AccountRole.READONLY_SIGNER, roleB: AccountRole): AccountRole.READONLY_SIGNER;
24
- export declare function mergeRoles(roleA: AccountRole, roleB: AccountRole.WRITABLE): AccountRole.WRITABLE;
25
- export declare function mergeRoles(roleA: AccountRole.WRITABLE, roleB: AccountRole): AccountRole.WRITABLE;
26
- export declare function mergeRoles(roleA: AccountRole.READONLY, roleB: AccountRole.READONLY): AccountRole.READONLY;
27
- export declare function mergeRoles(roleA: AccountRole, roleB: AccountRole): AccountRole;
28
- export declare function upgradeRoleToSigner(role: AccountRole.READONLY): AccountRole.READONLY_SIGNER;
29
- export declare function upgradeRoleToSigner(role: AccountRole.WRITABLE): AccountRole.WRITABLE_SIGNER;
30
- export declare function upgradeRoleToSigner(role: AccountRole): AccountRole;
31
- export declare function upgradeRoleToWritable(role: AccountRole.READONLY): AccountRole.WRITABLE;
32
- export declare function upgradeRoleToWritable(role: AccountRole.READONLY_SIGNER): AccountRole.WRITABLE_SIGNER;
33
- export declare function upgradeRoleToWritable(role: AccountRole): AccountRole;
34
- //# sourceMappingURL=roles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/roles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,oBAAY,WAAW;IAEnB,eAAe,IAAe;IAC9B,eAAe,IAAe;IAC9B,QAAQ,IAAsB;IAC9B,QAAQ,IAAsB;CACjC;AAKD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,QAAQ,CAAC;AAClG,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;AAKzE,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,CAAC,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC;AAC1F,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,CAAC,eAAe,GAAG,WAAW,CAAC,eAAe,CAAC;AACxG,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;AAKxE,wBAAgB,YAAY,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,IAAI,WAAW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