@vapi-network/core 0.2.2 → 0.3.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.
- package/README.md +18 -5
- package/dist/agent-guard.d.ts +40 -0
- package/dist/agent-guard.d.ts.map +1 -0
- package/dist/audit.d.ts +42 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/config.d.ts +40 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/hd.d.ts +33 -0
- package/dist/hd.d.ts.map +1 -0
- package/dist/index.d.ts +7 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23202 -419
- package/dist/index.js.map +3 -3
- package/dist/keystore.d.ts +117 -4
- package/dist/keystore.d.ts.map +1 -1
- package/dist/onramp.d.ts +12 -28
- package/dist/onramp.d.ts.map +1 -1
- package/dist/passphrase.d.ts +47 -0
- package/dist/passphrase.d.ts.map +1 -0
- package/dist/policy.d.ts +6 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/receipts.d.ts +22 -4
- package/dist/receipts.d.ts.map +1 -1
- package/dist/secret-store.d.ts +60 -0
- package/dist/secret-store.d.ts.map +1 -0
- package/dist/secrets.d.ts +14 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +47213 -0
- package/dist/secrets.js.map +6 -0
- package/dist/spend-policy.d.ts +13 -1
- package/dist/spend-policy.d.ts.map +1 -1
- package/dist/stats.d.ts +3 -2
- package/dist/stats.d.ts.map +1 -1
- package/dist/support-report.d.ts +1 -1
- package/dist/wallet-name.d.ts +18 -0
- package/dist/wallet-name.d.ts.map +1 -0
- package/dist/wallet-store.d.ts +195 -0
- package/dist/wallet-store.d.ts.map +1 -0
- package/dist/wallet.d.ts +0 -5
- package/dist/wallet.d.ts.map +1 -1
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@vapi-network/core`
|
|
2
2
|
|
|
3
|
-
The non-custodial
|
|
4
|
-
|
|
3
|
+
The non-custodial heart of [vAPI Network](https://github.com/vAPI-Network/vapi-network):
|
|
4
|
+
the x402 protocol, the wallet store, spend policy, the network guard, discovery
|
|
5
|
+
merge and the append-only receipt ledger. Keys stay on the caller's machine.
|
|
6
|
+
This package proxies no payment and sends no telemetry.
|
|
5
7
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
Two entry points:
|
|
9
|
+
|
|
10
|
+
- `@vapi-network/core` — everything an agent-driven surface may use: accounts,
|
|
11
|
+
balances, `WalletStore`, `SpendPolicy`, `resolvePassphrase`, receipts, stats
|
|
12
|
+
and the x402 primitives.
|
|
13
|
+
- `@vapi-network/core/secrets` — human-only. `exportRecoveryPhrase`,
|
|
14
|
+
`exportKeystoreKeys`, `createKeystoreWithPhrase` and `decryptPrivateKey`
|
|
15
|
+
return a recovery phrase or a private key, so they are deliberately not
|
|
16
|
+
re-exported from the main index and the MCP package is forbidden to import
|
|
17
|
+
them.
|
|
18
|
+
|
|
19
|
+
See the [root README](https://github.com/vAPI-Network/vapi-network#readme) for
|
|
20
|
+
the SDK examples, the configuration layout and the custody model.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether this run may put a secret on the screen.
|
|
3
|
+
*
|
|
4
|
+
* A recovery phrase, a private key and a passphrase are the only secrets vAPI
|
|
5
|
+
* has, and an agent never needs one to pay for an API. So they are shown only
|
|
6
|
+
* when a person is demonstrably present: stdin and stdout are both a real
|
|
7
|
+
* terminal, and no environment variable says an agent or a CI job is driving
|
|
8
|
+
* the command. Addresses, balances, receipts and wallet names are not secrets
|
|
9
|
+
* and are never gated here.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* The variables that mean "something other than a person is reading this".
|
|
13
|
+
* `VAPI_NO_SECRETS` is the documented way to lock down a machine's agent
|
|
14
|
+
* configuration; the rest are set by the agents and CI systems themselves.
|
|
15
|
+
*/
|
|
16
|
+
export declare const AGENT_MARKER_VARIABLES: readonly ["VAPI_NO_SECRETS", "CLAUDECODE", "CLAUDE_CODE", "CURSOR_AGENT", "CODEX_SANDBOX", "OPENAI_CODEX", "AGENT", "CI"];
|
|
17
|
+
export type AgentMarker = (typeof AGENT_MARKER_VARIABLES)[number];
|
|
18
|
+
/** Whether each standard stream is attached to a terminal. */
|
|
19
|
+
export type SecretsStreams = {
|
|
20
|
+
stdinIsTTY: boolean;
|
|
21
|
+
stdoutIsTTY: boolean;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* The verdict. `reason` is written to be shown to a person directly after the
|
|
25
|
+
* refusal line, so it names the stream or the variable that decided it.
|
|
26
|
+
*/
|
|
27
|
+
export type SecretsDecision = {
|
|
28
|
+
allowed: boolean;
|
|
29
|
+
reason?: string;
|
|
30
|
+
marker?: AgentMarker;
|
|
31
|
+
};
|
|
32
|
+
/** The first marker variable this environment sets to a non-empty value. */
|
|
33
|
+
export declare function activeAgentMarker(env: NodeJS.ProcessEnv): AgentMarker | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* Decides whether a secret may be printed. Both streams must be a terminal,
|
|
36
|
+
* because a redirected stdout writes the secret into a file and a piped stdin
|
|
37
|
+
* means the answers are scripted; then no agent marker may be set.
|
|
38
|
+
*/
|
|
39
|
+
export declare function secretsAllowed(env: NodeJS.ProcessEnv, streams: SecretsStreams): SecretsDecision;
|
|
40
|
+
//# sourceMappingURL=agent-guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-guard.d.ts","sourceRoot":"","sources":["../src/agent-guard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,2HASzB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAElE,8DAA8D;AAC9D,MAAM,MAAM,cAAc,GAAG;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,WAAW,GAAG,SAAS,CAEjF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,cAAc,GAAG,eAAe,CAY/F"}
|
package/dist/audit.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The local trail of everything that touched a key or a wallet: one JSON line
|
|
3
|
+
* per event in `<home>/audit.log`, mode 0600. It exists so a person can answer
|
|
4
|
+
* "did anything export my phrase while the agent was running" without trusting
|
|
5
|
+
* the agent's own account of it.
|
|
6
|
+
*
|
|
7
|
+
* A line never contains a secret. It records what happened, to which wallet,
|
|
8
|
+
* whether a terminal was attached, and which agent marker was set — nothing
|
|
9
|
+
* that could help someone spend the wallet.
|
|
10
|
+
*/
|
|
11
|
+
export declare const AUDIT_EVENTS: readonly ["secret.export.phrase", "secret.export.key", "wallet.create", "wallet.import", "wallet.remove", "wallet.restore", "wallet.rename", "wallet.default", "wallet.caps", "wallet.unlock", "wallet.lock", "wallet.use.session", "passphrase.change"];
|
|
12
|
+
export type AuditEvent = (typeof AUDIT_EVENTS)[number];
|
|
13
|
+
export type AuditRecord = {
|
|
14
|
+
event: AuditEvent;
|
|
15
|
+
/** The wallet the event acted on, when one was selected. */
|
|
16
|
+
wallet?: string;
|
|
17
|
+
/** Whether a real terminal was attached when the event happened. */
|
|
18
|
+
tty: boolean;
|
|
19
|
+
/** The agent or CI variable that was set, if any. */
|
|
20
|
+
agentMarker?: string;
|
|
21
|
+
/** A short human note, such as a refusal or a new name. Never a secret. */
|
|
22
|
+
detail?: string;
|
|
23
|
+
};
|
|
24
|
+
export type AuditEntry = AuditRecord & {
|
|
25
|
+
time: string;
|
|
26
|
+
};
|
|
27
|
+
export declare const AUDIT_FILE = "audit.log";
|
|
28
|
+
export type AuditOptions = {
|
|
29
|
+
/** Injected clock, so tests get a fixed timestamp. */
|
|
30
|
+
now?: () => Date;
|
|
31
|
+
};
|
|
32
|
+
export declare function auditLogPath(home: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Appends one line. Append-only from the client's point of view: nothing in
|
|
35
|
+
* vAPI ever rewrites or truncates this file, and a failure to write it must
|
|
36
|
+
* never be swallowed by the caller, since a missing line is the interesting
|
|
37
|
+
* case.
|
|
38
|
+
*/
|
|
39
|
+
export declare function appendAudit(home: string, record: AuditRecord, options?: AuditOptions): Promise<AuditEntry>;
|
|
40
|
+
/** The lines written so far, oldest first. An absent log reads as empty. */
|
|
41
|
+
export declare function readAuditLog(home: string): Promise<AuditEntry[]>;
|
|
42
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAKA;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,0PAkBf,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,UAAU,CAAC;IAClB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oEAAoE;IACpE,GAAG,EAAE,OAAO,CAAC;IACb,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExD,eAAO,MAAM,UAAU,cAAc,CAAC;AAEtC,MAAM,MAAM,YAAY,GAAG;IACzB,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,EACnB,OAAO,GAAE,YAAiB,GACzB,OAAO,CAAC,UAAU,CAAC,CAerB;AAED,4EAA4E;AAC5E,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAYtE"}
|
package/dist/config.d.ts
CHANGED
|
@@ -3,9 +3,17 @@ export declare const DEFAULT_REGISTRY_URL = "https://api.vapinetwork.ai";
|
|
|
3
3
|
export declare const DEFAULT_DISCOVERY_URL = "https://api.vapinetwork.ai/api/call/services";
|
|
4
4
|
export declare const DEFAULT_MARKETPLACE_DISCOVERY_URL = "https://api.vapinetwork.ai/api/call/discovery";
|
|
5
5
|
export declare const DEFAULT_REGISTRY_FALLBACKS: readonly [{
|
|
6
|
-
readonly discoveryUrl: "https://
|
|
7
|
-
readonly marketplaceDiscoveryUrl: "https://
|
|
6
|
+
readonly discoveryUrl: "https://api.vapinetwork.ai/api/call/services";
|
|
7
|
+
readonly marketplaceDiscoveryUrl: "https://api.vapinetwork.ai/api/call/discovery";
|
|
8
8
|
}];
|
|
9
|
+
/**
|
|
10
|
+
* The caps a wallet starts with. Since 0.3.0 the caps that are enforced belong
|
|
11
|
+
* to the wallet entry in `wallets.json`, not to `config.json`: an agent wallet
|
|
12
|
+
* can have a small daily cap while the owner's has a large one. `spendCaps`
|
|
13
|
+
* stays in `config.json` so 0.2.x files keep parsing, and it is still the
|
|
14
|
+
* fallback for a home that has no wallet registry yet — see
|
|
15
|
+
* `spendCapsForWallet` in `wallet-store.ts`.
|
|
16
|
+
*/
|
|
9
17
|
export declare const DEFAULT_SPEND_CAPS: {
|
|
10
18
|
readonly perCallAtomic: "100000";
|
|
11
19
|
readonly perDayAtomic: "1000000";
|
|
@@ -65,11 +73,40 @@ export type MigrationOptions = {
|
|
|
65
73
|
* either side. Returns the copied destination paths.
|
|
66
74
|
*/
|
|
67
75
|
export declare function migrateLegacyVapiHome(options?: MigrationOptions): Promise<string[]>;
|
|
76
|
+
export type LegacyRegistryRewrite = {
|
|
77
|
+
field: string;
|
|
78
|
+
from: string;
|
|
79
|
+
to: string;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Rewrites one retired registry URL to its canonical form. Anything that is not
|
|
83
|
+
* a legacy vAPI registry URL — including self-hosted registries on the old
|
|
84
|
+
* paths — is returned byte for byte, so this is safe to run over any config.
|
|
85
|
+
*/
|
|
86
|
+
export declare function rewriteLegacyRegistryUrl(value: string): string;
|
|
87
|
+
/**
|
|
88
|
+
* Pure counterpart of {@link rewriteLegacyRegistryUrl} over a whole config. The
|
|
89
|
+
* input is never mutated, and an untouched config is returned as-is.
|
|
90
|
+
*/
|
|
91
|
+
export declare function rewriteLegacyRegistryUrls(config: VapiConfig): {
|
|
92
|
+
config: VapiConfig;
|
|
93
|
+
changes: LegacyRegistryRewrite[];
|
|
94
|
+
};
|
|
95
|
+
export declare function formatLegacyRegistryRewrites(changes: readonly LegacyRegistryRewrite[]): string;
|
|
96
|
+
/**
|
|
97
|
+
* Rewrites retired registry URLs in `config.json` on disk. Returns what changed
|
|
98
|
+
* so the caller can report it; an absent or already-current file is a no-op.
|
|
99
|
+
*/
|
|
100
|
+
export declare function migrateLegacyRegistryConfig(path?: string): Promise<LegacyRegistryRewrite[]>;
|
|
68
101
|
export type DefaultConfigOptions = {
|
|
69
102
|
networks?: readonly string[];
|
|
70
103
|
};
|
|
71
104
|
export declare function getDefaultConfig(source?: NodeJS.ProcessEnv, options?: DefaultConfigOptions): VapiConfig;
|
|
72
|
-
export
|
|
105
|
+
export type LoadConfigOptions = {
|
|
106
|
+
/** Sink for the one-line legacy-URL notice; omitted means stay silent. */
|
|
107
|
+
notice?: (message: string) => void;
|
|
108
|
+
};
|
|
109
|
+
export declare function loadConfig(path?: string, source?: NodeJS.ProcessEnv, options?: LoadConfigOptions): Promise<VapiConfig>;
|
|
73
110
|
export declare function writeDefaultConfig(path?: string, source?: NodeJS.ProcessEnv, options?: DefaultConfigOptions): Promise<VapiConfig>;
|
|
74
111
|
export declare function enableDefaultNetwork(network: "solana", path?: string, source?: NodeJS.ProcessEnv): Promise<VapiConfig>;
|
|
75
112
|
export declare function isMissingFile(error: unknown): error is NodeJS.ErrnoException;
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,eAAO,MAAM,qBAAqB,iDAA8C,CAAC;AACjF,eAAO,MAAM,iCAAiC,kDAA+C,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAYxB,eAAO,MAAM,oBAAoB,+BAA+B,CAAC;AACjE,eAAO,MAAM,qBAAqB,iDAA8C,CAAC;AACjF,eAAO,MAAM,iCAAiC,kDAA+C,CAAC;AAI9F,eAAO,MAAM,0BAA0B;;;EAK7B,CAAC;AAEX;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB;;;CAGrB,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,M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
+
export declare const EVM_DERIVATION_PATH = "m/44'/60'/0'/0/0";
|
|
4
|
+
/** SLIP-0010 ed25519 path Phantom and Solflare use for the first account. */
|
|
5
|
+
export declare const SOLANA_DERIVATION_PATH = "m/44'/501'/0'/0'";
|
|
6
|
+
/** A fresh 12-word English BIP-39 phrase. The only place new wallets start. */
|
|
7
|
+
export declare function generateRecoveryPhrase(): string;
|
|
8
|
+
/**
|
|
9
|
+
* Normalises spacing and case, then checks the BIP-39 checksum. Returns the
|
|
10
|
+
* canonical phrase so callers store and derive from one spelling. The phrase
|
|
11
|
+
* itself never appears in the error.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateRecoveryPhrase(phrase: string): string;
|
|
14
|
+
/** The 64-byte BIP-39 seed, with an empty BIP-39 passphrase. */
|
|
15
|
+
export declare function phraseToSeed(phrase: string): Uint8Array;
|
|
16
|
+
/** The BIP-39 entropy behind a phrase: 16 bytes for 12 words, 32 for 24. */
|
|
17
|
+
export declare function phraseToEntropy(phrase: string): Uint8Array;
|
|
18
|
+
/** The phrase that produced this entropy, so a wallet can be shown again. */
|
|
19
|
+
export declare function entropyToPhrase(entropy: Uint8Array): string;
|
|
20
|
+
/** secp256k1 key for the EVM account, BIP-32 over the BIP-39 seed. */
|
|
21
|
+
export declare function deriveEvmPrivateKey(seed: Uint8Array, path?: string): Hex;
|
|
22
|
+
/** 32-byte ed25519 seed for the Solana account, SLIP-0010 over the BIP-39 seed. */
|
|
23
|
+
export declare function deriveSolanaPrivateKey(seed: Uint8Array, path?: string): Uint8Array;
|
|
24
|
+
/**
|
|
25
|
+
* SLIP-0010 for the ed25519 curve: HMAC-SHA512 from the master key
|
|
26
|
+
* "ed25519 seed", hardened children only. Returns the chain code as well so the
|
|
27
|
+
* specification's test vectors can check every step.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deriveEd25519Path(seed: Uint8Array, path: string): {
|
|
30
|
+
privateKey: Uint8Array;
|
|
31
|
+
chainCode: Uint8Array;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=hd.d.ts.map
|
package/dist/hd.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hd.d.ts","sourceRoot":"","sources":["../src/hd.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAIhC,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,qBAAqB,CAAC;AAMzD,+EAA+E;AAC/E,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAc7D;AAED,gEAAgE;AAChE,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAEvD;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAE1D;AAED,6EAA6E;AAC7E,wBAAgB,eAAe,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAE3D;AAED,sEAAsE;AACtE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,SAAsB,GAAG,GAAG,CAOrF;AAED,mFAAmF;AACnF,wBAAgB,sBAAsB,CACpC,IAAI,EAAE,UAAU,EAChB,IAAI,SAAyB,GAC5B,UAAU,CAEZ;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,GACX;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,SAAS,EAAE,UAAU,CAAA;CAAE,CAoBnD"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
export * from "./call-contracts.js";
|
|
2
2
|
export * from "./call-contracts-wire.js";
|
|
3
3
|
export * from "./accounts.js";
|
|
4
|
+
export * from "./agent-guard.js";
|
|
5
|
+
export * from "./audit.js";
|
|
4
6
|
export * from "./config.js";
|
|
5
7
|
export * from "./discovery.js";
|
|
6
|
-
export
|
|
8
|
+
export { deriveEvmPrivateKey, deriveSolanaPrivateKey, entropyToPhrase, EVM_DERIVATION_PATH, generateRecoveryPhrase, phraseToEntropy, phraseToSeed, SOLANA_DERIVATION_PATH, validateRecoveryPhrase, } from "./hd.js";
|
|
9
|
+
export { changeKeystorePassphrase, createKeystore, createKeystoreFromPrivateKey, enableSolanaKey, encryptPrivateKey, getKeystorePassphrase, KeystoreError, promptForSecret, readKeystoreAddress, readKeystoreVersion, unlockKeystore, validatePrivateKey, type AgentCashKeystore, type CreateKeystoreOptions, type LegacyVapiKeystore, type VapiKeystore, type VapiKeystoreV3, type VapiPaymentAccount, } from "./keystore.js";
|
|
7
10
|
export * from "./marketplace-contracts.js";
|
|
8
11
|
export * from "./net-guard.js";
|
|
9
12
|
export * from "./networks.js";
|
|
10
13
|
export * from "./onramp.js";
|
|
14
|
+
export * from "./passphrase.js";
|
|
11
15
|
export * from "./policy.js";
|
|
12
16
|
export * from "./receipts.js";
|
|
13
17
|
export * from "./searches.js";
|
|
18
|
+
export * from "./secret-store.js";
|
|
14
19
|
export * from "./stats.js";
|
|
15
20
|
export * from "./spend-policy.js";
|
|
16
21
|
export * from "./support-report.js";
|
|
@@ -18,6 +23,7 @@ export * from "./sweep.js";
|
|
|
18
23
|
export * from "./siwx.js";
|
|
19
24
|
export * from "./svm.js";
|
|
20
25
|
export * from "./wallet.js";
|
|
26
|
+
export * from "./wallet-store.js";
|
|
21
27
|
export * from "./x402.js";
|
|
22
28
|
export { BROWSER_ENABLED_X402_NETWORK_CONFIG, CANONICAL_X402_USDC_NETWORKS, getCanonicalX402Usdc, type CanonicalX402UsdcIdentity, type CanonicalX402UsdcNetwork, type X402NetworkConfig, type X402TokenDomain, } from "./x402-networks.js";
|
|
23
29
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EACL,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,sBAAsB,EACtB,eAAe,EACf,YAAY,EACZ,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,SAAS,CAAC;AAIjB,OAAO,EACL,wBAAwB,EACxB,cAAc,EACd,4BAA4B,EAC5B,eAAe,EACf,iBAAiB,EACjB,qBAAqB,EACrB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,kBAAkB,EAClB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAA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