@pear-protocol/types
Advanced tools
@@ -51,1 +51,43 @@ import { z } from 'zod'; | ||
| export type SubmitLighterFastWithdrawParams = z.output<typeof SubmitLighterFastWithdrawParams>; | ||
| /** The Lighter account tiers a user can switch between, spelled the way Lighter spells them. */ | ||
| export declare const LighterAccountTier: z.ZodEnum<{ | ||
| standard: "standard"; | ||
| plus: "plus"; | ||
| premium: "premium"; | ||
| }>; | ||
| export type LighterAccountTier = z.output<typeof LighterAccountTier>; | ||
| export declare const ChangeLighterAccountTierParams: z.ZodObject<{ | ||
| accountIndex: z.ZodNumber; | ||
| apiKeyIndex: z.ZodNumber; | ||
| apiPrivateKey: z.ZodString; | ||
| tier: z.ZodEnum<{ | ||
| standard: "standard"; | ||
| plus: "plus"; | ||
| premium: "premium"; | ||
| }>; | ||
| }, z.core.$strip>; | ||
| export type ChangeLighterAccountTierParams = z.output<typeof ChangeLighterAccountTierParams>; | ||
| /** | ||
| * The wallet a Fun.xyz universal deposit address (UDA) is minted for. | ||
| * | ||
| * The bridge mints one address set per (wallet, market, asset) triple and reuses it, so the same | ||
| * request answers for a wallet Lighter has never seen and for one that already holds an account. | ||
| */ | ||
| export declare const CreateLighterUdaParams: z.ZodObject<{ | ||
| walletAddress: z.ZodString; | ||
| market: z.ZodEnum<{ | ||
| spot: "spot"; | ||
| perps: "perps"; | ||
| }>; | ||
| asset: z.ZodEnum<{ | ||
| USDC: "USDC"; | ||
| ETH: "ETH"; | ||
| }>; | ||
| accountIndex: z.ZodOptional<z.ZodNumber>; | ||
| }, z.core.$strip>; | ||
| export type CreateLighterUdaParams = z.output<typeof CreateLighterUdaParams>; | ||
| /** The wallet whose Fun.xyz bridge transactions are being read. */ | ||
| export declare const ListLighterUdaDepositsParams: z.ZodObject<{ | ||
| walletAddress: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export type ListLighterUdaDepositsParams = z.output<typeof ListLighterUdaDepositsParams>; |
@@ -45,3 +45,30 @@ import { z } from 'zod'; | ||
| }); | ||
| const LighterAccountTier = z.enum([ | ||
| "standard", | ||
| "plus", | ||
| "premium" | ||
| ]); | ||
| const ChangeLighterAccountTierParams = z.object({ | ||
| accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER), | ||
| apiKeyIndex: z.number().int().nonnegative().max(254), | ||
| apiPrivateKey: z.string(), | ||
| tier: LighterAccountTier | ||
| }); | ||
| const CreateLighterUdaParams = z.object({ | ||
| walletAddress: z.string().regex(/^0x[0-9a-fA-F]{40}$/), | ||
| market: z.enum([ | ||
| "perps", | ||
| "spot" | ||
| ]), | ||
| asset: z.enum([ | ||
| "USDC", | ||
| "ETH" | ||
| ]), | ||
| // Targets a sub-account; absent credits the wallet's master account index. | ||
| accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional() | ||
| }); | ||
| const ListLighterUdaDepositsParams = z.object({ | ||
| walletAddress: z.string().regex(/^0x[0-9a-fA-F]{40}$/) | ||
| }); | ||
| export { CreateAuthTokenParams, CreateLighterApiKeyParams, PrepareApproveIntegratorParams, PrepareLighterFastWithdrawParams, SubmitApproveIntegratorParams, SubmitChangePubKeyParams, SubmitLighterFastWithdrawParams }; | ||
| export { ChangeLighterAccountTierParams, CreateAuthTokenParams, CreateLighterApiKeyParams, CreateLighterUdaParams, LighterAccountTier, ListLighterUdaDepositsParams, PrepareApproveIntegratorParams, PrepareLighterFastWithdrawParams, SubmitApproveIntegratorParams, SubmitChangePubKeyParams, SubmitLighterFastWithdrawParams }; |
@@ -38,1 +38,90 @@ import { z } from 'zod'; | ||
| export type SubmitLighterFastWithdrawResult = z.output<typeof SubmitLighterFastWithdrawResult>; | ||
| export declare const ChangeLighterAccountTierResult: z.ZodObject<{ | ||
| tier: z.ZodEnum<{ | ||
| standard: "standard"; | ||
| plus: "plus"; | ||
| premium: "premium"; | ||
| }>; | ||
| }, z.core.$strip>; | ||
| export type ChangeLighterAccountTierResult = z.output<typeof ChangeLighterAccountTierResult>; | ||
| /** | ||
| * Where the Fun.xyz bridge will credit anything sent to a minted address. | ||
| * | ||
| * `userId` names the wallet this answer is for, and a caller must refuse any resolution whose | ||
| * `userId` is not the wallet it asked about — an answer naming another one describes somebody | ||
| * else's deposit address. `recipientAddr` then names the Lighter account: its index once the | ||
| * account exists, and the literal `l1` while it does not, because the first deposit is what | ||
| * creates it. | ||
| */ | ||
| export declare const LighterUdaResolution: z.ZodObject<{ | ||
| toChainId: z.ZodString; | ||
| toTokenAddress: z.ZodString; | ||
| actionType: z.ZodString; | ||
| recipientAddr: z.ZodString; | ||
| userId: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export type LighterUdaResolution = z.output<typeof LighterUdaResolution>; | ||
| /** | ||
| * The bridge's answer for one wallet: its deposit addresses, or a refusal to serve it. | ||
| * | ||
| * Reading `status` is what makes the addresses available. A served wallet always names the EVM | ||
| * deposit address and what it credits, and a refusal carries neither — so a caller cannot reach an | ||
| * address without first learning the bridge agreed to serve it. A chain family the bridge cannot | ||
| * currently serve stays absent rather than blank, because a present-but-empty key would read as an | ||
| * address someone could send funds to. | ||
| * | ||
| * The union sits under `uda` rather than at the top level so the response stays an object, matching | ||
| * `RebalanceManualResponse`. A bare top-level union does build, but nestjs-zod publishes it behind a | ||
| * synthetic `root` key that only `cleanupOpenApiDoc` unwraps. | ||
| */ | ||
| export declare const CreateLighterUdaResult: z.ZodObject<{ | ||
| uda: z.ZodDiscriminatedUnion<[z.ZodObject<{ | ||
| status: z.ZodLiteral<"blocked">; | ||
| }, z.core.$strip>, z.ZodObject<{ | ||
| status: z.ZodLiteral<"served">; | ||
| depositAddr: z.ZodString; | ||
| resolved: z.ZodObject<{ | ||
| toChainId: z.ZodString; | ||
| toTokenAddress: z.ZodString; | ||
| actionType: z.ZodString; | ||
| recipientAddr: z.ZodString; | ||
| userId: z.ZodString; | ||
| }, z.core.$strip>; | ||
| solanaAddr: z.ZodOptional<z.ZodString>; | ||
| tronAddr: z.ZodOptional<z.ZodString>; | ||
| btcAddrSegwit: z.ZodOptional<z.ZodString>; | ||
| }, z.core.$strip>], "status">; | ||
| }, z.core.$strip>; | ||
| export type CreateLighterUdaResult = z.output<typeof CreateLighterUdaResult>; | ||
| /** | ||
| * One deposit the bridge has seen for a wallet, from source transfer to Lighter credit. | ||
| * | ||
| * `status` stays an open string because the bridge documents only PROCESSING and COMPLETED, and | ||
| * rejecting an undocumented state here would hide a deposit that genuinely happened. | ||
| */ | ||
| export declare const LighterUdaTransaction: z.ZodObject<{ | ||
| fromChainId: z.ZodString; | ||
| fromTokenAddress: z.ZodString; | ||
| fromAmountBaseUnit: z.ZodString; | ||
| toChainId: z.ZodString; | ||
| toTokenAddress: z.ZodString; | ||
| txHash: z.ZodString; | ||
| createdTimeMs: z.ZodNumber; | ||
| status: z.ZodString; | ||
| depositAddr: z.ZodString; | ||
| }, z.core.$strip>; | ||
| export type LighterUdaTransaction = z.output<typeof LighterUdaTransaction>; | ||
| export declare const ListLighterUdaDepositsResult: z.ZodObject<{ | ||
| transactions: z.ZodArray<z.ZodObject<{ | ||
| fromChainId: z.ZodString; | ||
| fromTokenAddress: z.ZodString; | ||
| fromAmountBaseUnit: z.ZodString; | ||
| toChainId: z.ZodString; | ||
| toTokenAddress: z.ZodString; | ||
| txHash: z.ZodString; | ||
| createdTimeMs: z.ZodNumber; | ||
| status: z.ZodString; | ||
| depositAddr: z.ZodString; | ||
| }, z.core.$strip>>; | ||
| }, z.core.$strip>; | ||
| export type ListLighterUdaDepositsResult = z.output<typeof ListLighterUdaDepositsResult>; |
| import { z } from 'zod'; | ||
| import { LighterAccountTier } from './payloads'; | ||
@@ -34,3 +35,44 @@ const CreateApiKeyWithMessageResult = z.object({ | ||
| }); | ||
| const ChangeLighterAccountTierResult = z.object({ | ||
| // The tier Lighter accepted. Its own acknowledgement names no tier, so this echoes the request. | ||
| tier: LighterAccountTier | ||
| }); | ||
| const LighterUdaResolution = z.object({ | ||
| toChainId: z.string(), | ||
| toTokenAddress: z.string(), | ||
| actionType: z.string(), | ||
| recipientAddr: z.string(), | ||
| userId: z.string() | ||
| }); | ||
| const CreateLighterUdaResult = z.object({ | ||
| uda: z.discriminatedUnion("status", [ | ||
| z.object({ | ||
| status: z.literal("blocked") | ||
| }), | ||
| z.object({ | ||
| status: z.literal("served"), | ||
| depositAddr: z.string(), | ||
| resolved: LighterUdaResolution, | ||
| // Absent rather than blank on a chain family the bridge does not currently serve. | ||
| solanaAddr: z.string().min(1).optional(), | ||
| tronAddr: z.string().min(1).optional(), | ||
| btcAddrSegwit: z.string().min(1).optional() | ||
| }) | ||
| ]) | ||
| }); | ||
| const LighterUdaTransaction = z.object({ | ||
| fromChainId: z.string(), | ||
| fromTokenAddress: z.string(), | ||
| fromAmountBaseUnit: z.string(), | ||
| toChainId: z.string(), | ||
| toTokenAddress: z.string(), | ||
| txHash: z.string(), | ||
| createdTimeMs: z.number(), | ||
| status: z.string(), | ||
| depositAddr: z.string() | ||
| }); | ||
| const ListLighterUdaDepositsResult = z.object({ | ||
| transactions: z.array(LighterUdaTransaction) | ||
| }); | ||
| export { CreateApiKeyWithMessageResult, CreateAuthTokenResult, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawResult, SubmitApproveIntegratorResult, SubmitChangePubKeyResult, SubmitLighterFastWithdrawResult }; | ||
| export { ChangeLighterAccountTierResult, CreateApiKeyWithMessageResult, CreateAuthTokenResult, CreateLighterUdaResult, LighterUdaResolution, LighterUdaTransaction, ListLighterUdaDepositsResult, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawResult, SubmitApproveIntegratorResult, SubmitChangePubKeyResult, SubmitLighterFastWithdrawResult }; |
+1
-1
| { | ||
| "name": "@pear-protocol/types", | ||
| "version": "1.27.0", | ||
| "version": "1.28.0", | ||
| "description": "Pear Protocol Types definitions", | ||
@@ -5,0 +5,0 @@ "private": false, |
871385
0.91%24898
0.82%