@solana/addresses 2.0.0-experimental.82bbf6f → 2.0.0-experimental.8541c2e
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 +1 -1
- package/README.md +124 -17
- package/dist/index.browser.cjs +97 -42
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +91 -40
- package/dist/index.browser.js.map +1 -1
- package/dist/index.native.js +91 -40
- package/dist/index.native.js.map +1 -1
- package/dist/index.node.cjs +99 -42
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +91 -40
- package/dist/index.node.js.map +1 -1
- package/dist/types/address.d.ts +12 -0
- package/dist/types/address.d.ts.map +1 -0
- package/dist/types/curve.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/program-derived-address.d.ts +38 -0
- package/dist/types/program-derived-address.d.ts.map +1 -0
- package/dist/types/public-key.d.ts +2 -2
- package/dist/types/public-key.d.ts.map +1 -0
- package/dist/types/vendor/noble/ed25519.d.ts.map +1 -0
- package/package.json +16 -36
- package/dist/index.development.js +0 -539
- package/dist/index.development.js.map +0 -1
- package/dist/index.production.min.js +0 -16
- package/dist/types/base58.d.ts +0 -10
- package/dist/types/computed-address.d.ts +0 -18
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"curve.d.ts","sourceRoot":"","sources":["../../src/curve.ts"],"names":[],"mappings":"AAiBA,wBAAsB,8BAA8B,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,CAMxF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './public-key';
|
|
1
|
+
export * from './address.js';
|
|
2
|
+
export * from './program-derived-address.js';
|
|
3
|
+
export * from './public-key.js';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Address } from './address.js';
|
|
2
|
+
/**
|
|
3
|
+
* An address derived from a program address and a set of seeds.
|
|
4
|
+
* It includes the bump seed used to derive the address and
|
|
5
|
+
* ensure the address is not on the Ed25519 curve.
|
|
6
|
+
*/
|
|
7
|
+
export type ProgramDerivedAddress<TAddress extends string = string> = Readonly<[
|
|
8
|
+
Address<TAddress>,
|
|
9
|
+
ProgramDerivedAddressBump
|
|
10
|
+
]>;
|
|
11
|
+
/**
|
|
12
|
+
* A number between 0 and 255, inclusive.
|
|
13
|
+
*/
|
|
14
|
+
export type ProgramDerivedAddressBump = number & {
|
|
15
|
+
readonly __brand: unique symbol;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Returns true if the input value is a program derived address.
|
|
19
|
+
*/
|
|
20
|
+
export declare function isProgramDerivedAddress<TAddress extends string = string>(value: unknown): value is ProgramDerivedAddress<TAddress>;
|
|
21
|
+
/**
|
|
22
|
+
* Fails if the input value is not a program derived address.
|
|
23
|
+
*/
|
|
24
|
+
export declare function assertIsProgramDerivedAddress<TAddress extends string = string>(value: unknown): asserts value is ProgramDerivedAddress<TAddress>;
|
|
25
|
+
type ProgramDerivedAddressInput = Readonly<{
|
|
26
|
+
programAddress: Address;
|
|
27
|
+
seeds: Seed[];
|
|
28
|
+
}>;
|
|
29
|
+
type SeedInput = Readonly<{
|
|
30
|
+
baseAddress: Address;
|
|
31
|
+
programAddress: Address;
|
|
32
|
+
seed: Seed;
|
|
33
|
+
}>;
|
|
34
|
+
type Seed = string | Uint8Array;
|
|
35
|
+
export declare function getProgramDerivedAddress({ programAddress, seeds, }: ProgramDerivedAddressInput): Promise<ProgramDerivedAddress>;
|
|
36
|
+
export declare function createAddressWithSeed({ baseAddress, programAddress, seed }: SeedInput): Promise<Address>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=program-derived-address.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program-derived-address.d.ts","sourceRoot":"","sources":["../../src/program-derived-address.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAA+C,MAAM,WAAW,CAAC;AAGjF;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,QAAQ,CAC1E;IAAC,OAAO,CAAC,QAAQ,CAAC;IAAE,yBAAyB;CAAC,CACjD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG;IAC7C,QAAQ,CAAC,OAAO,EAAE,OAAO,MAAM,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EACpE,KAAK,EAAE,OAAO,GACf,KAAK,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAU1C;AAED;;GAEG;AACH,wBAAgB,6BAA6B,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAC1E,KAAK,EAAE,OAAO,GACf,OAAO,CAAC,KAAK,IAAI,qBAAqB,CAAC,QAAQ,CAAC,CAclD;AAED,KAAK,0BAA0B,GAAG,QAAQ,CAAC;IACvC,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,IAAI,EAAE,CAAC;CACjB,CAAC,CAAC;AAEH,KAAK,SAAS,GAAG,QAAQ,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,IAAI,EAAE,IAAI,CAAC;CACd,CAAC,CAAC;AAEH,KAAK,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;AA0ChC,wBAAsB,wBAAwB,CAAC,EAC3C,cAAc,EACd,KAAK,GACR,EAAE,0BAA0B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAmB7D;AAED,wBAAsB,qBAAqB,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAyB9G"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function getAddressFromPublicKey(publicKey: CryptoKey): Promise<
|
|
1
|
+
import { Address } from './address.js';
|
|
2
|
+
export declare function getAddressFromPublicKey(publicKey: CryptoKey): Promise<Address>;
|
|
3
3
|
//# sourceMappingURL=public-key.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-key.d.ts","sourceRoot":"","sources":["../../src/public-key.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAqB,MAAM,WAAW,CAAC;AAEvD,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,CAQpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ed25519.d.ts","sourceRoot":"","sources":["../../../../src/vendor/noble/ed25519.ts"],"names":[],"mappings":"AAgFA,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAanE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solana/addresses",
|
|
3
|
-
"version": "2.0.0-experimental.
|
|
3
|
+
"version": "2.0.0-experimental.8541c2e",
|
|
4
4
|
"description": "Helpers for generating account addresses",
|
|
5
5
|
"exports": {
|
|
6
6
|
"browser": {
|
|
@@ -49,30 +49,9 @@
|
|
|
49
49
|
"node": ">=17.4"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@
|
|
53
|
-
"@solana/
|
|
54
|
-
|
|
55
|
-
"devDependencies": {
|
|
56
|
-
"@solana/eslint-config-solana": "^1.0.2",
|
|
57
|
-
"@swc/jest": "^0.2.28",
|
|
58
|
-
"@types/jest": "^29.5.3",
|
|
59
|
-
"@typescript-eslint/eslint-plugin": "^6.3.0",
|
|
60
|
-
"@typescript-eslint/parser": "^6.3.0",
|
|
61
|
-
"agadoo": "^3.0.0",
|
|
62
|
-
"eslint": "^8.45.0",
|
|
63
|
-
"eslint-plugin-jest": "^27.2.3",
|
|
64
|
-
"eslint-plugin-sort-keys-fix": "^1.1.2",
|
|
65
|
-
"jest": "^29.6.1",
|
|
66
|
-
"jest-environment-jsdom": "^29.6.4",
|
|
67
|
-
"jest-runner-eslint": "^2.1.0",
|
|
68
|
-
"jest-runner-prettier": "^1.0.0",
|
|
69
|
-
"prettier": "^2.8",
|
|
70
|
-
"tsup": "7.2.0",
|
|
71
|
-
"typescript": "^5.1.6",
|
|
72
|
-
"version-from-git": "^1.1.1",
|
|
73
|
-
"build-scripts": "0.0.0",
|
|
74
|
-
"test-config": "0.0.0",
|
|
75
|
-
"tsconfig": "0.0.0"
|
|
52
|
+
"@solana/assertions": "2.0.0-experimental.8541c2e",
|
|
53
|
+
"@solana/codecs-strings": "2.0.0-experimental.8541c2e",
|
|
54
|
+
"@solana/codecs-core": "2.0.0-experimental.8541c2e"
|
|
76
55
|
},
|
|
77
56
|
"bundlewatch": {
|
|
78
57
|
"defaultCompression": "gzip",
|
|
@@ -83,18 +62,19 @@
|
|
|
83
62
|
]
|
|
84
63
|
},
|
|
85
64
|
"scripts": {
|
|
86
|
-
"compile:js": "tsup --config build-scripts/tsup.config.
|
|
87
|
-
"compile:typedefs": "tsc -p ./tsconfig.declarations.json",
|
|
88
|
-
"dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
89
|
-
"publish-
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"test:
|
|
65
|
+
"compile:js": "tsup --config build-scripts/tsup.config.package.ts",
|
|
66
|
+
"compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/@solana/build-scripts/add-js-extension-to-types.mjs",
|
|
67
|
+
"dev": "jest -c node_modules/@solana/test-config/jest-dev.config.ts --rootDir . --watch",
|
|
68
|
+
"publish-impl": "npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || pnpm publish --tag experimental --access public --no-git-checks",
|
|
69
|
+
"publish-packages": "pnpm prepublishOnly && pnpm publish-impl",
|
|
70
|
+
"style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
|
|
71
|
+
"test:lint": "jest -c node_modules/@solana/test-config/jest-lint.config.ts --rootDir . --silent",
|
|
72
|
+
"test:prettier": "jest -c node_modules/@solana/test-config/jest-prettier.config.ts --rootDir . --silent",
|
|
93
73
|
"test:treeshakability:browser": "agadoo dist/index.browser.js",
|
|
94
|
-
"test:treeshakability:native": "agadoo dist/index.
|
|
95
|
-
"test:treeshakability:node": "agadoo dist/index.
|
|
74
|
+
"test:treeshakability:native": "agadoo dist/index.native.js",
|
|
75
|
+
"test:treeshakability:node": "agadoo dist/index.node.js",
|
|
96
76
|
"test:typecheck": "tsc --noEmit",
|
|
97
|
-
"test:unit:browser": "jest -c node_modules/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
98
|
-
"test:unit:node": "jest -c node_modules/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
77
|
+
"test:unit:browser": "jest -c node_modules/@solana/test-config/jest-unit.config.browser.ts --rootDir . --silent",
|
|
78
|
+
"test:unit:node": "jest -c node_modules/@solana/test-config/jest-unit.config.node.ts --rootDir . --silent"
|
|
99
79
|
}
|
|
100
80
|
}
|