@pear-protocol/types 1.27.0 → 1.28.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.
@@ -48,3 +48,45 @@ export declare const SubmitLighterFastWithdrawParams: z.ZodObject<{
48
48
  l1Signature: z.ZodString;
49
49
  }, z.core.$strip>;
50
50
  export type SubmitLighterFastWithdrawParams = z.output<typeof SubmitLighterFastWithdrawParams>;
51
+ /** The Lighter account tiers a user can switch between, spelled the way Lighter spells them. */
52
+ export declare const LighterAccountTier: z.ZodEnum<{
53
+ standard: "standard";
54
+ plus: "plus";
55
+ premium: "premium";
56
+ }>;
57
+ export type LighterAccountTier = z.output<typeof LighterAccountTier>;
58
+ export declare const ChangeLighterAccountTierParams: z.ZodObject<{
59
+ accountIndex: z.ZodNumber;
60
+ apiKeyIndex: z.ZodNumber;
61
+ apiPrivateKey: z.ZodString;
62
+ tier: z.ZodEnum<{
63
+ standard: "standard";
64
+ plus: "plus";
65
+ premium: "premium";
66
+ }>;
67
+ }, z.core.$strip>;
68
+ export type ChangeLighterAccountTierParams = z.output<typeof ChangeLighterAccountTierParams>;
69
+ /**
70
+ * The wallet a Fun.xyz universal deposit address (UDA) is minted for.
71
+ *
72
+ * The bridge mints one address set per (wallet, market, asset) triple and reuses it, so the same
73
+ * request answers for a wallet Lighter has never seen and for one that already holds an account.
74
+ */
75
+ export declare const CreateLighterUdaParams: z.ZodObject<{
76
+ walletAddress: z.ZodString;
77
+ market: z.ZodEnum<{
78
+ spot: "spot";
79
+ perps: "perps";
80
+ }>;
81
+ asset: z.ZodEnum<{
82
+ USDC: "USDC";
83
+ ETH: "ETH";
84
+ }>;
85
+ accountIndex: z.ZodOptional<z.ZodNumber>;
86
+ }, z.core.$strip>;
87
+ export type CreateLighterUdaParams = z.output<typeof CreateLighterUdaParams>;
88
+ /** The wallet whose Fun.xyz bridge transactions are being read. */
89
+ export declare const ListLighterUdaDepositsParams: z.ZodObject<{
90
+ walletAddress: z.ZodString;
91
+ }, z.core.$strip>;
92
+ export type ListLighterUdaDepositsParams = z.output<typeof ListLighterUdaDepositsParams>;
@@ -42,5 +42,32 @@ const SubmitLighterFastWithdrawParams = z.object({
42
42
  txInfo: z.string(),
43
43
  l1Signature: z.string()
44
44
  });
45
+ const LighterAccountTier = z.enum([
46
+ "standard",
47
+ "plus",
48
+ "premium"
49
+ ]);
50
+ const ChangeLighterAccountTierParams = z.object({
51
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER),
52
+ apiKeyIndex: z.number().int().nonnegative().max(254),
53
+ apiPrivateKey: z.string(),
54
+ tier: LighterAccountTier
55
+ });
56
+ const CreateLighterUdaParams = z.object({
57
+ walletAddress: z.string().regex(/^0x[0-9a-fA-F]{40}$/),
58
+ market: z.enum([
59
+ "perps",
60
+ "spot"
61
+ ]),
62
+ asset: z.enum([
63
+ "USDC",
64
+ "ETH"
65
+ ]),
66
+ // Targets a sub-account; absent credits the wallet's master account index.
67
+ accountIndex: z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER).optional()
68
+ });
69
+ const ListLighterUdaDepositsParams = z.object({
70
+ walletAddress: z.string().regex(/^0x[0-9a-fA-F]{40}$/)
71
+ });
45
72
 
46
- export { CreateAuthTokenParams, CreateLighterApiKeyParams, PrepareApproveIntegratorParams, PrepareLighterFastWithdrawParams, SubmitApproveIntegratorParams, SubmitChangePubKeyParams, SubmitLighterFastWithdrawParams };
73
+ export { ChangeLighterAccountTierParams, CreateAuthTokenParams, CreateLighterApiKeyParams, CreateLighterUdaParams, LighterAccountTier, ListLighterUdaDepositsParams, PrepareApproveIntegratorParams, PrepareLighterFastWithdrawParams, SubmitApproveIntegratorParams, SubmitChangePubKeyParams, SubmitLighterFastWithdrawParams };
@@ -35,3 +35,92 @@ export declare const SubmitLighterFastWithdrawResult: z.ZodObject<{
35
35
  txHash: z.ZodString;
36
36
  }, z.core.$strip>;
37
37
  export type SubmitLighterFastWithdrawResult = z.output<typeof SubmitLighterFastWithdrawResult>;
38
+ export declare const ChangeLighterAccountTierResult: z.ZodObject<{
39
+ tier: z.ZodEnum<{
40
+ standard: "standard";
41
+ plus: "plus";
42
+ premium: "premium";
43
+ }>;
44
+ }, z.core.$strip>;
45
+ export type ChangeLighterAccountTierResult = z.output<typeof ChangeLighterAccountTierResult>;
46
+ /**
47
+ * Where the Fun.xyz bridge will credit anything sent to a minted address.
48
+ *
49
+ * `userId` names the wallet this answer is for, and a caller must refuse any resolution whose
50
+ * `userId` is not the wallet it asked about — an answer naming another one describes somebody
51
+ * else's deposit address. `recipientAddr` then names the Lighter account: its index once the
52
+ * account exists, and the literal `l1` while it does not, because the first deposit is what
53
+ * creates it.
54
+ */
55
+ export declare const LighterUdaResolution: z.ZodObject<{
56
+ toChainId: z.ZodString;
57
+ toTokenAddress: z.ZodString;
58
+ actionType: z.ZodString;
59
+ recipientAddr: z.ZodString;
60
+ userId: z.ZodString;
61
+ }, z.core.$strip>;
62
+ export type LighterUdaResolution = z.output<typeof LighterUdaResolution>;
63
+ /**
64
+ * The bridge's answer for one wallet: its deposit addresses, or a refusal to serve it.
65
+ *
66
+ * Reading `status` is what makes the addresses available. A served wallet always names the EVM
67
+ * deposit address and what it credits, and a refusal carries neither — so a caller cannot reach an
68
+ * address without first learning the bridge agreed to serve it. A chain family the bridge cannot
69
+ * currently serve stays absent rather than blank, because a present-but-empty key would read as an
70
+ * address someone could send funds to.
71
+ *
72
+ * The union sits under `uda` rather than at the top level so the response stays an object, matching
73
+ * `RebalanceManualResponse`. A bare top-level union does build, but nestjs-zod publishes it behind a
74
+ * synthetic `root` key that only `cleanupOpenApiDoc` unwraps.
75
+ */
76
+ export declare const CreateLighterUdaResult: z.ZodObject<{
77
+ uda: z.ZodDiscriminatedUnion<[z.ZodObject<{
78
+ status: z.ZodLiteral<"blocked">;
79
+ }, z.core.$strip>, z.ZodObject<{
80
+ status: z.ZodLiteral<"served">;
81
+ depositAddr: z.ZodString;
82
+ resolved: z.ZodObject<{
83
+ toChainId: z.ZodString;
84
+ toTokenAddress: z.ZodString;
85
+ actionType: z.ZodString;
86
+ recipientAddr: z.ZodString;
87
+ userId: z.ZodString;
88
+ }, z.core.$strip>;
89
+ solanaAddr: z.ZodOptional<z.ZodString>;
90
+ tronAddr: z.ZodOptional<z.ZodString>;
91
+ btcAddrSegwit: z.ZodOptional<z.ZodString>;
92
+ }, z.core.$strip>], "status">;
93
+ }, z.core.$strip>;
94
+ export type CreateLighterUdaResult = z.output<typeof CreateLighterUdaResult>;
95
+ /**
96
+ * One deposit the bridge has seen for a wallet, from source transfer to Lighter credit.
97
+ *
98
+ * `status` stays an open string because the bridge documents only PROCESSING and COMPLETED, and
99
+ * rejecting an undocumented state here would hide a deposit that genuinely happened.
100
+ */
101
+ export declare const LighterUdaTransaction: z.ZodObject<{
102
+ fromChainId: z.ZodString;
103
+ fromTokenAddress: z.ZodString;
104
+ fromAmountBaseUnit: z.ZodString;
105
+ toChainId: z.ZodString;
106
+ toTokenAddress: z.ZodString;
107
+ txHash: z.ZodString;
108
+ createdTimeMs: z.ZodNumber;
109
+ status: z.ZodString;
110
+ depositAddr: z.ZodString;
111
+ }, z.core.$strip>;
112
+ export type LighterUdaTransaction = z.output<typeof LighterUdaTransaction>;
113
+ export declare const ListLighterUdaDepositsResult: z.ZodObject<{
114
+ transactions: z.ZodArray<z.ZodObject<{
115
+ fromChainId: z.ZodString;
116
+ fromTokenAddress: z.ZodString;
117
+ fromAmountBaseUnit: z.ZodString;
118
+ toChainId: z.ZodString;
119
+ toTokenAddress: z.ZodString;
120
+ txHash: z.ZodString;
121
+ createdTimeMs: z.ZodNumber;
122
+ status: z.ZodString;
123
+ depositAddr: z.ZodString;
124
+ }, z.core.$strip>>;
125
+ }, z.core.$strip>;
126
+ export type ListLighterUdaDepositsResult = z.output<typeof ListLighterUdaDepositsResult>;
@@ -1,4 +1,5 @@
1
1
  import { z } from 'zod';
2
+ import { LighterAccountTier } from './payloads';
2
3
 
3
4
  const CreateApiKeyWithMessageResult = z.object({
4
5
  privateKey: z.string(),
@@ -31,5 +32,46 @@ const PrepareLighterFastWithdrawResult = z.object({
31
32
  const SubmitLighterFastWithdrawResult = z.object({
32
33
  txHash: z.string()
33
34
  });
35
+ const ChangeLighterAccountTierResult = z.object({
36
+ // The tier Lighter accepted. Its own acknowledgement names no tier, so this echoes the request.
37
+ tier: LighterAccountTier
38
+ });
39
+ const LighterUdaResolution = z.object({
40
+ toChainId: z.string(),
41
+ toTokenAddress: z.string(),
42
+ actionType: z.string(),
43
+ recipientAddr: z.string(),
44
+ userId: z.string()
45
+ });
46
+ const CreateLighterUdaResult = z.object({
47
+ uda: z.discriminatedUnion("status", [
48
+ z.object({
49
+ status: z.literal("blocked")
50
+ }),
51
+ z.object({
52
+ status: z.literal("served"),
53
+ depositAddr: z.string(),
54
+ resolved: LighterUdaResolution,
55
+ // Absent rather than blank on a chain family the bridge does not currently serve.
56
+ solanaAddr: z.string().min(1).optional(),
57
+ tronAddr: z.string().min(1).optional(),
58
+ btcAddrSegwit: z.string().min(1).optional()
59
+ })
60
+ ])
61
+ });
62
+ const LighterUdaTransaction = z.object({
63
+ fromChainId: z.string(),
64
+ fromTokenAddress: z.string(),
65
+ fromAmountBaseUnit: z.string(),
66
+ toChainId: z.string(),
67
+ toTokenAddress: z.string(),
68
+ txHash: z.string(),
69
+ createdTimeMs: z.number(),
70
+ status: z.string(),
71
+ depositAddr: z.string()
72
+ });
73
+ const ListLighterUdaDepositsResult = z.object({
74
+ transactions: z.array(LighterUdaTransaction)
75
+ });
34
76
 
35
- export { CreateApiKeyWithMessageResult, CreateAuthTokenResult, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawResult, SubmitApproveIntegratorResult, SubmitChangePubKeyResult, SubmitLighterFastWithdrawResult };
77
+ export { ChangeLighterAccountTierResult, CreateApiKeyWithMessageResult, CreateAuthTokenResult, CreateLighterUdaResult, LighterUdaResolution, LighterUdaTransaction, ListLighterUdaDepositsResult, PrepareApproveIntegratorResult, PrepareLighterFastWithdrawResult, SubmitApproveIntegratorResult, SubmitChangePubKeyResult, SubmitLighterFastWithdrawResult };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/types",
3
- "version": "1.27.0",
3
+ "version": "1.28.0",
4
4
  "description": "Pear Protocol Types definitions",
5
5
  "private": false,
6
6
  "type": "module",