@argent/x-shared 1.38.1 → 1.39.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/dist/index.cjs +1 -1
- package/dist/index.js +286 -277
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.d.ts +1660 -52
- package/dist/src/features/simulation/activity/schema.js +68 -49
- package/dist/src/features/swap/models/quote.model.d.ts +4 -4
- package/dist/src/features/swap/models/trade.model.d.ts +2 -2
- package/dist/src/index.d.ts +1 -0
- package/dist/src/staking/index.d.ts +1 -0
- package/dist/src/staking/schema.cjs +1 -0
- package/dist/src/staking/schema.d.ts +3027 -0
- package/dist/src/staking/schema.js +137 -0
- package/dist/src/tokens/service/implementation.d.ts +4 -4
- package/dist/src/tokens/service/types/backend.model.d.ts +164 -164
- package/dist/src/tokens/service/types/defiPosition.model.d.ts +210 -210
- package/dist/src/tokens/service/types/unclaimedRewards.model.d.ts +8 -8
- package/dist/src/tokens/service/types/webToken.model.d.ts +8 -8
- package/dist/src/transactions/estimate/model.cjs +1 -1
- package/dist/src/transactions/estimate/model.js +5 -5
- package/package.json +1 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
2
|
import { actionSchema as m, targetedDappSchema as d } from "../transactionReview/schema.js";
|
|
3
|
+
import { investmentMetaSchema as g } from "../../../staking/schema.js";
|
|
3
4
|
import { addressSchemaArgentBackend as e } from "../../../chains/starknet/address.js";
|
|
4
5
|
const r = t.object({
|
|
5
6
|
network: t.string(),
|
|
@@ -15,20 +16,20 @@ const r = t.object({
|
|
|
15
16
|
currency: t.string(),
|
|
16
17
|
currencyAmount: t.number()
|
|
17
18
|
}).optional().nullable()
|
|
18
|
-
}), i = t.enum(["ethereum", "starknet", "zksync", "zksync2"]),
|
|
19
|
+
}), i = t.enum(["ethereum", "starknet", "zksync", "zksync2"]), y = t.object({
|
|
19
20
|
type: t.enum(["payment", "gasFee"]),
|
|
20
21
|
leg: t.enum(["credit", "debit"]),
|
|
21
22
|
asset: a,
|
|
22
23
|
counterParty: e.optional(),
|
|
23
24
|
counterPartyNetwork: i.optional()
|
|
24
|
-
}),
|
|
25
|
+
}), b = t.object({
|
|
25
26
|
address: e,
|
|
26
27
|
network: i,
|
|
27
28
|
type: t.enum(["wallet", "token"])
|
|
28
|
-
}),
|
|
29
|
+
}), S = t.object({
|
|
29
30
|
chainId: t.enum(["TESTNET", "MAINNET", "SEPOLIA"]),
|
|
30
31
|
ethereumNetwork: t.enum(["mainnet", "sepolia"])
|
|
31
|
-
}),
|
|
32
|
+
}), h = t.enum([
|
|
32
33
|
"approval",
|
|
33
34
|
"changePubKey",
|
|
34
35
|
"dappInteraction",
|
|
@@ -37,7 +38,8 @@ const r = t.object({
|
|
|
37
38
|
"multicall",
|
|
38
39
|
"payment",
|
|
39
40
|
"security",
|
|
40
|
-
"trade"
|
|
41
|
+
"trade",
|
|
42
|
+
"staking"
|
|
41
43
|
]), s = t.enum([
|
|
42
44
|
"triggerEscapeGuardian",
|
|
43
45
|
"triggerEscapeSigner",
|
|
@@ -49,10 +51,10 @@ const r = t.object({
|
|
|
49
51
|
"cancelEscape",
|
|
50
52
|
"accountUpgraded",
|
|
51
53
|
"multisigConfigurationUpdated"
|
|
52
|
-
]),
|
|
54
|
+
]), v = t.object({
|
|
53
55
|
name: t.string(),
|
|
54
56
|
parameters: t.array(t.unknown()).optional()
|
|
55
|
-
}),
|
|
57
|
+
}), f = t.object({
|
|
56
58
|
guid: t.string().optional(),
|
|
57
59
|
signerType: t.string().optional(),
|
|
58
60
|
// StarknetKey, Secp256k1, Secp256r1, Eip191, Webauthn
|
|
@@ -65,7 +67,16 @@ const r = t.object({
|
|
|
65
67
|
newImplementation: t.string().optional(),
|
|
66
68
|
newVersion: t.string().optional(),
|
|
67
69
|
signerGuid: t.string().optional(),
|
|
68
|
-
signers: t.array(
|
|
70
|
+
signers: t.array(f).optional()
|
|
71
|
+
}), k = t.enum([
|
|
72
|
+
"deposit",
|
|
73
|
+
"withdraw",
|
|
74
|
+
"finalizeWithdraw",
|
|
75
|
+
"claim"
|
|
76
|
+
]), A = t.object({
|
|
77
|
+
name: t.string(),
|
|
78
|
+
iconUrl: t.string(),
|
|
79
|
+
address: e
|
|
69
80
|
}), o = t.discriminatedUnion("type", [
|
|
70
81
|
t.object({
|
|
71
82
|
type: t.literal("deploy"),
|
|
@@ -98,10 +109,17 @@ const r = t.object({
|
|
|
98
109
|
t.object({
|
|
99
110
|
type: t.literal("dappInteraction"),
|
|
100
111
|
dappAddress: e,
|
|
101
|
-
function:
|
|
112
|
+
function: v.optional().nullable()
|
|
102
113
|
// This object is often null. It happens when we were unable to get the ABI or failed decoding the function call
|
|
114
|
+
}),
|
|
115
|
+
t.object({
|
|
116
|
+
type: t.literal("staking"),
|
|
117
|
+
stakingAction: k,
|
|
118
|
+
counterparty: e,
|
|
119
|
+
asset: a,
|
|
120
|
+
stakerInfo: A
|
|
103
121
|
})
|
|
104
|
-
]),
|
|
122
|
+
]), w = t.union([
|
|
105
123
|
o,
|
|
106
124
|
t.object({
|
|
107
125
|
type: t.literal("multicall"),
|
|
@@ -109,7 +127,7 @@ const r = t.object({
|
|
|
109
127
|
details: o
|
|
110
128
|
}))
|
|
111
129
|
})
|
|
112
|
-
]),
|
|
130
|
+
]), N = t.object({
|
|
113
131
|
dappId: t.string(),
|
|
114
132
|
name: t.string().optional().nullable()
|
|
115
133
|
}), c = t.object({
|
|
@@ -135,7 +153,7 @@ const r = t.object({
|
|
|
135
153
|
}).optional().nullable()
|
|
136
154
|
})
|
|
137
155
|
])
|
|
138
|
-
}),
|
|
156
|
+
}), I = t.object({
|
|
139
157
|
type: t.string(),
|
|
140
158
|
// "gas" for example
|
|
141
159
|
to: e,
|
|
@@ -148,39 +166,40 @@ const r = t.object({
|
|
|
148
166
|
currencyAmount: t.number()
|
|
149
167
|
}).optional().nullable()
|
|
150
168
|
})
|
|
151
|
-
}), l = t.enum(["pending", "success", "failure"]),
|
|
169
|
+
}), l = t.enum(["pending", "success", "failure"]), p = t.object({
|
|
152
170
|
compositeId: t.string(),
|
|
153
171
|
id: t.string().uuid(),
|
|
154
172
|
status: l,
|
|
155
173
|
wallet: e,
|
|
156
174
|
txSender: e,
|
|
157
175
|
source: t.string(),
|
|
158
|
-
type:
|
|
176
|
+
type: h,
|
|
159
177
|
group: t.enum(["finance", "security"]),
|
|
160
178
|
submitted: t.number(),
|
|
161
179
|
lastModified: t.number(),
|
|
162
180
|
transaction: r,
|
|
163
|
-
transfers: t.array(
|
|
181
|
+
transfers: t.array(y),
|
|
164
182
|
// to be clarified
|
|
165
|
-
fees: t.array(
|
|
166
|
-
relatedAddresses: t.array(
|
|
183
|
+
fees: t.array(I).optional(),
|
|
184
|
+
relatedAddresses: t.array(b).nullable(),
|
|
167
185
|
network: t.string(),
|
|
168
|
-
networkDetails:
|
|
169
|
-
details:
|
|
186
|
+
networkDetails: S.optional(),
|
|
187
|
+
details: w,
|
|
170
188
|
transferSummary: t.array(c).optional(),
|
|
171
|
-
dapp:
|
|
189
|
+
dapp: N.optional(),
|
|
172
190
|
actions: t.array(m).optional(),
|
|
173
191
|
title: t.string().optional(),
|
|
174
192
|
multisigDetails: t.object({
|
|
175
193
|
signers: t.array(e)
|
|
176
194
|
}).optional()
|
|
177
|
-
}),
|
|
195
|
+
}), T = t.object({
|
|
178
196
|
title: t.string().optional(),
|
|
179
197
|
shortTitle: t.string().optional(),
|
|
180
198
|
subtitle: t.string().optional(),
|
|
181
199
|
/** let's not import the keys from x-ui here */
|
|
182
|
-
icon: t.string().optional()
|
|
183
|
-
|
|
200
|
+
icon: t.string().optional(),
|
|
201
|
+
investment: g.optional()
|
|
202
|
+
}), D = "native", E = "rejected", P = "cancelled", x = "queued", B = p.pick({
|
|
184
203
|
status: !0,
|
|
185
204
|
actions: !0,
|
|
186
205
|
submitted: !0,
|
|
@@ -192,45 +211,45 @@ const r = t.object({
|
|
|
192
211
|
status: t.union([
|
|
193
212
|
l,
|
|
194
213
|
t.enum([
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
214
|
+
E,
|
|
215
|
+
P,
|
|
216
|
+
x
|
|
198
217
|
])
|
|
199
218
|
]),
|
|
200
|
-
type: t.literal(
|
|
219
|
+
type: t.literal(D),
|
|
201
220
|
transaction: r.pick({
|
|
202
221
|
hash: !0
|
|
203
222
|
}),
|
|
204
223
|
dapp: d.optional(),
|
|
205
|
-
meta:
|
|
206
|
-
}),
|
|
207
|
-
activities:
|
|
224
|
+
meta: T.optional()
|
|
225
|
+
}), M = t.array(p), F = t.object({
|
|
226
|
+
activities: M,
|
|
208
227
|
page: t.number(),
|
|
209
228
|
pageSize: t.number(),
|
|
210
229
|
totalElements: t.number(),
|
|
211
230
|
totalPages: t.number()
|
|
212
231
|
});
|
|
213
|
-
function
|
|
232
|
+
function K(n) {
|
|
214
233
|
return s.safeParse(n).success;
|
|
215
234
|
}
|
|
216
|
-
const
|
|
235
|
+
const u = (n) => c.safeParse(n).success, R = (n) => u(n) && n.asset.type === "token", q = (n) => u(n) && n.asset.type === "nft";
|
|
217
236
|
export {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
237
|
+
P as NativeActivityStatusCancelled,
|
|
238
|
+
x as NativeActivityStatusQueued,
|
|
239
|
+
E as NativeActivityStatusRejected,
|
|
240
|
+
D as NativeActivityTypeNative,
|
|
241
|
+
M as activitiesSchema,
|
|
242
|
+
N as activityDappSchema,
|
|
243
|
+
w as activityDetailsSchema,
|
|
244
|
+
F as activityResponseSchema,
|
|
245
|
+
p as activitySchema,
|
|
227
246
|
c as activitySummarySchema,
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
247
|
+
y as activityTransferSchema,
|
|
248
|
+
I as feeSchema,
|
|
249
|
+
K as isActivityDetailsAction,
|
|
250
|
+
u as isActivitySummary,
|
|
251
|
+
q as isNftActivitySummary,
|
|
252
|
+
R as isTokenActivitySummary,
|
|
253
|
+
T as nativeActivityMetaSchema,
|
|
254
|
+
B as nativeActivitySchema
|
|
236
255
|
};
|
|
@@ -39,6 +39,8 @@ export declare const SwapQuoteResponseSchema: z.ZodObject<{
|
|
|
39
39
|
quoteId: string;
|
|
40
40
|
};
|
|
41
41
|
feeToken: `0x${string}`;
|
|
42
|
+
argentFee: string;
|
|
43
|
+
providerFee: string;
|
|
42
44
|
sellToken: `0x${string}`;
|
|
43
45
|
buyToken: `0x${string}`;
|
|
44
46
|
routes: any[];
|
|
@@ -50,10 +52,8 @@ export declare const SwapQuoteResponseSchema: z.ZodObject<{
|
|
|
50
52
|
expiresIn: number;
|
|
51
53
|
dexCount: number;
|
|
52
54
|
providerName: string;
|
|
53
|
-
providerFee: string;
|
|
54
55
|
providerFeeInCurrency: string;
|
|
55
56
|
providerFeePercentage: number;
|
|
56
|
-
argentFee: string;
|
|
57
57
|
argentFeeInCurrency: string;
|
|
58
58
|
argentFeePercentage: number;
|
|
59
59
|
}, {
|
|
@@ -61,6 +61,8 @@ export declare const SwapQuoteResponseSchema: z.ZodObject<{
|
|
|
61
61
|
quoteId: string;
|
|
62
62
|
};
|
|
63
63
|
feeToken: string;
|
|
64
|
+
argentFee: string;
|
|
65
|
+
providerFee: string;
|
|
64
66
|
sellToken: string;
|
|
65
67
|
buyToken: string;
|
|
66
68
|
routes: any[];
|
|
@@ -72,10 +74,8 @@ export declare const SwapQuoteResponseSchema: z.ZodObject<{
|
|
|
72
74
|
expiresIn: number;
|
|
73
75
|
dexCount: number;
|
|
74
76
|
providerName: string;
|
|
75
|
-
providerFee: string;
|
|
76
77
|
providerFeeInCurrency: string;
|
|
77
78
|
providerFeePercentage: number;
|
|
78
|
-
argentFee: string;
|
|
79
79
|
argentFeeInCurrency: string;
|
|
80
80
|
argentFeePercentage: number;
|
|
81
81
|
}>;
|
|
@@ -103,6 +103,7 @@ export declare const TradeSchema: z.ZodObject<{
|
|
|
103
103
|
data: {
|
|
104
104
|
quoteId: string;
|
|
105
105
|
};
|
|
106
|
+
totalFee: string;
|
|
106
107
|
expiresAt: number;
|
|
107
108
|
expiresIn: number;
|
|
108
109
|
payToken: {
|
|
@@ -136,7 +137,6 @@ export declare const TradeSchema: z.ZodObject<{
|
|
|
136
137
|
receiveAmount: string;
|
|
137
138
|
payAmountInCurrency: string;
|
|
138
139
|
receiveAmountInCurrency: string;
|
|
139
|
-
totalFee: string;
|
|
140
140
|
totalFeePercentage: number;
|
|
141
141
|
totalFeeInCurrency?: string | undefined;
|
|
142
142
|
route?: any;
|
|
@@ -144,6 +144,7 @@ export declare const TradeSchema: z.ZodObject<{
|
|
|
144
144
|
data: {
|
|
145
145
|
quoteId: string;
|
|
146
146
|
};
|
|
147
|
+
totalFee: string;
|
|
147
148
|
expiresAt: number;
|
|
148
149
|
expiresIn: number;
|
|
149
150
|
payToken: {
|
|
@@ -176,7 +177,6 @@ export declare const TradeSchema: z.ZodObject<{
|
|
|
176
177
|
receiveAmount: string;
|
|
177
178
|
payAmountInCurrency: string;
|
|
178
179
|
receiveAmountInCurrency: string;
|
|
179
|
-
totalFee: string;
|
|
180
180
|
totalFeePercentage: number;
|
|
181
181
|
tradeType?: TradeType | undefined;
|
|
182
182
|
totalFeeInCurrency?: string | undefined;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './schema';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),i=require("../utils/starknet/starknet.cjs"),t=require("../chains/starknet/address.cjs"),n=e.z.object({id:e.z.string(),dappId:e.z.string(),productId:e.z.string(),productName:e.z.string(),chain:e.z.string(),name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url().optional(),riskFactor:e.z.enum(["low"]),metrics:e.z.object({baseApy:e.z.string(),totalApy:e.z.string(),tvl:e.z.string().optional()}),incentives:e.z.array(e.z.object({name:e.z.string(),description:e.z.string(),iconUrl:e.z.string().url(),learnMoreUrl:e.z.string().url(),metric:e.z.object({apy:e.z.string()})})),buyEnabled:e.z.boolean(),sellEnabled:e.z.boolean()}),s=n.extend({category:e.z.literal("staking"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({protocolFee:e.z.string().nullable().optional(),totalFee:e.z.string()})})}),o=n.extend({category:e.z.literal("lending"),investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"])}),fees:e.z.object({depositFees:e.z.object({totalFee:e.z.string()}),withdrawalFees:e.z.object({totalFee:e.z.string()})})}),r=e.z.object({name:e.z.string(),iconUrl:e.z.string().url(),address:e.z.string()}),a=n.extend({category:e.z.literal("strkDelegatedStaking"),stakerInfo:r,investableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional()}),withdrawableAssets:e.z.object({tokenAddresses:e.z.array(t.addressSchemaArgentBackend),tokensRequirement:e.z.enum(["any"]),useDecomposedBalances:e.z.boolean().optional(),amountsRequirement:e.z.enum(["fullBalance"]).optional(),timelockDuration:e.z.number().optional()}),fees:e.z.object({depositFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),withdrawalFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}),performanceFees:e.z.object({argentFee:e.z.string().nullable().optional(),protocolFee:e.z.string().nullable().optional(),providerFee:e.z.string().nullable().optional(),totalFee:e.z.string()}).optional()}),claimEnabled:e.z.boolean().optional()}),l=e.z.discriminatedUnion("category",[s,o,a]),c=e.z.object({investments:e.z.array(l)}),d=e.z.object({calls:e.z.array(i.callSchema)}),z=e.z.object({investment:a,accountAddress:t.addressSchemaArgentBackend,tokenAddress:t.addressSchemaArgentBackend,amount:e.z.string(),useFullBalance:e.z.boolean()}),m=e.z.object({stakerInfo:r,tokenAddress:t.addressSchema,amount:e.z.string()});exports.buildBuyCalldataResponseSchema=d;exports.buildBuyCalldataSchema=z;exports.investmentMetaSchema=m;exports.investmentSchema=l;exports.investmentsResponseSchema=c;exports.lendingInvestmentSchema=o;exports.stakingInvestmentSchema=s;exports.strkDelegatedStakingInvestmentSchema=a;
|