wative-core 1.2.1 → 2.2.0

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.
Files changed (62) hide show
  1. package/CHANGELOG.md +136 -0
  2. package/LICENSE +55 -0
  3. package/README.md +496 -0
  4. package/dist/artifacts/evm/index.cjs +1 -0
  5. package/dist/artifacts/evm/index.d.cts +6 -0
  6. package/dist/artifacts/evm/index.d.ts +6 -0
  7. package/dist/artifacts/evm/index.js +1 -0
  8. package/dist/artifacts/svm/index.cjs +1 -0
  9. package/dist/artifacts/svm/index.d.cts +9 -0
  10. package/dist/artifacts/svm/index.d.ts +9 -0
  11. package/dist/artifacts/svm/index.js +1 -0
  12. package/dist/container-provider-C59yqd5Z.d.ts +48 -0
  13. package/dist/container-provider-i614LDE1.d.cts +48 -0
  14. package/dist/evm-BLml33LX.d.cts +34 -0
  15. package/dist/evm-DTzqGlL6.d.ts +34 -0
  16. package/dist/file-sink-B73MuigK.d.cts +44 -0
  17. package/dist/file-sink-LS4hyXXi.d.ts +44 -0
  18. package/dist/index.cjs +1 -0
  19. package/dist/index.d.cts +194 -0
  20. package/dist/index.d.ts +194 -0
  21. package/dist/index.js +1 -0
  22. package/dist/index.node.cjs +1 -0
  23. package/dist/index.node.d.cts +6 -0
  24. package/dist/index.node.d.ts +6 -0
  25. package/dist/index.node.js +1 -0
  26. package/dist/node/index.cjs +1 -0
  27. package/dist/node/index.d.cts +7 -0
  28. package/dist/node/index.d.ts +7 -0
  29. package/dist/node/index.js +1 -0
  30. package/dist/svm-CCzqNAWM.d.cts +59 -0
  31. package/dist/svm-DieFbh9k.d.ts +59 -0
  32. package/dist/workspace-CamTHxso.d.cts +737 -0
  33. package/dist/workspace-CamTHxso.d.ts +737 -0
  34. package/package.json +85 -37
  35. package/tests/01-quick-start.test.cjs +37 -0
  36. package/tests/02-hd-account.test.cjs +71 -0
  37. package/tests/03-pk-account.test.cjs +59 -0
  38. package/tests/04-network-management.test.cjs +94 -0
  39. package/tests/05-asset-management.test.cjs +117 -0
  40. package/tests/06-address-signing.test.cjs +55 -0
  41. package/tests/07-custom-provider.test.cjs +164 -0
  42. package/tests/08-persistence.test.cjs +105 -0
  43. package/tests/09-workspace-filter.test.cjs +84 -0
  44. package/tests/10-default-network.test.cjs +70 -0
  45. package/tests/11-subpath-imports.test.cjs +21 -0
  46. package/tests/12-logger.test.cjs +44 -0
  47. package/tests/13-workspace-config.test.cjs +43 -0
  48. package/tests/14-esm-runtime.test.mjs +81 -0
  49. package/tests/15-package-resolution.test.cjs +76 -0
  50. package/tests/16-known-answer-vectors.test.cjs +141 -0
  51. package/tests/17-locked-state.test.cjs +162 -0
  52. package/tests/README.md +72 -0
  53. package/lib/account.d.ts +0 -69
  54. package/lib/index.d.ts +0 -6
  55. package/lib/index.esm.js +0 -1
  56. package/lib/index.umd.js +0 -1
  57. package/lib/mnemonic.d.ts +0 -3
  58. package/lib/utils.d.ts +0 -21
  59. package/src/account.ts +0 -749
  60. package/src/index.ts +0 -11
  61. package/src/mnemonic.ts +0 -2084
  62. package/src/utils.ts +0 -132
@@ -0,0 +1,59 @@
1
+ import { c as Address, F as SvmTxBuildParams, D as SvmTransaction } from './workspace-CamTHxso.cjs';
2
+
3
+ interface SvmInstruction {
4
+ readonly programId: string;
5
+ readonly accounts: ReadonlyArray<{
6
+ pubkey: string;
7
+ isSigner: boolean;
8
+ isWritable: boolean;
9
+ }>;
10
+ readonly data: Uint8Array;
11
+ }
12
+ declare const TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
13
+ declare const TOKEN_2022_PROGRAM_ID = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
14
+ declare const ASSOCIATED_TOKEN_PROGRAM_ID = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
15
+ declare const NATIVE_SOL_MINT = "So11111111111111111111111111111111111111112";
16
+ interface SplTokenArgs {
17
+ amount?: bigint | number;
18
+ decimals?: number;
19
+ mintAuthority?: string;
20
+ freezeAuthority?: string | null;
21
+ m?: number;
22
+ authorityType?: number;
23
+ newAuthority?: string | null;
24
+ }
25
+ interface SplTokenAccountSet {
26
+ source?: string;
27
+ destination?: string;
28
+ authority?: string;
29
+ mint?: string;
30
+ account?: string;
31
+ owner?: string;
32
+ delegate?: string;
33
+ mintAuthority?: string;
34
+ freezeAuthority?: string;
35
+ multisig?: string;
36
+ rent?: string;
37
+ signers?: ReadonlyArray<string>;
38
+ }
39
+
40
+ declare function splTokenEncodeInstruction(name: string, args: SplTokenArgs, accounts: SplTokenAccountSet, opts?: {
41
+ programId?: string;
42
+ }): SvmInstruction;
43
+
44
+ declare class Program {
45
+ readonly name: string;
46
+ readonly idl: unknown;
47
+ constructor(name: string, idl: unknown);
48
+ static load(name: string): Program | null;
49
+
50
+ encodeInstruction(instructionName: string, args: Readonly<Record<string, unknown>>, accounts: Readonly<Record<string, string>>): SvmInstruction;
51
+ decodeInstruction(_instructionName: string, _encoded: SvmInstruction): {
52
+ args: Readonly<Record<string, unknown>>;
53
+ accounts: Readonly<Record<string, string>>;
54
+ };
55
+
56
+ call(from: Address, instructionName: string, args: Readonly<Record<string, unknown>>, accounts: Readonly<Record<string, string>>, opts?: Partial<SvmTxBuildParams>): SvmTransaction;
57
+ }
58
+
59
+ export { ASSOCIATED_TOKEN_PROGRAM_ID as A, NATIVE_SOL_MINT as N, Program as P, type SvmInstruction as S, TOKEN_2022_PROGRAM_ID as T, TOKEN_PROGRAM_ID as a, splTokenEncodeInstruction as s };
@@ -0,0 +1,59 @@
1
+ import { c as Address, F as SvmTxBuildParams, D as SvmTransaction } from './workspace-CamTHxso.js';
2
+
3
+ interface SvmInstruction {
4
+ readonly programId: string;
5
+ readonly accounts: ReadonlyArray<{
6
+ pubkey: string;
7
+ isSigner: boolean;
8
+ isWritable: boolean;
9
+ }>;
10
+ readonly data: Uint8Array;
11
+ }
12
+ declare const TOKEN_PROGRAM_ID = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
13
+ declare const TOKEN_2022_PROGRAM_ID = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
14
+ declare const ASSOCIATED_TOKEN_PROGRAM_ID = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
15
+ declare const NATIVE_SOL_MINT = "So11111111111111111111111111111111111111112";
16
+ interface SplTokenArgs {
17
+ amount?: bigint | number;
18
+ decimals?: number;
19
+ mintAuthority?: string;
20
+ freezeAuthority?: string | null;
21
+ m?: number;
22
+ authorityType?: number;
23
+ newAuthority?: string | null;
24
+ }
25
+ interface SplTokenAccountSet {
26
+ source?: string;
27
+ destination?: string;
28
+ authority?: string;
29
+ mint?: string;
30
+ account?: string;
31
+ owner?: string;
32
+ delegate?: string;
33
+ mintAuthority?: string;
34
+ freezeAuthority?: string;
35
+ multisig?: string;
36
+ rent?: string;
37
+ signers?: ReadonlyArray<string>;
38
+ }
39
+
40
+ declare function splTokenEncodeInstruction(name: string, args: SplTokenArgs, accounts: SplTokenAccountSet, opts?: {
41
+ programId?: string;
42
+ }): SvmInstruction;
43
+
44
+ declare class Program {
45
+ readonly name: string;
46
+ readonly idl: unknown;
47
+ constructor(name: string, idl: unknown);
48
+ static load(name: string): Program | null;
49
+
50
+ encodeInstruction(instructionName: string, args: Readonly<Record<string, unknown>>, accounts: Readonly<Record<string, string>>): SvmInstruction;
51
+ decodeInstruction(_instructionName: string, _encoded: SvmInstruction): {
52
+ args: Readonly<Record<string, unknown>>;
53
+ accounts: Readonly<Record<string, string>>;
54
+ };
55
+
56
+ call(from: Address, instructionName: string, args: Readonly<Record<string, unknown>>, accounts: Readonly<Record<string, string>>, opts?: Partial<SvmTxBuildParams>): SvmTransaction;
57
+ }
58
+
59
+ export { ASSOCIATED_TOKEN_PROGRAM_ID as A, NATIVE_SOL_MINT as N, Program as P, type SvmInstruction as S, TOKEN_2022_PROGRAM_ID as T, TOKEN_PROGRAM_ID as a, splTokenEncodeInstruction as s };