@veilo/sdk-core 0.5.0 → 0.6.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 +237 -19
- package/accounts.d.ts +2 -0
- package/accounts.js +3 -0
- package/cloak.d.ts +2 -0
- package/cloak.js +3 -0
- package/config.d.ts +2 -0
- package/config.js +3 -0
- package/dist/cjs/events/index.d.ts +6 -0
- package/dist/cjs/events/index.js +22 -0
- package/dist/cjs/events/parsing.d.ts +25 -0
- package/dist/cjs/events/parsing.js +158 -0
- package/dist/cjs/events/position.d.ts +26 -0
- package/dist/cjs/events/position.js +53 -0
- package/dist/cjs/events/recovery.d.ts +87 -0
- package/dist/cjs/events/recovery.js +281 -0
- package/dist/cjs/events/scanning.d.ts +35 -0
- package/dist/cjs/events/scanning.js +98 -0
- package/dist/cjs/events/tree.d.ts +27 -0
- package/dist/cjs/events/tree.js +63 -0
- package/dist/cjs/events/types.d.ts +39 -0
- package/dist/cjs/events/types.js +2 -0
- package/dist/cjs/events.d.ts +1 -77
- package/dist/cjs/events.js +6 -154
- package/dist/cjs/identity/encoding.d.ts +9 -0
- package/dist/cjs/identity/encoding.js +85 -0
- package/dist/cjs/identity/index.d.ts +4 -0
- package/dist/cjs/identity/index.js +20 -0
- package/dist/cjs/identity/noteKey.d.ts +33 -0
- package/dist/cjs/identity/noteKey.js +97 -0
- package/dist/cjs/identity/spending.d.ts +18 -0
- package/dist/cjs/identity/spending.js +46 -0
- package/dist/cjs/identity/viewKey.d.ts +38 -0
- package/dist/cjs/identity/viewKey.js +105 -0
- package/dist/cjs/idl/index.d.ts +18 -0
- package/dist/cjs/idl/index.js +24 -0
- package/dist/cjs/idl/privacy_pool.json +9907 -9907
- package/dist/cjs/idl/privacy_pool_legacy.d.ts +5 -0
- package/dist/cjs/idl/privacy_pool_legacy.js +3307 -0
- package/dist/cjs/idl/privacy_pool_legacy.json +2302 -0
- package/dist/cjs/idl/privacy_pool_legacy2.d.ts +5 -0
- package/dist/cjs/idl/privacy_pool_legacy2.js +3397 -0
- package/dist/cjs/idl/privacy_pool_legacy2.json +2376 -0
- package/dist/cjs/index.d.ts +8 -3
- package/dist/cjs/index.js +12 -2
- package/dist/cjs/notes/amount.d.ts +2 -0
- package/dist/cjs/notes/amount.js +21 -0
- package/dist/cjs/notes/index.d.ts +3 -0
- package/dist/cjs/notes/index.js +3 -0
- package/dist/cjs/notes/recovery.d.ts +16 -6
- package/dist/cjs/notes/recovery.js +33 -16
- package/dist/cjs/notes/selection.d.ts +77 -0
- package/dist/cjs/notes/selection.js +193 -0
- package/dist/cjs/notes/spent.d.ts +60 -0
- package/dist/cjs/notes/spent.js +101 -0
- package/dist/cjs/perps/constants.d.ts +16 -0
- package/dist/cjs/perps/constants.js +52 -0
- package/dist/cjs/perps/index.d.ts +5 -0
- package/dist/cjs/perps/index.js +21 -0
- package/dist/cjs/perps/keys.d.ts +16 -0
- package/dist/cjs/perps/keys.js +43 -0
- package/dist/cjs/perps/pdas.d.ts +29 -0
- package/dist/cjs/perps/pdas.js +55 -0
- package/dist/cjs/perps/relayer.d.ts +9 -0
- package/dist/cjs/perps/relayer.js +35 -0
- package/dist/cjs/perps/types.d.ts +126 -0
- package/dist/cjs/perps/types.js +2 -0
- package/dist/cjs/positions/index.d.ts +4 -0
- package/dist/cjs/positions/index.js +20 -0
- package/dist/cjs/positions/keys.d.ts +29 -0
- package/dist/cjs/positions/keys.js +71 -0
- package/dist/cjs/positions/pdas.d.ts +15 -0
- package/dist/cjs/positions/pdas.js +54 -0
- package/dist/cjs/positions/relayer.d.ts +4 -0
- package/dist/cjs/positions/relayer.js +15 -0
- package/dist/cjs/positions/types.d.ts +97 -0
- package/dist/cjs/positions/types.js +2 -0
- package/dist/cjs/predictions/client.d.ts +41 -0
- package/dist/cjs/predictions/client.js +147 -0
- package/dist/cjs/predictions/index.d.ts +5 -0
- package/dist/cjs/predictions/index.js +21 -0
- package/dist/cjs/predictions/keys.d.ts +14 -0
- package/dist/cjs/predictions/keys.js +40 -0
- package/dist/cjs/predictions/pdas.d.ts +6 -0
- package/dist/cjs/predictions/pdas.js +13 -0
- package/dist/cjs/predictions/relayer.d.ts +3 -0
- package/dist/cjs/predictions/relayer.js +11 -0
- package/dist/cjs/predictions/types.d.ts +178 -0
- package/dist/cjs/predictions/types.js +2 -0
- package/dist/cjs/program.d.ts +2 -0
- package/dist/cjs/program.js +8 -7
- package/dist/cjs/prover.d.ts +27 -4
- package/dist/cjs/prover.js +107 -48
- package/dist/cjs/relayer/api.d.ts +31 -0
- package/dist/cjs/relayer/api.js +86 -0
- package/dist/cjs/relayer/client.d.ts +29 -17
- package/dist/cjs/relayer/client.js +72 -17
- package/dist/cjs/relayer/errors.d.ts +1 -1
- package/dist/cjs/relayer/errors.js +1 -1
- package/dist/cjs/relayer/index.d.ts +4 -1
- package/dist/cjs/relayer/index.js +1 -1
- package/dist/cjs/relayer/internal-config.d.ts +36 -0
- package/dist/cjs/relayer/internal-config.js +9 -0
- package/dist/cjs/relayer/internal.d.ts +6 -0
- package/dist/cjs/relayer/internal.js +14 -0
- package/dist/cjs/relayer/transport.d.ts +4 -2
- package/dist/cjs/relayer/transport.js +10 -5
- package/dist/cjs/relayer/types.d.ts +9 -10
- package/dist/cjs/relayer/types.js +1 -1
- package/dist/cjs/shield/owner.js +1 -4
- package/dist/esm/events/index.d.ts +6 -0
- package/dist/esm/events/index.js +6 -0
- package/dist/esm/events/parsing.d.ts +25 -0
- package/dist/esm/events/parsing.js +120 -0
- package/dist/esm/events/position.d.ts +26 -0
- package/dist/esm/events/position.js +48 -0
- package/dist/esm/events/recovery.d.ts +87 -0
- package/dist/esm/events/recovery.js +237 -0
- package/dist/esm/events/scanning.d.ts +35 -0
- package/dist/esm/events/scanning.js +92 -0
- package/dist/esm/events/tree.d.ts +27 -0
- package/dist/esm/events/tree.js +58 -0
- package/dist/esm/events/types.d.ts +39 -0
- package/dist/esm/events/types.js +1 -0
- package/dist/esm/events.d.ts +1 -77
- package/dist/esm/events.js +3 -129
- package/dist/esm/identity/encoding.d.ts +9 -0
- package/dist/esm/identity/encoding.js +75 -0
- package/dist/esm/identity/index.d.ts +4 -0
- package/dist/esm/identity/index.js +4 -0
- package/dist/esm/identity/noteKey.d.ts +33 -0
- package/dist/esm/identity/noteKey.js +91 -0
- package/dist/esm/identity/spending.d.ts +18 -0
- package/dist/esm/identity/spending.js +35 -0
- package/dist/esm/identity/viewKey.d.ts +38 -0
- package/dist/esm/identity/viewKey.js +96 -0
- package/dist/esm/idl/index.d.ts +18 -0
- package/dist/esm/idl/index.js +18 -0
- package/dist/esm/idl/privacy_pool.json +9907 -9907
- package/dist/esm/idl/privacy_pool_legacy.d.ts +5 -0
- package/dist/esm/idl/privacy_pool_legacy.js +3305 -0
- package/dist/esm/idl/privacy_pool_legacy.json +2302 -0
- package/dist/esm/idl/privacy_pool_legacy2.d.ts +5 -0
- package/dist/esm/idl/privacy_pool_legacy2.js +3395 -0
- package/dist/esm/idl/privacy_pool_legacy2.json +2376 -0
- package/dist/esm/index.d.ts +8 -3
- package/dist/esm/index.js +8 -3
- package/dist/esm/notes/amount.d.ts +2 -0
- package/dist/esm/notes/amount.js +18 -0
- package/dist/esm/notes/index.d.ts +3 -0
- package/dist/esm/notes/index.js +3 -0
- package/dist/esm/notes/recovery.d.ts +16 -6
- package/dist/esm/notes/recovery.js +33 -16
- package/dist/esm/notes/selection.d.ts +77 -0
- package/dist/esm/notes/selection.js +188 -0
- package/dist/esm/notes/spent.d.ts +60 -0
- package/dist/esm/notes/spent.js +96 -0
- package/dist/esm/perps/constants.d.ts +16 -0
- package/dist/esm/perps/constants.js +48 -0
- package/dist/esm/perps/index.d.ts +5 -0
- package/dist/esm/perps/index.js +5 -0
- package/dist/esm/perps/keys.d.ts +16 -0
- package/dist/esm/perps/keys.js +35 -0
- package/dist/esm/perps/pdas.d.ts +29 -0
- package/dist/esm/perps/pdas.js +47 -0
- package/dist/esm/perps/relayer.d.ts +9 -0
- package/dist/esm/perps/relayer.js +25 -0
- package/dist/esm/perps/types.d.ts +126 -0
- package/dist/esm/perps/types.js +1 -0
- package/dist/esm/positions/index.d.ts +4 -0
- package/dist/esm/positions/index.js +4 -0
- package/dist/esm/positions/keys.d.ts +29 -0
- package/dist/esm/positions/keys.js +65 -0
- package/dist/esm/positions/pdas.d.ts +15 -0
- package/dist/esm/positions/pdas.js +44 -0
- package/dist/esm/positions/relayer.d.ts +4 -0
- package/dist/esm/positions/relayer.js +10 -0
- package/dist/esm/positions/types.d.ts +97 -0
- package/dist/esm/positions/types.js +1 -0
- package/dist/esm/predictions/client.d.ts +41 -0
- package/dist/esm/predictions/client.js +141 -0
- package/dist/esm/predictions/index.d.ts +5 -0
- package/dist/esm/predictions/index.js +5 -0
- package/dist/esm/predictions/keys.d.ts +14 -0
- package/dist/esm/predictions/keys.js +33 -0
- package/dist/esm/predictions/pdas.d.ts +6 -0
- package/dist/esm/predictions/pdas.js +10 -0
- package/dist/esm/predictions/relayer.d.ts +3 -0
- package/dist/esm/predictions/relayer.js +7 -0
- package/dist/esm/predictions/types.d.ts +178 -0
- package/dist/esm/predictions/types.js +1 -0
- package/dist/esm/program.d.ts +2 -0
- package/dist/esm/program.js +4 -3
- package/dist/esm/prover.d.ts +27 -4
- package/dist/esm/prover.js +106 -15
- package/dist/esm/relayer/api.d.ts +31 -0
- package/dist/esm/relayer/api.js +55 -0
- package/dist/esm/relayer/client.d.ts +29 -17
- package/dist/esm/relayer/client.js +72 -17
- package/dist/esm/relayer/errors.d.ts +1 -1
- package/dist/esm/relayer/errors.js +1 -1
- package/dist/esm/relayer/index.d.ts +4 -1
- package/dist/esm/relayer/index.js +1 -1
- package/dist/esm/relayer/internal-config.d.ts +36 -0
- package/dist/esm/relayer/internal-config.js +6 -0
- package/dist/esm/relayer/internal.d.ts +6 -0
- package/dist/esm/relayer/internal.js +10 -0
- package/dist/esm/relayer/transport.d.ts +4 -2
- package/dist/esm/relayer/transport.js +10 -5
- package/dist/esm/relayer/types.d.ts +9 -10
- package/dist/esm/relayer/types.js +1 -1
- package/dist/esm/shield/owner.js +1 -4
- package/identity.d.ts +2 -0
- package/identity.js +3 -0
- package/idl.d.ts +2 -0
- package/idl.js +3 -0
- package/notes.d.ts +2 -0
- package/notes.js +3 -0
- package/package.json +85 -3
- package/perps.d.ts +2 -0
- package/perps.js +3 -0
- package/poseidon.d.ts +2 -0
- package/poseidon.js +3 -0
- package/positions.d.ts +2 -0
- package/positions.js +3 -0
- package/predictions.d.ts +2 -0
- package/predictions.js +3 -0
- package/proof.d.ts +2 -0
- package/proof.js +3 -0
- package/prover.d.ts +2 -0
- package/prover.js +3 -0
- package/relayer.d.ts +2 -0
- package/relayer.js +3 -0
- package/shield.d.ts +2 -0
- package/shield.js +3 -0
- package/transactions.d.ts +2 -0
- package/transactions.js +3 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CheckNullifiersResponse, ChallengeResponse, CheckUsernameResponse, DeleteUserDataResponse, MerkleRootResponse, MerkleTreeResponse, PreRegisterKeyResponse, PrivateSwapRequest, PrivateSwapResponse, PrivateTransferRequest, PrivateTransferResponse, QueryNotesRequest, QueryNotesResponse, RegisterRequest, RegisterResponse, RestoreRequest, RestoreResponse, SaveEncryptedNoteRequest, SaveEncryptedNoteResponse, VeiloPublicKeyResponse, WithdrawRequest, WithdrawResponse } from "./types.js";
|
|
2
|
+
/** Request a wallet-authentication challenge from Veilo. */
|
|
3
|
+
export declare function getChallenge(walletPublicKey: string): Promise<ChallengeResponse>;
|
|
4
|
+
/** Register a Veilo account and receive its auth token. */
|
|
5
|
+
export declare function register(data: RegisterRequest): Promise<RegisterResponse>;
|
|
6
|
+
/** Restore a Veilo account and receive its auth token. */
|
|
7
|
+
export declare function restore(data: RestoreRequest): Promise<RestoreResponse>;
|
|
8
|
+
export declare function checkUsername(username: string): Promise<CheckUsernameResponse>;
|
|
9
|
+
export declare function getVeiloPublicKey(params: {
|
|
10
|
+
username: string;
|
|
11
|
+
publicKey?: never;
|
|
12
|
+
} | {
|
|
13
|
+
publicKey: string;
|
|
14
|
+
username?: never;
|
|
15
|
+
}): Promise<VeiloPublicKeyResponse>;
|
|
16
|
+
export declare function preRegisterKey(solanaAddress: string): Promise<PreRegisterKeyResponse>;
|
|
17
|
+
export declare function saveEncryptedNote(data: SaveEncryptedNoteRequest): Promise<SaveEncryptedNoteResponse>;
|
|
18
|
+
/** Query notes with an explicit per-call token; no auth state is shared. */
|
|
19
|
+
export declare function queryEncryptedNotes(authToken: string, params?: QueryNotesRequest): Promise<QueryNotesResponse>;
|
|
20
|
+
/** Delete the authenticated user's stored data without retaining their token. */
|
|
21
|
+
export declare function deleteUserData(authToken: string): Promise<DeleteUserDataResponse>;
|
|
22
|
+
/** Raw check-batch call. Prefer `checkNullifiersSpent`, which chunks for you. */
|
|
23
|
+
export declare function checkNullifiers(nullifiers: string[]): Promise<CheckNullifiersResponse>;
|
|
24
|
+
export declare function getMerkleRoot(mintAddress?: string, treeId?: number): Promise<MerkleRootResponse>;
|
|
25
|
+
export declare function getMerkleTree(mintAddress?: string, treeId?: number): Promise<MerkleTreeResponse>;
|
|
26
|
+
export declare function submitWithdraw(data: WithdrawRequest): Promise<WithdrawResponse>;
|
|
27
|
+
export declare function submitPrivateTransfer(data: PrivateTransferRequest): Promise<PrivateTransferResponse>;
|
|
28
|
+
export declare function submitPrivateSwap(data: PrivateSwapRequest): Promise<PrivateSwapResponse>;
|
|
29
|
+
export { submitClosePosition, submitMergePositions, submitOpenPosition, } from "../positions/relayer.js";
|
|
30
|
+
export { submitJperpCancelTrigger, submitJperpClose, submitJperpOpen, submitJperpRecoverNative, submitJperpRecoverSeed, submitJperpReissue, submitJperpSetTpsl, submitJperpUpdateTpsl, } from "../perps/relayer.js";
|
|
31
|
+
export { submitPredictionOpen, submitPredictionReissue, } from "../predictions/relayer.js";
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createInternalRelayerClient, getInternalRelayerClient, } from "./internal.js";
|
|
2
|
+
/** Request a wallet-authentication challenge from Veilo. */
|
|
3
|
+
export function getChallenge(walletPublicKey) {
|
|
4
|
+
return getInternalRelayerClient().getChallenge(walletPublicKey);
|
|
5
|
+
}
|
|
6
|
+
/** Register a Veilo account and receive its auth token. */
|
|
7
|
+
export function register(data) {
|
|
8
|
+
return getInternalRelayerClient().register(data);
|
|
9
|
+
}
|
|
10
|
+
/** Restore a Veilo account and receive its auth token. */
|
|
11
|
+
export function restore(data) {
|
|
12
|
+
return getInternalRelayerClient().restore(data);
|
|
13
|
+
}
|
|
14
|
+
export function checkUsername(username) {
|
|
15
|
+
return getInternalRelayerClient().checkUsername(username);
|
|
16
|
+
}
|
|
17
|
+
export function getVeiloPublicKey(params) {
|
|
18
|
+
return getInternalRelayerClient().getVeiloPublicKey(params);
|
|
19
|
+
}
|
|
20
|
+
export function preRegisterKey(solanaAddress) {
|
|
21
|
+
return getInternalRelayerClient().preRegisterKey(solanaAddress);
|
|
22
|
+
}
|
|
23
|
+
export function saveEncryptedNote(data) {
|
|
24
|
+
return getInternalRelayerClient().saveEncryptedNote(data);
|
|
25
|
+
}
|
|
26
|
+
/** Query notes with an explicit per-call token; no auth state is shared. */
|
|
27
|
+
export function queryEncryptedNotes(authToken, params = {}) {
|
|
28
|
+
return createInternalRelayerClient({ authToken }).queryEncryptedNotes(params);
|
|
29
|
+
}
|
|
30
|
+
/** Delete the authenticated user's stored data without retaining their token. */
|
|
31
|
+
export function deleteUserData(authToken) {
|
|
32
|
+
return createInternalRelayerClient({ authToken }).deleteUserData();
|
|
33
|
+
}
|
|
34
|
+
/** Raw check-batch call. Prefer `checkNullifiersSpent`, which chunks for you. */
|
|
35
|
+
export function checkNullifiers(nullifiers) {
|
|
36
|
+
return getInternalRelayerClient().checkNullifiers(nullifiers);
|
|
37
|
+
}
|
|
38
|
+
export function getMerkleRoot(mintAddress, treeId) {
|
|
39
|
+
return getInternalRelayerClient().getMerkleRoot(mintAddress, treeId);
|
|
40
|
+
}
|
|
41
|
+
export function getMerkleTree(mintAddress, treeId) {
|
|
42
|
+
return getInternalRelayerClient().getMerkleTree(mintAddress, treeId);
|
|
43
|
+
}
|
|
44
|
+
export function submitWithdraw(data) {
|
|
45
|
+
return getInternalRelayerClient().submitWithdraw(data);
|
|
46
|
+
}
|
|
47
|
+
export function submitPrivateTransfer(data) {
|
|
48
|
+
return getInternalRelayerClient().submitPrivateTransfer(data);
|
|
49
|
+
}
|
|
50
|
+
export function submitPrivateSwap(data) {
|
|
51
|
+
return getInternalRelayerClient().submitPrivateSwap(data);
|
|
52
|
+
}
|
|
53
|
+
export { submitClosePosition, submitMergePositions, submitOpenPosition, } from "../positions/relayer.js";
|
|
54
|
+
export { submitJperpCancelTrigger, submitJperpClose, submitJperpOpen, submitJperpRecoverNative, submitJperpRecoverSeed, submitJperpReissue, submitJperpSetTpsl, submitJperpUpdateTpsl, } from "../perps/relayer.js";
|
|
55
|
+
export { submitPredictionOpen, submitPredictionReissue, } from "../predictions/relayer.js";
|
|
@@ -1,23 +1,13 @@
|
|
|
1
|
-
import type { ChallengeResponse, CheckUsernameResponse, DeleteUserDataResponse, MerkleRootResponse, MerkleTreeResponse, PreRegisterKeyResponse, PrivateSwapRequest, PrivateSwapResponse, PrivateTransferRequest, PrivateTransferResponse, QueryNotesRequest, QueryNotesResponse, RegisterRequest, RegisterResponse, RestoreRequest, RestoreResponse, RetryPolicy, SaveEncryptedNoteRequest, SaveEncryptedNoteResponse, VeiloPublicKeyResponse,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
*
|
|
8
|
-
* @example
|
|
9
|
-
* ```ts
|
|
10
|
-
* const client = new VeiloRelayerClient({
|
|
11
|
-
* apiKey: "your-api-key",
|
|
12
|
-
* relayerPublicKey: "<base64 NaCl public key>",
|
|
13
|
-
* });
|
|
14
|
-
* const root = await client.getMerkleRoot("So111...");
|
|
15
|
-
* ```
|
|
16
|
-
*/
|
|
1
|
+
import type { CheckNullifiersResponse, ChallengeResponse, CheckUsernameResponse, DeleteUserDataResponse, MerkleRootResponse, MerkleTreeResponse, PreRegisterKeyResponse, PrivateSwapRequest, PrivateSwapResponse, PrivateTransferRequest, PrivateTransferResponse, QueryNotesRequest, QueryNotesResponse, RegisterRequest, RegisterResponse, RestoreRequest, RestoreResponse, RetryPolicy, SaveEncryptedNoteRequest, SaveEncryptedNoteResponse, VeiloPublicKeyResponse, WithdrawRequest, WithdrawResponse } from "./types.js";
|
|
2
|
+
import { type InternalRelayerClientOptions } from "./internal-config.js";
|
|
3
|
+
import type { ClosePositionRequest, ClosePositionResponse, MergePositionsRequest, MergePositionsResponse, OpenPositionRequest, OpenPositionResponse } from "../positions/types.js";
|
|
4
|
+
import type { JperpCancelTriggerRequest, JperpCancelTriggerResponse, JperpCloseRequest, JperpDecreaseResponse, JperpOpenRequest, JperpOpenResponse, JperpRecoverNativeRequest, JperpRecoverNativeResponse, JperpRecoverSeedRequest, JperpRecoverSeedResponse, JperpReissueRequest, JperpReissueResponse, JperpSetTpslRequest, JperpUpdateTpslRequest } from "../perps/types.js";
|
|
5
|
+
import type { PredictionOpenRequest, PredictionOpenResponse, PredictionReissueRequest, PredictionReissueResponse } from "../predictions/types.js";
|
|
6
|
+
/** @internal Relayer transport behind the SDK's functional helpers. */
|
|
17
7
|
export declare class VeiloRelayerClient {
|
|
18
8
|
private readonly transport;
|
|
19
9
|
private readonly relayerPubKey;
|
|
20
|
-
constructor(config
|
|
10
|
+
constructor(config?: InternalRelayerClientOptions, retry?: Partial<RetryPolicy>);
|
|
21
11
|
/** Update the auth token (e.g. after register/restore). */
|
|
22
12
|
setAuthToken(token: string): void;
|
|
23
13
|
private encryptPayload;
|
|
@@ -47,6 +37,14 @@ export declare class VeiloRelayerClient {
|
|
|
47
37
|
/** Query encrypted notes for the authenticated user. Requires auth token. */
|
|
48
38
|
queryEncryptedNotes(params?: QueryNotesRequest): Promise<QueryNotesResponse>;
|
|
49
39
|
/** Delete all stored data for the authenticated user. Requires auth token. */
|
|
40
|
+
/**
|
|
41
|
+
* Ask which of these nullifiers the relayer has seen spent.
|
|
42
|
+
*
|
|
43
|
+
* Caller must respect MAX_NULLIFIERS_PER_CHECK; `checkNullifiersSpent` in
|
|
44
|
+
* notes/spent.ts does the chunking. Unauthenticated: a nullifier reveals
|
|
45
|
+
* nothing about ownership on its own.
|
|
46
|
+
*/
|
|
47
|
+
checkNullifiers(nullifiers: string[]): Promise<CheckNullifiersResponse>;
|
|
50
48
|
deleteUserData(): Promise<DeleteUserDataResponse>;
|
|
51
49
|
/** Fetch the current Merkle root for a pool, optionally filtered by mint and tree ID. */
|
|
52
50
|
getMerkleRoot(mintAddress?: string, treeId?: number): Promise<MerkleRootResponse>;
|
|
@@ -58,4 +56,18 @@ export declare class VeiloRelayerClient {
|
|
|
58
56
|
submitPrivateTransfer(data: PrivateTransferRequest): Promise<PrivateTransferResponse>;
|
|
59
57
|
/** Submit an encrypted private swap request. Not retried on failure. */
|
|
60
58
|
submitPrivateSwap(data: PrivateSwapRequest): Promise<PrivateSwapResponse>;
|
|
59
|
+
submitOpenPosition(data: OpenPositionRequest): Promise<OpenPositionResponse>;
|
|
60
|
+
submitClosePosition(data: ClosePositionRequest): Promise<ClosePositionResponse>;
|
|
61
|
+
submitMergePositions(data: MergePositionsRequest): Promise<MergePositionsResponse>;
|
|
62
|
+
submitJperpOpen(data: JperpOpenRequest): Promise<JperpOpenResponse>;
|
|
63
|
+
submitJperpClose(data: JperpCloseRequest): Promise<JperpDecreaseResponse>;
|
|
64
|
+
submitJperpSetTpsl(data: JperpSetTpslRequest): Promise<JperpDecreaseResponse>;
|
|
65
|
+
submitJperpUpdateTpsl(data: JperpUpdateTpslRequest): Promise<JperpDecreaseResponse>;
|
|
66
|
+
submitJperpCancelTrigger(data: JperpCancelTriggerRequest): Promise<JperpCancelTriggerResponse>;
|
|
67
|
+
submitJperpReissue(data: JperpReissueRequest): Promise<JperpReissueResponse>;
|
|
68
|
+
submitJperpRecoverSeed(data: JperpRecoverSeedRequest): Promise<JperpRecoverSeedResponse>;
|
|
69
|
+
submitJperpRecoverNative(data: JperpRecoverNativeRequest): Promise<JperpRecoverNativeResponse>;
|
|
70
|
+
submitPredictionOpen(data: PredictionOpenRequest): Promise<PredictionOpenResponse>;
|
|
71
|
+
submitPredictionReissue(data: PredictionReissueRequest): Promise<PredictionReissueResponse>;
|
|
72
|
+
private submitEncrypted;
|
|
61
73
|
}
|
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
import nacl from "tweetnacl";
|
|
2
2
|
import { encryptForRelayer } from "./crypto.js";
|
|
3
3
|
import { fromBase64, toBase64 } from "./encoding.js";
|
|
4
|
+
import { VEILO_RELAYER_PUBLIC_KEY, } from "./internal-config.js";
|
|
4
5
|
import { RelayerHttpTransport } from "./transport.js";
|
|
5
6
|
// =============================================================================
|
|
6
7
|
// Relayer Client
|
|
7
8
|
// =============================================================================
|
|
8
|
-
/**
|
|
9
|
-
* HTTP client for the Veilo relayer API.
|
|
10
|
-
*
|
|
11
|
-
* Handles auth, notes, merkle, and encrypted transact endpoints with
|
|
12
|
-
* automatic retry on transient failures and NaCl box payload encryption.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```ts
|
|
16
|
-
* const client = new VeiloRelayerClient({
|
|
17
|
-
* apiKey: "your-api-key",
|
|
18
|
-
* relayerPublicKey: "<base64 NaCl public key>",
|
|
19
|
-
* });
|
|
20
|
-
* const root = await client.getMerkleRoot("So111...");
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
9
|
+
/** @internal Relayer transport behind the SDK's functional helpers. */
|
|
23
10
|
export class VeiloRelayerClient {
|
|
24
|
-
constructor(config, retry) {
|
|
11
|
+
constructor(config = {}, retry) {
|
|
25
12
|
this.transport = new RelayerHttpTransport(config, retry);
|
|
26
|
-
this.relayerPubKey = fromBase64(config.
|
|
13
|
+
this.relayerPubKey = fromBase64(config.encryptionPublicKey ?? VEILO_RELAYER_PUBLIC_KEY);
|
|
27
14
|
}
|
|
28
15
|
/** Update the auth token (e.g. after register/restore). */
|
|
29
16
|
setAuthToken(token) {
|
|
@@ -88,6 +75,18 @@ export class VeiloRelayerClient {
|
|
|
88
75
|
});
|
|
89
76
|
}
|
|
90
77
|
/** Delete all stored data for the authenticated user. Requires auth token. */
|
|
78
|
+
/**
|
|
79
|
+
* Ask which of these nullifiers the relayer has seen spent.
|
|
80
|
+
*
|
|
81
|
+
* Caller must respect MAX_NULLIFIERS_PER_CHECK; `checkNullifiersSpent` in
|
|
82
|
+
* notes/spent.ts does the chunking. Unauthenticated: a nullifier reveals
|
|
83
|
+
* nothing about ownership on its own.
|
|
84
|
+
*/
|
|
85
|
+
async checkNullifiers(nullifiers) {
|
|
86
|
+
return this.transport.request("POST", "/notes/nullifiers/check-batch", {
|
|
87
|
+
body: { nullifiers },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
91
90
|
async deleteUserData() {
|
|
92
91
|
return this.transport.request("POST", "/notes/delete", { authenticated: true });
|
|
93
92
|
}
|
|
@@ -141,4 +140,60 @@ export class VeiloRelayerClient {
|
|
|
141
140
|
retryable: false,
|
|
142
141
|
});
|
|
143
142
|
}
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
// Private positions (encrypted payloads)
|
|
145
|
+
// ---------------------------------------------------------------------------
|
|
146
|
+
async submitOpenPosition(data) {
|
|
147
|
+
return this.submitEncrypted("/positions/open", data);
|
|
148
|
+
}
|
|
149
|
+
async submitClosePosition(data) {
|
|
150
|
+
return this.submitEncrypted("/positions/close", data);
|
|
151
|
+
}
|
|
152
|
+
async submitMergePositions(data) {
|
|
153
|
+
return this.submitEncrypted("/positions/merge", data);
|
|
154
|
+
}
|
|
155
|
+
// ---------------------------------------------------------------------------
|
|
156
|
+
// Private Jupiter Perps (encrypted payloads)
|
|
157
|
+
// ---------------------------------------------------------------------------
|
|
158
|
+
async submitJperpOpen(data) {
|
|
159
|
+
return this.submitEncrypted("/jperp/open", data);
|
|
160
|
+
}
|
|
161
|
+
async submitJperpClose(data) {
|
|
162
|
+
return this.submitEncrypted("/jperp/close", data);
|
|
163
|
+
}
|
|
164
|
+
async submitJperpSetTpsl(data) {
|
|
165
|
+
return this.submitEncrypted("/jperp/set-tpsl", data);
|
|
166
|
+
}
|
|
167
|
+
async submitJperpUpdateTpsl(data) {
|
|
168
|
+
return this.submitEncrypted("/jperp/update-tpsl", data);
|
|
169
|
+
}
|
|
170
|
+
async submitJperpCancelTrigger(data) {
|
|
171
|
+
return this.submitEncrypted("/jperp/cancel-trigger", data);
|
|
172
|
+
}
|
|
173
|
+
async submitJperpReissue(data) {
|
|
174
|
+
return this.submitEncrypted("/jperp/reissue", data);
|
|
175
|
+
}
|
|
176
|
+
async submitJperpRecoverSeed(data) {
|
|
177
|
+
return this.submitEncrypted("/jperp/recover-seed", data);
|
|
178
|
+
}
|
|
179
|
+
async submitJperpRecoverNative(data) {
|
|
180
|
+
return this.submitEncrypted("/jperp/recover-native", data);
|
|
181
|
+
}
|
|
182
|
+
// ---------------------------------------------------------------------------
|
|
183
|
+
// Private Jupiter Predictions (encrypted payloads)
|
|
184
|
+
// ---------------------------------------------------------------------------
|
|
185
|
+
async submitPredictionOpen(data) {
|
|
186
|
+
return this.submitEncrypted("/predictions/open", data);
|
|
187
|
+
}
|
|
188
|
+
async submitPredictionReissue(data) {
|
|
189
|
+
return this.submitEncrypted("/predictions/reissue", data);
|
|
190
|
+
}
|
|
191
|
+
submitEncrypted(route, data) {
|
|
192
|
+
const encryptedPayload = this.encryptPayload(data);
|
|
193
|
+
return this.transport.request("POST", route, {
|
|
194
|
+
body: { encryptedPayload },
|
|
195
|
+
// These endpoints can land transactions; automatic replay is unsafe.
|
|
196
|
+
retryable: false,
|
|
197
|
+
});
|
|
198
|
+
}
|
|
144
199
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// =============================================================================
|
|
2
2
|
// Structured Error
|
|
3
3
|
// =============================================================================
|
|
4
|
-
/** Structured error thrown by
|
|
4
|
+
/** Structured error thrown by managed Veilo API helpers. */
|
|
5
5
|
export class VeiloApiError extends Error {
|
|
6
6
|
constructor(code, message, status, details) {
|
|
7
7
|
super(message);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Veilo network coordinates are protocol configuration, not integrator input.
|
|
3
|
+
* Keep them behind the public package entry points.
|
|
4
|
+
*/
|
|
5
|
+
export declare const VEILO_RELAYER_URL = "https://relayer-server.onrender.com";
|
|
6
|
+
export declare const VEILO_RELAYER_PUBLIC_KEY = "utVxnA7zax09qJCZ7UJsa8PAOoWLRcCwOkdxg/ZGmD4=";
|
|
7
|
+
/**
|
|
8
|
+
* Internal construction options. Overrides exist only for isolated tests.
|
|
9
|
+
*
|
|
10
|
+
* ⚠ `baseUrl` MUST NOT be promoted to the public API. Two invariants depend on
|
|
11
|
+
* it staying internal:
|
|
12
|
+
*
|
|
13
|
+
* 1. The privacy pool gates every spend on an on-chain relayer allowlist
|
|
14
|
+
* (`RelayerNotAllowed`). Only deposits are permissionless. A request sent
|
|
15
|
+
* to any other host cannot land on chain, so the option would be a
|
|
16
|
+
* footgun that fails late rather than a feature.
|
|
17
|
+
* 2. These request bodies carry note spending keys (`TransactNote.privateKey`,
|
|
18
|
+
* and `claimantSecretKey` on position close/merge). A caller-settable
|
|
19
|
+
* destination is a caller-settable exfiltration target for user funds.
|
|
20
|
+
*
|
|
21
|
+
* Only `internal.ts` may construct these options, and it builds the object
|
|
22
|
+
* literal itself — no caller-supplied object is ever forwarded here. To verify
|
|
23
|
+
* that still holds:
|
|
24
|
+
*
|
|
25
|
+
* grep -rn "createInternalRelayerClient(\|new VeiloRelayerClient(" src
|
|
26
|
+
*
|
|
27
|
+
* Whitelisted partners who run their own relayer are handled out of band, not
|
|
28
|
+
* by a config flag. See README → "Submission always targets Veilo's relayer".
|
|
29
|
+
*/
|
|
30
|
+
export interface InternalRelayerClientOptions {
|
|
31
|
+
authToken?: string;
|
|
32
|
+
apiKey?: string;
|
|
33
|
+
baseUrl?: string;
|
|
34
|
+
encryptionPublicKey?: string;
|
|
35
|
+
fetch?: typeof fetch;
|
|
36
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Veilo network coordinates are protocol configuration, not integrator input.
|
|
3
|
+
* Keep them behind the public package entry points.
|
|
4
|
+
*/
|
|
5
|
+
export const VEILO_RELAYER_URL = "https://relayer-server.onrender.com";
|
|
6
|
+
export const VEILO_RELAYER_PUBLIC_KEY = "utVxnA7zax09qJCZ7UJsa8PAOoWLRcCwOkdxg/ZGmD4=";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { VeiloRelayerClient } from "./client.js";
|
|
2
|
+
import type { InternalRelayerClientOptions } from "./internal-config.js";
|
|
3
|
+
/** @internal Shared stateless production client for public SDK helpers. */
|
|
4
|
+
export declare function getInternalRelayerClient(): VeiloRelayerClient;
|
|
5
|
+
/** @internal Auth state is isolated per call to avoid cross-user token leaks. */
|
|
6
|
+
export declare function createInternalRelayerClient(options?: InternalRelayerClientOptions): VeiloRelayerClient;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { VeiloRelayerClient } from "./client.js";
|
|
2
|
+
const RELAYER = new VeiloRelayerClient();
|
|
3
|
+
/** @internal Shared stateless production client for public SDK helpers. */
|
|
4
|
+
export function getInternalRelayerClient() {
|
|
5
|
+
return RELAYER;
|
|
6
|
+
}
|
|
7
|
+
/** @internal Auth state is isolated per call to avoid cross-user token leaks. */
|
|
8
|
+
export function createInternalRelayerClient(options = {}) {
|
|
9
|
+
return new VeiloRelayerClient(options);
|
|
10
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type InternalRelayerClientOptions } from "./internal-config.js";
|
|
2
|
+
import type { RetryPolicy } from "./types.js";
|
|
2
3
|
export interface RelayerRequestOptions {
|
|
3
4
|
body?: unknown;
|
|
4
5
|
authenticated?: boolean;
|
|
@@ -10,7 +11,8 @@ export declare class RelayerHttpTransport {
|
|
|
10
11
|
private readonly apiKey;
|
|
11
12
|
private authToken;
|
|
12
13
|
private readonly retry;
|
|
13
|
-
|
|
14
|
+
private readonly fetcher?;
|
|
15
|
+
constructor(config?: InternalRelayerClientOptions, retry?: Partial<RetryPolicy>);
|
|
14
16
|
setAuthToken(token: string): void;
|
|
15
17
|
request<T>(method: string, route: string, options?: RelayerRequestOptions): Promise<T>;
|
|
16
18
|
private headers;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VeiloApiError } from "./errors.js";
|
|
2
|
-
|
|
2
|
+
import { VEILO_RELAYER_URL, } from "./internal-config.js";
|
|
3
3
|
const DEFAULT_RETRY = {
|
|
4
4
|
maxRetries: 3,
|
|
5
5
|
baseDelayMs: 1000,
|
|
@@ -7,11 +7,12 @@ const DEFAULT_RETRY = {
|
|
|
7
7
|
};
|
|
8
8
|
/** Owns HTTP authentication, retry, and response normalization. */
|
|
9
9
|
export class RelayerHttpTransport {
|
|
10
|
-
constructor(config, retry) {
|
|
11
|
-
this.baseUrl = (config.
|
|
12
|
-
this.apiKey = config.apiKey;
|
|
10
|
+
constructor(config = {}, retry) {
|
|
11
|
+
this.baseUrl = (config.baseUrl?.trim() || VEILO_RELAYER_URL).replace(/\/+$/, "");
|
|
12
|
+
this.apiKey = config.apiKey ?? "";
|
|
13
13
|
this.authToken = config.authToken;
|
|
14
14
|
this.retry = { ...DEFAULT_RETRY, ...retry };
|
|
15
|
+
this.fetcher = config.fetch;
|
|
15
16
|
}
|
|
16
17
|
setAuthToken(token) {
|
|
17
18
|
this.authToken = token;
|
|
@@ -28,7 +29,11 @@ export class RelayerHttpTransport {
|
|
|
28
29
|
}
|
|
29
30
|
let response;
|
|
30
31
|
try {
|
|
31
|
-
|
|
32
|
+
const fetcher = this.fetcher ?? globalThis.fetch;
|
|
33
|
+
if (typeof fetcher !== "function") {
|
|
34
|
+
throw new Error("This environment does not provide fetch");
|
|
35
|
+
}
|
|
36
|
+
response = await fetcher(url, {
|
|
32
37
|
method,
|
|
33
38
|
headers: this.headers(authenticated),
|
|
34
39
|
body: body == null ? undefined : JSON.stringify(body),
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
export interface VeiloRelayerConfig {
|
|
2
|
-
/** Base URL of the relayer. Defaults to Veilo's production service. */
|
|
3
|
-
relayerUrl?: string;
|
|
4
|
-
/** API key sent as x-api-key header */
|
|
5
|
-
apiKey: string;
|
|
6
|
-
/** Relayer's NaCl box public key (base64-encoded, 32 bytes) */
|
|
7
|
-
relayerPublicKey: string;
|
|
8
|
-
/** Optional JWT auth token for authenticated endpoints */
|
|
9
|
-
authToken?: string;
|
|
10
|
-
}
|
|
11
1
|
/** Retry configuration for the relayer HTTP client. */
|
|
12
2
|
export interface RetryPolicy {
|
|
13
3
|
/** Max number of retry attempts (default: 3) */
|
|
@@ -49,6 +39,15 @@ export interface QueryNotesResponse {
|
|
|
49
39
|
limit: number;
|
|
50
40
|
offset: number;
|
|
51
41
|
}
|
|
42
|
+
/** Nullifiers to test for spend status. Max 200 per request, 64-char hex. */
|
|
43
|
+
export interface CheckNullifiersRequest {
|
|
44
|
+
nullifiers: string[];
|
|
45
|
+
}
|
|
46
|
+
export interface CheckNullifiersResponse {
|
|
47
|
+
success: boolean;
|
|
48
|
+
/** The SPENT subset, lowercase hex. Absent entries are unspent. */
|
|
49
|
+
spent: string[];
|
|
50
|
+
}
|
|
52
51
|
export interface SaveEncryptedNoteRequest {
|
|
53
52
|
commitment: string;
|
|
54
53
|
ephemeralPublicKey: string;
|
package/dist/esm/shield/owner.js
CHANGED
|
@@ -13,10 +13,7 @@ import { ShieldError } from "./errors.js";
|
|
|
13
13
|
* inspectable. The two owner endpoints used below are intentionally public and
|
|
14
14
|
* return public key material only.
|
|
15
15
|
*/
|
|
16
|
-
const OWNER_RELAYER = new VeiloRelayerClient(
|
|
17
|
-
apiKey: "",
|
|
18
|
-
relayerPublicKey: "utVxnA7zax09qJCZ7UJsa8PAOoWLRcCwOkdxg/ZGmD4=",
|
|
19
|
-
});
|
|
16
|
+
const OWNER_RELAYER = new VeiloRelayerClient();
|
|
20
17
|
/**
|
|
21
18
|
* Resolve a shield recipient into the pair of keys that must belong to the same
|
|
22
19
|
* account.
|
package/identity.d.ts
ADDED
package/identity.js
ADDED
package/idl.d.ts
ADDED
package/idl.js
ADDED
package/notes.d.ts
ADDED
package/notes.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veilo/sdk-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TypeScript SDK for the Veilo Privacy Pool - UTXO-based privacy protocol on Solana with ZK-SNARKs",
|
|
5
5
|
"homepage": "https://github.com/VeiloSolana/veilo-sdk#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -127,6 +127,56 @@
|
|
|
127
127
|
"default": "./dist/cjs/cloak.js"
|
|
128
128
|
}
|
|
129
129
|
},
|
|
130
|
+
"./identity": {
|
|
131
|
+
"import": {
|
|
132
|
+
"types": "./dist/esm/identity/index.d.ts",
|
|
133
|
+
"default": "./dist/esm/identity/index.js"
|
|
134
|
+
},
|
|
135
|
+
"require": {
|
|
136
|
+
"types": "./dist/cjs/identity/index.d.ts",
|
|
137
|
+
"default": "./dist/cjs/identity/index.js"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"./positions": {
|
|
141
|
+
"import": {
|
|
142
|
+
"types": "./dist/esm/positions/index.d.ts",
|
|
143
|
+
"default": "./dist/esm/positions/index.js"
|
|
144
|
+
},
|
|
145
|
+
"require": {
|
|
146
|
+
"types": "./dist/cjs/positions/index.d.ts",
|
|
147
|
+
"default": "./dist/cjs/positions/index.js"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"./perps": {
|
|
151
|
+
"import": {
|
|
152
|
+
"types": "./dist/esm/perps/index.d.ts",
|
|
153
|
+
"default": "./dist/esm/perps/index.js"
|
|
154
|
+
},
|
|
155
|
+
"require": {
|
|
156
|
+
"types": "./dist/cjs/perps/index.d.ts",
|
|
157
|
+
"default": "./dist/cjs/perps/index.js"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
"./predictions": {
|
|
161
|
+
"import": {
|
|
162
|
+
"types": "./dist/esm/predictions/index.d.ts",
|
|
163
|
+
"default": "./dist/esm/predictions/index.js"
|
|
164
|
+
},
|
|
165
|
+
"require": {
|
|
166
|
+
"types": "./dist/cjs/predictions/index.d.ts",
|
|
167
|
+
"default": "./dist/cjs/predictions/index.js"
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"./idl": {
|
|
171
|
+
"import": {
|
|
172
|
+
"types": "./dist/esm/idl/index.d.ts",
|
|
173
|
+
"default": "./dist/esm/idl/index.js"
|
|
174
|
+
},
|
|
175
|
+
"require": {
|
|
176
|
+
"types": "./dist/cjs/idl/index.d.ts",
|
|
177
|
+
"default": "./dist/cjs/idl/index.js"
|
|
178
|
+
}
|
|
179
|
+
},
|
|
130
180
|
"./package.json": "./package.json"
|
|
131
181
|
},
|
|
132
182
|
"publishConfig": {
|
|
@@ -135,16 +185,48 @@
|
|
|
135
185
|
"sideEffects": false,
|
|
136
186
|
"files": [
|
|
137
187
|
"dist/",
|
|
188
|
+
"accounts.js",
|
|
189
|
+
"cloak.js",
|
|
190
|
+
"config.js",
|
|
191
|
+
"identity.js",
|
|
192
|
+
"idl.js",
|
|
193
|
+
"notes.js",
|
|
194
|
+
"perps.js",
|
|
195
|
+
"poseidon.js",
|
|
196
|
+
"positions.js",
|
|
197
|
+
"predictions.js",
|
|
198
|
+
"proof.js",
|
|
199
|
+
"prover.js",
|
|
200
|
+
"relayer.js",
|
|
201
|
+
"shield.js",
|
|
202
|
+
"transactions.js",
|
|
203
|
+
"accounts.d.ts",
|
|
204
|
+
"cloak.d.ts",
|
|
205
|
+
"config.d.ts",
|
|
206
|
+
"identity.d.ts",
|
|
207
|
+
"idl.d.ts",
|
|
208
|
+
"notes.d.ts",
|
|
209
|
+
"perps.d.ts",
|
|
210
|
+
"poseidon.d.ts",
|
|
211
|
+
"positions.d.ts",
|
|
212
|
+
"predictions.d.ts",
|
|
213
|
+
"proof.d.ts",
|
|
214
|
+
"prover.d.ts",
|
|
215
|
+
"relayer.d.ts",
|
|
216
|
+
"shield.d.ts",
|
|
217
|
+
"transactions.d.ts",
|
|
138
218
|
"README.md",
|
|
139
219
|
"LICENSE"
|
|
140
220
|
],
|
|
141
221
|
"scripts": {
|
|
142
222
|
"check:cycles": "node scripts/check-dependency-cycles.mjs",
|
|
143
223
|
"gen:idl": "node scripts/gen-idl.mjs",
|
|
224
|
+
"copy:circuits": "node scripts/copy-circuits.mjs",
|
|
144
225
|
"verify:cipher-parity": "npm run build && node scripts/verify-compact-cipher-parity.mjs",
|
|
145
|
-
"build": "rm -rf dist/ && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
226
|
+
"build": "rm -rf dist/ && tsc -p tsconfig.json && tsc -p tsconfig.esm.json && node scripts/copy-idls.mjs && node scripts/gen-subpath-stubs.mjs && echo '{\"type\":\"module\"}' > dist/esm/package.json",
|
|
146
227
|
"test": "rm -rf dist/ && tsc -p test-tsconfig.json && mocha -t 1000000 \"dist/tests/**/*.js\"",
|
|
147
|
-
"test:integration": "export VEILO_RUN_INTEGRATION=1 && export ANCHOR_PROVIDER_URL=https://api.devnet.solana.com && export ANCHOR_WALLET=$HOME/.config/solana/id.json && npm test"
|
|
228
|
+
"test:integration": "export VEILO_RUN_INTEGRATION=1 && export ANCHOR_PROVIDER_URL=https://api.devnet.solana.com && export ANCHOR_WALLET=$HOME/.config/solana/id.json && npm test",
|
|
229
|
+
"gen:stubs": "node scripts/gen-subpath-stubs.mjs"
|
|
148
230
|
},
|
|
149
231
|
"dependencies": {
|
|
150
232
|
"@coral-xyz/anchor": "^0.30.0",
|
package/perps.d.ts
ADDED
package/perps.js
ADDED
package/poseidon.d.ts
ADDED
package/poseidon.js
ADDED
package/positions.d.ts
ADDED
package/positions.js
ADDED