@solana/accounts 2.0.0-experimental.1db8859
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 +20 -0
- package/README.md +254 -0
- package/dist/index.browser.cjs +89 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.js +76 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.development.js +179 -0
- package/dist/index.development.js.map +1 -0
- package/dist/index.native.js +78 -0
- package/dist/index.native.js.map +1 -0
- package/dist/index.node.cjs +89 -0
- package/dist/index.node.cjs.map +1 -0
- package/dist/index.node.js +78 -0
- package/dist/index.node.js.map +1 -0
- package/dist/index.production.min.js +20 -0
- package/dist/types/account-header.d.ts +11 -0
- package/dist/types/account-header.d.ts.map +1 -0
- package/dist/types/account.d.ts +18 -0
- package/dist/types/account.d.ts.map +1 -0
- package/dist/types/decode-account.d.ts +7 -0
- package/dist/types/decode-account.d.ts.map +1 -0
- package/dist/types/fetch-account.d.ts +62 -0
- package/dist/types/fetch-account.d.ts.map +1 -0
- package/dist/types/fetch-encoded-account.d.ts +24 -0
- package/dist/types/fetch-encoded-account.d.ts.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/maybe-account.d.ts +16 -0
- package/dist/types/maybe-account.d.ts.map +1 -0
- package/dist/types/parse-account.d.ts +25 -0
- package/dist/types/parse-account.d.ts.map +1 -0
- package/dist/types/parse-rpc-account.d.ts +20 -0
- package/dist/types/parse-rpc-account.d.ts.map +1 -0
- package/package.json +100 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
this.globalThis = this.globalThis || {};
|
|
2
|
+
this.globalThis.solanaWeb3 = (function (exports) {
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
var B=128;function z(e,t){try{return "exists"in e&&!e.exists?e:Object.freeze({...e,data:t.decode(e.data)})}catch(r){let n=new Error(`Failed to decode account [${e.address}].`);throw n.cause=r,n}}function l(e,t){return "fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function u(e){return Object.freeze({...e,encode:t=>{let r=new Uint8Array(l(t,e));return e.write(t,r,0),r}})}function y(e,t,r=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new Error(`Expected a string of base ${e.length}, got [${r}].`)}var h=e=>u({getSizeFromValue:t=>{let[r,n]=f(t,e[0]);if(n==="")return t.length;let s=m(n,e);return r.length+Math.ceil(s.toString(16).length/2)},write(t,r,n){if(y(e,t),t==="")return n;let[s,o]=f(t,e[0]);if(o==="")return r.set(new Uint8Array(s.length).fill(0),n),n+s.length;let c=m(o,e),d=[];for(;c>0n;)d.unshift(Number(c%256n)),c/=256n;let g=[...Array(s.length).fill(0),...d];return r.set(g,n),n+g.length}});function f(e,t){let r=[...e].findIndex(n=>n!==t);return r===-1?[e,""]:[e.slice(0,r),e.slice(r)]}function m(e,t){let r=BigInt(t.length);return [...e].reduce((n,s)=>n*r+BigInt(t.indexOf(s)),0n)}var E="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",T=()=>h(E);var x=()=>u({getSizeFromValue:e=>{try{return atob(e).length}catch{throw new Error(`Expected a string of base 64, got [${e}].`)}},write(e,t,r){try{let n=atob(e).split("").map(s=>s.charCodeAt(0));return t.set(n,r),n.length+r}catch{throw new Error(`Expected a string of base 64, got [${e}].`)}}});function i(e,t){if(!t)return Object.freeze({address:e,exists:!1});let r=x().encode(t.data[0]);return Object.freeze({...p(t),address:e,data:r,exists:!0})}function W(e,t){if(!t)return Object.freeze({address:e,exists:!1});let r=T().encode(typeof t.data=="string"?t.data:t.data[0]);return Object.freeze({...p(t),address:e,data:r,exists:!0})}function A(e,t){if(!t)return Object.freeze({address:e,exists:!1});let r=t.data.parsed.info;return Object.freeze({...p(t),address:e,data:r,exists:!0})}function p(e){return Object.freeze({executable:e.executable,lamports:e.lamports,programAddress:e.owner})}async function Z(e,t,r={}){let{abortSignal:n,...s}=r,o=await e.getAccountInfo(t,{...s,encoding:"base64"}).send({abortSignal:n});return i(t,o.value)}async function _(e,t,r={}){let{abortSignal:n,...s}=r,{value:o}=await e.getAccountInfo(t,{...s,encoding:"jsonParsed"}).send({abortSignal:n});return o&&typeof o=="object"&&"parsed"in o.data?A(t,o):i(t,o)}async function H(e,t,r={}){let{abortSignal:n,...s}=r;return (await e.getMultipleAccounts(t,{...s,encoding:"base64"}).send({abortSignal:n})).value.map((c,d)=>i(t[d],c))}async function q(e,t,r={}){let{abortSignal:n,...s}=r;return (await e.getMultipleAccounts(t,{...s,encoding:"jsonParsed"}).send({abortSignal:n})).value.map((c,d)=>c&&typeof c=="object"&&"parsed"in c.data?A(t[d],c):i(t[d],c))}function Y(e){if(!e.exists)throw new Error(`Expected account [${e.address}] to exist.`)}
|
|
6
|
+
|
|
7
|
+
exports.BASE_ACCOUNT_SIZE = B;
|
|
8
|
+
exports.assertAccountExists = Y;
|
|
9
|
+
exports.decodeAccount = z;
|
|
10
|
+
exports.fetchEncodedAccount = Z;
|
|
11
|
+
exports.fetchEncodedAccounts = H;
|
|
12
|
+
exports.fetchJsonParsedAccount = _;
|
|
13
|
+
exports.fetchJsonParsedAccounts = q;
|
|
14
|
+
exports.parseBase58RpcAccount = W;
|
|
15
|
+
exports.parseBase64RpcAccount = i;
|
|
16
|
+
exports.parseJsonRpcAccount = A;
|
|
17
|
+
|
|
18
|
+
return exports;
|
|
19
|
+
|
|
20
|
+
})({});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
2
|
+
import { LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
3
|
+
/** The amount of bytes required to store the account header. */
|
|
4
|
+
export declare const ACCOUNT_HEADER_SIZE = 128;
|
|
5
|
+
/** Describe the generic account details applicable to every account. */
|
|
6
|
+
export type AccountHeader = {
|
|
7
|
+
readonly programAddress: Address;
|
|
8
|
+
readonly executable: boolean;
|
|
9
|
+
readonly lamports: LamportsUnsafeBeyond2Pow53Minus1;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=account-header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account-header.d.ts","sourceRoot":"","sources":["../../src/account-header.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAErE,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,MAAM,CAAC;AAEvC,wEAAwE;AACxE,MAAM,MAAM,aAAa,GAAG;IACxB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,gCAAgC,CAAC;CACvD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { LamportsUnsafeBeyond2Pow53Minus1 } from '@solana/rpc-types';
|
|
3
|
+
/** The amount of bytes required to store the base account information without its data. */
|
|
4
|
+
export declare const BASE_ACCOUNT_SIZE = 128;
|
|
5
|
+
/** Describe the generic account details applicable to every account. */
|
|
6
|
+
export type BaseAccount = {
|
|
7
|
+
readonly programAddress: Address;
|
|
8
|
+
readonly executable: boolean;
|
|
9
|
+
readonly lamports: LamportsUnsafeBeyond2Pow53Minus1;
|
|
10
|
+
};
|
|
11
|
+
/** Defines a Solana account with its generic details and parsed or encoded data. */
|
|
12
|
+
export type Account<TData extends object | Uint8Array, TAddress extends string = string> = BaseAccount & {
|
|
13
|
+
readonly address: Address<TAddress>;
|
|
14
|
+
readonly data: TData;
|
|
15
|
+
};
|
|
16
|
+
/** Defines a Solana account with its generic details and encoded data. */
|
|
17
|
+
export type EncodedAccount<TAddress extends string = string> = Account<Uint8Array, TAddress>;
|
|
18
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,mBAAmB,CAAC;AAE1E,2FAA2F;AAC3F,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG;IACtB,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,QAAQ,EAAE,gCAAgC,CAAC;CACvD,CAAC;AAEF,oFAAoF;AACpF,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,MAAM,GAAG,UAAU,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,WAAW,GAAG;IACrG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IACpC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACxB,CAAC;AAEF,0EAA0E;AAC1E,MAAM,MAAM,cAAc,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,OAAO,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Decoder } from '@solana/codecs-core';
|
|
2
|
+
import type { Account, EncodedAccount } from './account.js';
|
|
3
|
+
import type { MaybeAccount, MaybeEncodedAccount } from './maybe-account.js';
|
|
4
|
+
/** Decodes the data of a given account using the provided decoder. */
|
|
5
|
+
export declare function decodeAccount<TData extends object, TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>, decoder: Decoder<TData>): Account<TData, TAddress>;
|
|
6
|
+
export declare function decodeAccount<TData extends object, TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>, decoder: Decoder<TData>): MaybeAccount<TData, TAddress>;
|
|
7
|
+
//# sourceMappingURL=decode-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"decode-account.d.ts","sourceRoot":"","sources":["../../src/decode-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEzE,sEAAsE;AACtE,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChF,cAAc,EAAE,cAAc,CAAC,QAAQ,CAAC,EACxC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACxB,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,aAAa,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EAChF,cAAc,EAAE,mBAAmB,CAAC,QAAQ,CAAC,EAC7C,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,GACxB,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-core/dist/types/rpc-methods/getAccountInfo';
|
|
4
|
+
import type { GetMultipleAccountsApi } from '@solana/rpc-core/dist/types/rpc-methods/getMultipleAccounts';
|
|
5
|
+
import type { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
6
|
+
import type { Commitment } from '@solana/rpc-types';
|
|
7
|
+
import type { MaybeAccount, MaybeEncodedAccount } from './maybe-account.js';
|
|
8
|
+
/** Optional configuration for fetching a singular account. */
|
|
9
|
+
export type FetchAccountConfig = {
|
|
10
|
+
commitment?: Commitment;
|
|
11
|
+
minContextSlot?: Slot;
|
|
12
|
+
abortSignal?: AbortSignal;
|
|
13
|
+
};
|
|
14
|
+
/** Fetch a base64-encoded account that may or may not exist using an RPC client. */
|
|
15
|
+
export declare function fetchEncodedAccount<TAddress extends string = string>(rpc: Rpc<GetAccountInfoApi>, address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeEncodedAccount<TAddress>>;
|
|
16
|
+
/** Fetch a json-parsed account that may or may not exist using an RPC client. */
|
|
17
|
+
export declare function fetchJsonParsedAccount<TData extends object, TAddress extends string = string>(rpc: Rpc<GetAccountInfoApi>, address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<TData, TAddress> | MaybeEncodedAccount<TAddress>>;
|
|
18
|
+
/** Optional configuration for fetching multiple accounts. */
|
|
19
|
+
export type FetchAccountsConfig = {
|
|
20
|
+
commitment?: Commitment;
|
|
21
|
+
minContextSlot?: Slot;
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
};
|
|
24
|
+
/** Fetch multiple base64-encoded accounts that may or may not exist using an RPC client. */
|
|
25
|
+
export declare function fetchEncodedAccounts<TAddresses extends string[] = string[], TWrappedAddresses extends {
|
|
26
|
+
[P in keyof TAddresses]: Address<TAddresses[P]>;
|
|
27
|
+
} = {
|
|
28
|
+
[P in keyof TAddresses]: Address<TAddresses[P]>;
|
|
29
|
+
}>(rpc: Rpc<GetMultipleAccountsApi>, addresses: TWrappedAddresses, config?: FetchAccountsConfig): Promise<{ [P in keyof TAddresses]: MaybeEncodedAccount<TAddresses[P]>; }>;
|
|
30
|
+
/** Fetch multiple json-parsed accounts that may or may not exist using an RPC client. */
|
|
31
|
+
export declare function fetchJsonParsedAccounts<TData extends object[], TAddresses extends string[] = string[], TWrappedAddresses extends {
|
|
32
|
+
[P in keyof TAddresses]: Address<TAddresses[P]>;
|
|
33
|
+
} = {
|
|
34
|
+
[P in keyof TAddresses]: Address<TAddresses[P]>;
|
|
35
|
+
}>(rpc: Rpc<GetMultipleAccountsApi>, addresses: TWrappedAddresses, config?: FetchAccountsConfig): Promise<{ [P in keyof TData]: ({
|
|
36
|
+
readonly exists: true;
|
|
37
|
+
} & import("./account").BaseAccount & {
|
|
38
|
+
readonly address: Address<TAddresses[P & keyof TAddresses]>;
|
|
39
|
+
readonly data: TData[P];
|
|
40
|
+
}) | {
|
|
41
|
+
readonly exists: false;
|
|
42
|
+
readonly address: Address<TAddresses[P & keyof TAddresses]>;
|
|
43
|
+
} | ({
|
|
44
|
+
readonly exists: true;
|
|
45
|
+
} & import("./account").BaseAccount & {
|
|
46
|
+
readonly address: Address<TAddresses[P & keyof TAddresses]>;
|
|
47
|
+
readonly data: Uint8Array;
|
|
48
|
+
}); } & { [P_1 in keyof TAddresses]: ({
|
|
49
|
+
readonly exists: true;
|
|
50
|
+
} & import("./account").BaseAccount & {
|
|
51
|
+
readonly address: Address<TAddresses[P_1]>;
|
|
52
|
+
readonly data: TData[P_1 & keyof TData];
|
|
53
|
+
}) | {
|
|
54
|
+
readonly exists: false;
|
|
55
|
+
readonly address: Address<TAddresses[P_1]>;
|
|
56
|
+
} | ({
|
|
57
|
+
readonly exists: true;
|
|
58
|
+
} & import("./account").BaseAccount & {
|
|
59
|
+
readonly address: Address<TAddresses[P_1]>;
|
|
60
|
+
readonly data: Uint8Array;
|
|
61
|
+
}); }>;
|
|
62
|
+
//# sourceMappingURL=fetch-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-account.d.ts","sourceRoot":"","sources":["../../src/fetch-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAGzE,8DAA8D;AAC9D,MAAM,MAAM,kBAAkB,GAAG;IAC7B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,oFAAoF;AACpF,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EACtE,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,MAAM,GAAE,kBAAuB,GAChC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAIxC;AAED,iFAAiF;AACjF,wBAAsB,sBAAsB,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EAC/F,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,MAAM,GAAE,kBAAuB,GAChC,OAAO,CAAC,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAQxE;AAED,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,GAAG;IAC9B,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,4FAA4F;AAC5F,wBAAsB,oBAAoB,CACtC,UAAU,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EACtC,iBAAiB,SAAS;KAAG,CAAC,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAC3E,CAAC,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CAClD,EACH,GAAG,EAAE,GAAG,CAAC,sBAAsB,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAE,mBAAwB,6EAQjG;AAED,yFAAyF;AACzF,wBAAsB,uBAAuB,CACzC,KAAK,SAAS,MAAM,EAAE,EACtB,UAAU,SAAS,MAAM,EAAE,GAAG,MAAM,EAAE,EACtC,iBAAiB,SAAS;KAAG,CAAC,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CAAE,GAAG;KAC3E,CAAC,IAAI,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;CAClD,EACH,GAAG,EAAE,GAAG,CAAC,sBAAsB,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,GAAE,mBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;OAkBjG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Address } from '@solana/addresses';
|
|
2
|
+
import type { Slot } from '@solana/rpc-core/dist/types/rpc-methods/common';
|
|
3
|
+
import type { GetAccountInfoApi } from '@solana/rpc-core/dist/types/rpc-methods/getAccountInfo';
|
|
4
|
+
import type { GetMultipleAccountsApi } from '@solana/rpc-core/dist/types/rpc-methods/getMultipleAccounts';
|
|
5
|
+
import type { Rpc } from '@solana/rpc-transport/dist/types/json-rpc-types';
|
|
6
|
+
import type { Commitment } from '@solana/rpc-types';
|
|
7
|
+
import type { MaybeEncodedAccount } from './maybe-account.js.js.js.js';
|
|
8
|
+
/** Optional configuration for fetching a singular account. */
|
|
9
|
+
export type FetchEncodedAccountConfig = {
|
|
10
|
+
commitment?: Commitment;
|
|
11
|
+
minContextSlot?: Slot;
|
|
12
|
+
abortSignal?: AbortSignal;
|
|
13
|
+
};
|
|
14
|
+
/** Fetch an encoded account that may or may not exist using an RPC client. */
|
|
15
|
+
export declare function fetchEncodedAccount<TAddress extends string = string>(rpc: Rpc<GetAccountInfoApi>, address: Address<TAddress>, config?: FetchEncodedAccountConfig): Promise<MaybeEncodedAccount<TAddress>>;
|
|
16
|
+
/** Optional configuration for fetching multiple accounts. */
|
|
17
|
+
export type FetchEncodedAccountsConfig = {
|
|
18
|
+
commitment?: Commitment;
|
|
19
|
+
minContextSlot?: Slot;
|
|
20
|
+
abortSignal?: AbortSignal;
|
|
21
|
+
};
|
|
22
|
+
/** Fetch multiple encoded accounts that may or may not exist using an RPC client. */
|
|
23
|
+
export declare function fetchEncodedAccounts(rpc: Rpc<GetMultipleAccountsApi>, addresses: Address[], config?: FetchEncodedAccountsConfig): Promise<MaybeEncodedAccount[]>;
|
|
24
|
+
//# sourceMappingURL=fetch-encoded-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-encoded-account.d.ts","sourceRoot":"","sources":["../../src/fetch-encoded-account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gDAAgD,CAAC;AAC3E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAChG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6DAA6D,CAAC;AAC1G,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAG3D,8DAA8D;AAC9D,MAAM,MAAM,yBAAyB,GAAG;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,8EAA8E;AAC9E,wBAAsB,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EACtE,GAAG,EAAE,GAAG,CAAC,iBAAiB,CAAC,EAC3B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,MAAM,GAAE,yBAA8B,GACvC,OAAO,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAIxC;AAED,6DAA6D;AAC7D,MAAM,MAAM,0BAA0B,GAAG;IACrC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,WAAW,CAAC;CAC7B,CAAC;AAEF,qFAAqF;AACrF,wBAAsB,oBAAoB,CACtC,GAAG,EAAE,GAAG,CAAC,sBAAsB,CAAC,EAChC,SAAS,EAAE,OAAO,EAAE,EACpB,MAAM,GAAE,0BAA+B,GACxC,OAAO,CAAC,mBAAmB,EAAE,CAAC,CAMhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Address } from '@solana/addresses';
|
|
2
|
+
import { Account } from './account.js';
|
|
3
|
+
/** Defines a Solana account that may or may not exist after having tried to fetch it. */
|
|
4
|
+
export type MaybeAccount<TData extends object | Uint8Array, TAddress extends string = string> = ({
|
|
5
|
+
readonly exists: true;
|
|
6
|
+
} & Account<TData, TAddress>) | {
|
|
7
|
+
readonly exists: false;
|
|
8
|
+
readonly address: Address<TAddress>;
|
|
9
|
+
};
|
|
10
|
+
/** Defines a Solana account with encoded data that may or may not exist after having tried to fetch it. */
|
|
11
|
+
export type MaybeEncodedAccount<TAddress extends string = string> = MaybeAccount<Uint8Array, TAddress>;
|
|
12
|
+
/** Asserts that an account that may or may not exists, actually exists. */
|
|
13
|
+
export declare function assertAccountExists<TData extends object | Uint8Array, TAddress extends string = string>(account: MaybeAccount<TData, TAddress>): asserts account is Account<TData, TAddress> & {
|
|
14
|
+
exists: true;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=maybe-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maybe-account.d.ts","sourceRoot":"","sources":["../../src/maybe-account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,yFAAyF;AACzF,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,MAAM,GAAG,UAAU,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,IACtF,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC,GACtD;IAAE,QAAQ,CAAC,MAAM,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,CAAC;AAEtE,2GAA2G;AAC3G,MAAM,MAAM,mBAAmB,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,IAAI,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;AAEvG,2EAA2E;AAC3E,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,MAAM,GAAG,UAAU,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EACnG,OAAO,EAAE,YAAY,CAAC,KAAK,EAAE,QAAQ,CAAC,GACvC,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,CAKhE"}
|
|
@@ -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"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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.js.js.js';
|
|
4
|
+
import { MaybeAccount, MaybeEncodedAccount } from './maybe-account.js.js.js.js';
|
|
5
|
+
type EncodedRpcAccount = AccountInfoBase & (AccountInfoWithBase58Bytes | AccountInfoWithBase58EncodedData | AccountInfoWithBase64EncodedData);
|
|
6
|
+
type JsonParsedRpcAccount = AccountInfoBase & {
|
|
7
|
+
readonly data: JsonParsedData<unknown>;
|
|
8
|
+
};
|
|
9
|
+
type JsonParsedData<TData> = {
|
|
10
|
+
readonly parsed: {
|
|
11
|
+
readonly info: TData;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
/** Parse an account object received from an RPC call into an EncodedAccount or MaybeEncodedAccount type. */
|
|
15
|
+
export declare function parseRpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: EncodedRpcAccount): EncodedAccount<TAddress>;
|
|
16
|
+
export declare function parseRpcAccount<TAddress extends string = string>(address: Address<TAddress>, rpcAccount: EncodedRpcAccount | null): MaybeEncodedAccount<TAddress>;
|
|
17
|
+
export declare function parseRpcAccount<TData extends object, TAddress extends string = string>(address: Address<TAddress>, rpcAccount: JsonParsedRpcAccount): Account<TData, TAddress>;
|
|
18
|
+
export declare function parseRpcAccount<TData extends object, TAddress extends string = string>(address: Address<TAddress>, rpcAccount: JsonParsedRpcAccount | null): MaybeAccount<TData, TAddress>;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=parse-rpc-account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-rpc-account.d.ts","sourceRoot":"","sources":["../../src/parse-rpc-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;AACzD,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEpE,KAAK,iBAAiB,GAAG,eAAe,GACpC,CAAC,0BAA0B,GAAG,gCAAgC,GAAG,gCAAgC,CAAC,CAAC;AAEvG,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,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAC5D,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,iBAAiB,GAC9B,cAAc,CAAC,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,eAAe,CAAC,QAAQ,SAAS,MAAM,GAAG,MAAM,EAC5D,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,iBAAiB,GAAG,IAAI,GACrC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;AACjC,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClF,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,EAC1B,UAAU,EAAE,oBAAoB,GACjC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAC5B,wBAAgB,eAAe,CAAC,KAAK,SAAS,MAAM,EAAE,QAAQ,SAAS,MAAM,GAAG,MAAM,EAClF,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.1db8859",
|
|
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/codecs-core": "2.0.0-development",
|
|
50
|
+
"@solana/addresses": "2.0.0-development",
|
|
51
|
+
"@solana/codecs-strings": "2.0.0-development",
|
|
52
|
+
"@solana/rpc-core": "2.0.0-development",
|
|
53
|
+
"@solana/rpc-transport": "2.0.0-development",
|
|
54
|
+
"@solana/rpc-types": "2.0.0-development"
|
|
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
|
+
"tsconfig": "0.0.0",
|
|
75
|
+
"test-matchers": "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.library.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
|
+
}
|