@solana/accounts 2.0.0-experimental.0835c79

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.
@@ -0,0 +1,25 @@
1
+ import type { Address } from '@solana/addresses';
2
+ import type { AccountInfoBase, AccountInfoWithBase58Bytes, AccountInfoWithBase58EncodedData, AccountInfoWithBase64EncodedData } from '@solana/rpc-core/dist/types/rpc-methods/common';
3
+ import type { Account, EncodedAccount } from './account.js';
4
+ import { MaybeAccount, MaybeEncodedAccount } from './maybe-account.js';
5
+ type Base64EncodedRpcAccount = AccountInfoBase & AccountInfoWithBase64EncodedData;
6
+ /** Parse an account object received from a base64-encoded RPC call into an EncodedAccount or MaybeEncodedAccount type. */
7
+ export declare function parseBase64RpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: Base64EncodedRpcAccount): EncodedAccount<TAddress>;
8
+ export declare function parseBase64RpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: Base64EncodedRpcAccount | null): MaybeEncodedAccount<TAddress>;
9
+ type Base58EncodedRpcAccount = AccountInfoBase & (AccountInfoWithBase58Bytes | AccountInfoWithBase58EncodedData);
10
+ /** Parse an account object received from a base58-encoded RPC call into an EncodedAccount or MaybeEncodedAccount type. */
11
+ export declare function parseBase58RpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: Base58EncodedRpcAccount): EncodedAccount<TAddress>;
12
+ export declare function parseBase58RpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: Base58EncodedRpcAccount | null): MaybeEncodedAccount<TAddress>;
13
+ type JsonParsedRpcAccount = AccountInfoBase & {
14
+ readonly data: JsonParsedData<unknown>;
15
+ };
16
+ type JsonParsedData<TData> = {
17
+ readonly parsed: {
18
+ readonly info: TData;
19
+ };
20
+ };
21
+ /** Parse an account object received from a json-parsed RPC call into an Account or MaybeAccount type. */
22
+ export declare function parseJsonRpcAccount<TData extends object, TAddress extends string = string>(address: Address<TAddress>, rpcAccount: JsonParsedRpcAccount): Account<TData, TAddress>;
23
+ export declare function parseJsonRpcAccount<TData extends object, TAddress extends string = string>(address: Address<TAddress>, rpcAccount: JsonParsedRpcAccount | null): MaybeAccount<TData, TAddress>;
24
+ export {};
25
+ //# sourceMappingURL=parse-account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-account.d.ts","sourceRoot":"","sources":["../../src/parse-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,OAAO,KAAK,EACR,eAAe,EACf,0BAA0B,EAC1B,gCAAgC,EAChC,gCAAgC,EACnC,MAAM,gDAAgD,CAAC;AAExD,OAAO,KAAK,EAAE,OAAO,EAAe,cAAc,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,KAAK,uBAAuB,GAAG,eAAe,GAAG,gCAAgC,CAAC;AAElF,0HAA0H;AAC1H,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,uBAAuB,GACpC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,uBAAuB,GAAG,IAAI,GAC3C,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAUjC,KAAK,uBAAuB,GAAG,eAAe,GAAG,CAAC,0BAA0B,GAAG,gCAAgC,CAAC,CAAC;AAEjH,0HAA0H;AAC1H,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,uBAAuB,GACpC,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,qBAAqB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClE,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,uBAAuB,GAAG,IAAI,GAC3C,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AAUjC,KAAK,oBAAoB,GAAG,eAAe,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC,CAAA;CAAE,CAAC;AACzF,KAAK,cAAc,CAAC,KAAK,IAAI;IAAE,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;KAAE,CAAA;CAAE,CAAC;AAE3E,yGAAyG;AACzG,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EACtF,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,oBAAoB,GACjC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EACtF,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,oBAAoB,GAAG,IAAI,GACxC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,100 @@
1
+ {
2
+ "name": "@solana/accounts",
3
+ "version": "2.0.0-experimental.0835c79",
4
+ "description": "Helpers for representing, fetching and decoding Solana accounts",
5
+ "exports": {
6
+ "browser": {
7
+ "import": "./dist/index.browser.js",
8
+ "require": "./dist/index.browser.cjs"
9
+ },
10
+ "node": {
11
+ "import": "./dist/index.node.js",
12
+ "require": "./dist/index.node.cjs"
13
+ },
14
+ "react-native": "./dist/index.native.js",
15
+ "types": "./dist/types/index.d.ts"
16
+ },
17
+ "browser": {
18
+ "./dist/index.node.cjs": "./dist/index.browser.cjs",
19
+ "./dist/index.node.js": "./dist/index.browser.js"
20
+ },
21
+ "main": "./dist/index.node.cjs",
22
+ "module": "./dist/index.node.js",
23
+ "react-native": "./dist/index.native.js",
24
+ "types": "./dist/types/index.d.ts",
25
+ "type": "module",
26
+ "files": [
27
+ "./dist/"
28
+ ],
29
+ "sideEffects": false,
30
+ "keywords": [
31
+ "blockchain",
32
+ "solana",
33
+ "web3"
34
+ ],
35
+ "author": "Solana Labs Maintainers <maintainers@solanalabs.com>",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/solana-labs/solana-web3.js"
40
+ },
41
+ "bugs": {
42
+ "url": "http://github.com/solana-labs/solana-web3.js/issues"
43
+ },
44
+ "browserslist": [
45
+ "supports bigint and not dead",
46
+ "maintained node versions"
47
+ ],
48
+ "dependencies": {
49
+ "@solana/addresses": "2.0.0-experimental.0835c79",
50
+ "@solana/codecs-core": "2.0.0-experimental.0835c79",
51
+ "@solana/codecs-strings": "2.0.0-experimental.0835c79",
52
+ "@solana/rpc-core": "2.0.0-experimental.0835c79",
53
+ "@solana/rpc-transport": "2.0.0-experimental.0835c79",
54
+ "@solana/rpc-types": "2.0.0-experimental.0835c79"
55
+ },
56
+ "devDependencies": {
57
+ "@solana/eslint-config-solana": "^1.0.2",
58
+ "@swc/jest": "^0.2.29",
59
+ "@types/jest": "^29.5.11",
60
+ "@typescript-eslint/eslint-plugin": "^6.13.2",
61
+ "@typescript-eslint/parser": "^6.3.0",
62
+ "agadoo": "^3.0.0",
63
+ "eslint": "^8.45.0",
64
+ "eslint-plugin-sort-keys-fix": "^1.1.2",
65
+ "jest": "^29.7.0",
66
+ "jest-runner-eslint": "^2.1.2",
67
+ "jest-runner-prettier": "^1.0.0",
68
+ "prettier": "^3.1",
69
+ "tsup": "^8.0.1",
70
+ "typescript": "^5.2.2",
71
+ "version-from-git": "^1.1.1",
72
+ "build-scripts": "0.0.0",
73
+ "test-config": "0.0.0",
74
+ "test-matchers": "0.0.0",
75
+ "tsconfig": "0.0.0"
76
+ },
77
+ "bundlewatch": {
78
+ "defaultCompression": "gzip",
79
+ "files": [
80
+ {
81
+ "path": "./dist/index*.js"
82
+ }
83
+ ]
84
+ },
85
+ "scripts": {
86
+ "compile:js": "tsup --config build-scripts/tsup.config.package.ts",
87
+ "compile:typedefs": "tsc -p ./tsconfig.declarations.json && node node_modules/build-scripts/add-js-extension-to-types.mjs",
88
+ "dev": "jest -c node_modules/test-config/jest-dev.config.ts --rootDir . --watch",
89
+ "publish-packages": "pnpm publish --tag experimental --access public --no-git-checks",
90
+ "style:fix": "pnpm eslint --fix src/* && pnpm prettier -w src/* package.json",
91
+ "test:lint": "jest -c node_modules/test-config/jest-lint.config.ts --rootDir . --silent",
92
+ "test:prettier": "jest -c node_modules/test-config/jest-prettier.config.ts --rootDir . --silent",
93
+ "test:treeshakability:browser": "agadoo dist/index.browser.js",
94
+ "test:treeshakability:native": "agadoo dist/index.native.js",
95
+ "test:treeshakability:node": "agadoo dist/index.node.js",
96
+ "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"
99
+ }
100
+ }