@vapi-network/core 0.2.0-dev.2 → 0.2.1
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/dist/accounts.d.ts +40 -0
- package/dist/accounts.d.ts.map +1 -0
- package/dist/call-contracts-wire.d.ts +145 -95
- package/dist/call-contracts-wire.d.ts.map +1 -1
- package/dist/call-contracts.d.ts +10 -0
- package/dist/call-contracts.d.ts.map +1 -1
- package/dist/config.d.ts +11 -5
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7834 -1277
- package/dist/index.js.map +3 -3
- package/dist/keystore.d.ts +42 -38
- package/dist/keystore.d.ts.map +1 -1
- package/dist/marketplace-contracts.d.ts +230 -78
- package/dist/marketplace-contracts.d.ts.map +1 -1
- package/dist/networks.d.ts +30 -7
- package/dist/networks.d.ts.map +1 -1
- package/dist/onramp.d.ts +36 -0
- package/dist/onramp.d.ts.map +1 -0
- package/dist/receipts.d.ts +3 -3
- package/dist/receipts.d.ts.map +1 -1
- package/dist/siwx.d.ts +64 -0
- package/dist/siwx.d.ts.map +1 -0
- package/dist/stats.d.ts.map +1 -1
- package/dist/support-report.d.ts +49 -0
- package/dist/support-report.d.ts.map +1 -0
- package/dist/svm.d.ts +30 -0
- package/dist/svm.d.ts.map +1 -0
- package/dist/sweep.d.ts +5 -6
- package/dist/sweep.d.ts.map +1 -1
- package/dist/wallet.d.ts +4 -1
- package/dist/wallet.d.ts.map +1 -1
- package/dist/x402-networks.d.ts +14 -0
- package/dist/x402-networks.d.ts.map +1 -1
- package/dist/x402.d.ts +30 -2
- package/dist/x402.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/keystore.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { type KeyPairSigner } from "@solana/kit";
|
|
2
|
+
import { privateKeyToAccount } from "viem/accounts";
|
|
1
3
|
import { z } from "zod";
|
|
2
4
|
import type { Hex } from "viem";
|
|
3
|
-
declare const
|
|
5
|
+
declare const legacyKeystoreSchema: z.ZodObject<{
|
|
4
6
|
version: z.ZodLiteral<1>;
|
|
5
7
|
address: z.ZodString;
|
|
6
8
|
crypto: z.ZodObject<{
|
|
@@ -18,50 +20,52 @@ declare const keystoreSchema: z.ZodObject<{
|
|
|
18
20
|
}, z.core.$strip>;
|
|
19
21
|
}, z.core.$strip>;
|
|
20
22
|
}, z.core.$strip>;
|
|
23
|
+
declare const keystoreSchema: z.ZodObject<{
|
|
24
|
+
version: z.ZodLiteral<2>;
|
|
25
|
+
address: z.ZodString;
|
|
26
|
+
keys: z.ZodObject<{
|
|
27
|
+
evm: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"secp256k1">;
|
|
29
|
+
address: z.ZodString;
|
|
30
|
+
}, z.core.$strip>;
|
|
31
|
+
solana: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
type: z.ZodLiteral<"ed25519">;
|
|
33
|
+
address: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
crypto: z.ZodObject<{
|
|
37
|
+
cipher: z.ZodLiteral<"aes-256-gcm">;
|
|
38
|
+
ciphertext: z.ZodString;
|
|
39
|
+
iv: z.ZodString;
|
|
40
|
+
authTag: z.ZodString;
|
|
41
|
+
kdf: z.ZodLiteral<"scrypt">;
|
|
42
|
+
salt: z.ZodString;
|
|
43
|
+
kdfParams: z.ZodObject<{
|
|
44
|
+
n: z.ZodLiteral<number>;
|
|
45
|
+
r: z.ZodLiteral<8>;
|
|
46
|
+
p: z.ZodLiteral<1>;
|
|
47
|
+
dkLen: z.ZodLiteral<32>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
}, z.core.$strip>;
|
|
50
|
+
}, z.core.$strip>;
|
|
21
51
|
export type VapiKeystore = z.infer<typeof keystoreSchema>;
|
|
52
|
+
export type LegacyVapiKeystore = z.infer<typeof legacyKeystoreSchema>;
|
|
22
53
|
/** @deprecated Use VapiKeystore. */
|
|
23
54
|
export type AgentCashKeystore = VapiKeystore;
|
|
55
|
+
export type VapiPaymentAccount = ReturnType<typeof privateKeyToAccount> & {
|
|
56
|
+
readonly solana?: KeyPairSigner;
|
|
57
|
+
};
|
|
24
58
|
export declare class KeystoreError extends Error {
|
|
25
59
|
constructor(message: string, options?: ErrorOptions);
|
|
26
60
|
}
|
|
27
|
-
export declare function encryptPrivateKey(privateKey: Hex, passphrase: string): Promise<
|
|
61
|
+
export declare function encryptPrivateKey(privateKey: Hex, passphrase: string): Promise<VapiKeystore>;
|
|
28
62
|
export declare function decryptPrivateKey(keystore: VapiKeystore, passphrase: string): Promise<Hex>;
|
|
29
|
-
export declare function createKeystore(passphrase: string, path?: string
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
36
|
-
signMessage: ({ message }: {
|
|
37
|
-
message: import("viem").SignableMessage;
|
|
38
|
-
}) => Promise<Hex>;
|
|
39
|
-
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
40
|
-
serializer?: serializer | undefined;
|
|
41
|
-
} | undefined) => Promise<Hex>;
|
|
42
|
-
signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
43
|
-
publicKey: Hex;
|
|
44
|
-
source: "privateKey";
|
|
45
|
-
type: "local";
|
|
46
|
-
}>;
|
|
47
|
-
export declare function unlockKeystore(passphrase: string, path?: string): Promise<{
|
|
48
|
-
address: import("viem").Address;
|
|
49
|
-
nonceManager?: import("viem").NonceManager | undefined;
|
|
50
|
-
sign: (parameters: {
|
|
51
|
-
hash: import("viem").Hash;
|
|
52
|
-
}) => Promise<Hex>;
|
|
53
|
-
signAuthorization: (parameters: import("viem").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
54
|
-
signMessage: ({ message }: {
|
|
55
|
-
message: import("viem").SignableMessage;
|
|
56
|
-
}) => Promise<Hex>;
|
|
57
|
-
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
58
|
-
serializer?: serializer | undefined;
|
|
59
|
-
} | undefined) => Promise<Hex>;
|
|
60
|
-
signTypedData: <const typedData extends import("viem").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<Hex>;
|
|
61
|
-
publicKey: Hex;
|
|
62
|
-
source: "privateKey";
|
|
63
|
-
type: "local";
|
|
64
|
-
}>;
|
|
63
|
+
export declare function createKeystore(passphrase: string, path?: string, options?: {
|
|
64
|
+
enableSolana?: boolean;
|
|
65
|
+
}): Promise<VapiPaymentAccount>;
|
|
66
|
+
export declare function unlockKeystore(passphrase: string, path?: string): Promise<VapiPaymentAccount>;
|
|
67
|
+
/** Lazily adds a locally generated Ed25519 seed without replacing the EVM key. */
|
|
68
|
+
export declare function enableSolanaKey(passphrase: string, path?: string): Promise<VapiPaymentAccount>;
|
|
65
69
|
export declare function getKeystorePassphrase(options?: {
|
|
66
70
|
confirm?: boolean;
|
|
67
71
|
}): Promise<string>;
|
package/dist/keystore.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keystore.d.ts","sourceRoot":"","sources":["../src/keystore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"keystore.d.ts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