@argent/x-shared 1.70.1 → 1.70.3
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),z=require("../utils/starknet/starknet.cjs"),t=require("../chains/starknet/address.cjs"),a=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=a.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()}),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()})}),o=a.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()})})}),n=e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().url().optional(),address:e.z.string().optional()}),r=a.extend({category:e.z.literal("strkDelegatedStaking"),stakerInfo:n,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()}),buyEnabled:e.z.boolean().optional(),sellEnabled:e.z.boolean().optional(),claimEnabled:e.z.boolean().optional()}),l=e.z.discriminatedUnion("category",[s,o,r]),d=e.z.object({investments:e.z.array(l)}),g=e.z.object({calls:e.z.array(z.callSchema)}),m=e.z.object({investmentId:e.z.string(),investmentType:e.z.enum(["staking","lending","strkDelegatedStaking"]).optional(),accountAddress:t.addressSchemaArgentBackend,tokenAddress:t.addressSchemaArgentBackend,stakerInfo:n,amount:e.z.string()}),i=e.z.enum(["deposit","stake","initiateWithdraw","withdraw","claim"]),c=e.z.object({useFullBalance:e.z.boolean().optional(),subsequentTransaction:e.z.boolean().optional()}),b=e.z.object({investmentId:e.z.string().optional(),stakingAction:i,stakerInfo:n,tokenAddress:t.addressSchema,amount:e.z.string(),...c.shape});exports.buildSellOptsSchema=c;exports.investmentMetaSchema=b;exports.investmentSchema=l;exports.investmentsResponseSchema=d;exports.lendingInvestmentSchema=o;exports.liquidStakingInvestmentSchema=s;exports.stakerInfoSchema=n;exports.stakingActionSchema=i;exports.strkDelegatedStakingInvestmentSchema=r;exports.strkStakingCalldataResponseSchema=g;exports.strkStakingCalldataSchema=m;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),z=require("../utils/starknet/starknet.cjs"),t=require("../chains/starknet/address.cjs"),a=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=a.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()}),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()})}),o=a.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"])}),claimRewardsUrl:e.z.string().url().optional(),fees:e.z.object({depositFees:e.z.object({totalFee:e.z.string()}),withdrawalFees:e.z.object({totalFee:e.z.string()})})}),n=e.z.object({name:e.z.string().optional(),iconUrl:e.z.string().url().optional(),address:e.z.string().optional()}),r=a.extend({category:e.z.literal("strkDelegatedStaking"),stakerInfo:n,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()}),buyEnabled:e.z.boolean().optional(),sellEnabled:e.z.boolean().optional(),claimEnabled:e.z.boolean().optional()}),l=e.z.discriminatedUnion("category",[s,o,r]),d=e.z.object({investments:e.z.array(l)}),g=e.z.object({calls:e.z.array(z.callSchema)}),m=e.z.object({investmentId:e.z.string(),investmentType:e.z.enum(["staking","lending","strkDelegatedStaking"]).optional(),accountAddress:t.addressSchemaArgentBackend,tokenAddress:t.addressSchemaArgentBackend,stakerInfo:n,amount:e.z.string()}),i=e.z.enum(["deposit","stake","initiateWithdraw","withdraw","claim"]),c=e.z.object({useFullBalance:e.z.boolean().optional(),subsequentTransaction:e.z.boolean().optional()}),b=e.z.object({investmentId:e.z.string().optional(),stakingAction:i,stakerInfo:n,tokenAddress:t.addressSchema,amount:e.z.string(),...c.shape});exports.buildSellOptsSchema=c;exports.investmentMetaSchema=b;exports.investmentSchema=l;exports.investmentsResponseSchema=d;exports.lendingInvestmentSchema=o;exports.liquidStakingInvestmentSchema=s;exports.stakerInfoSchema=n;exports.stakingActionSchema=i;exports.strkDelegatedStakingInvestmentSchema=r;exports.strkStakingCalldataResponseSchema=g;exports.strkStakingCalldataSchema=m;
|
|
@@ -326,6 +326,7 @@ export declare const lendingInvestmentSchema: z.ZodObject<z.objectUtil.extendSha
|
|
|
326
326
|
tokenAddresses: string[];
|
|
327
327
|
tokensRequirement: "any";
|
|
328
328
|
}>;
|
|
329
|
+
claimRewardsUrl: z.ZodOptional<z.ZodString>;
|
|
329
330
|
fees: z.ZodObject<{
|
|
330
331
|
depositFees: z.ZodObject<{
|
|
331
332
|
totalFee: z.ZodString;
|
|
@@ -400,6 +401,7 @@ export declare const lendingInvestmentSchema: z.ZodObject<z.objectUtil.extendSha
|
|
|
400
401
|
};
|
|
401
402
|
};
|
|
402
403
|
learnMoreUrl?: string | undefined;
|
|
404
|
+
claimRewardsUrl?: string | undefined;
|
|
403
405
|
}, {
|
|
404
406
|
name: string;
|
|
405
407
|
chain: string;
|
|
@@ -444,6 +446,7 @@ export declare const lendingInvestmentSchema: z.ZodObject<z.objectUtil.extendSha
|
|
|
444
446
|
};
|
|
445
447
|
};
|
|
446
448
|
learnMoreUrl?: string | undefined;
|
|
449
|
+
claimRewardsUrl?: string | undefined;
|
|
447
450
|
}>;
|
|
448
451
|
export declare const stakerInfoSchema: z.ZodObject<{
|
|
449
452
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1111,6 +1114,7 @@ export declare const investmentSchema: z.ZodDiscriminatedUnion<"category", [z.Zo
|
|
|
1111
1114
|
tokenAddresses: string[];
|
|
1112
1115
|
tokensRequirement: "any";
|
|
1113
1116
|
}>;
|
|
1117
|
+
claimRewardsUrl: z.ZodOptional<z.ZodString>;
|
|
1114
1118
|
fees: z.ZodObject<{
|
|
1115
1119
|
depositFees: z.ZodObject<{
|
|
1116
1120
|
totalFee: z.ZodString;
|
|
@@ -1185,6 +1189,7 @@ export declare const investmentSchema: z.ZodDiscriminatedUnion<"category", [z.Zo
|
|
|
1185
1189
|
};
|
|
1186
1190
|
};
|
|
1187
1191
|
learnMoreUrl?: string | undefined;
|
|
1192
|
+
claimRewardsUrl?: string | undefined;
|
|
1188
1193
|
}, {
|
|
1189
1194
|
name: string;
|
|
1190
1195
|
chain: string;
|
|
@@ -1229,6 +1234,7 @@ export declare const investmentSchema: z.ZodDiscriminatedUnion<"category", [z.Zo
|
|
|
1229
1234
|
};
|
|
1230
1235
|
};
|
|
1231
1236
|
learnMoreUrl?: string | undefined;
|
|
1237
|
+
claimRewardsUrl?: string | undefined;
|
|
1232
1238
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
1233
1239
|
id: z.ZodString;
|
|
1234
1240
|
dappId: z.ZodString;
|
|
@@ -1886,6 +1892,7 @@ export declare const investmentsResponseSchema: z.ZodObject<{
|
|
|
1886
1892
|
tokenAddresses: string[];
|
|
1887
1893
|
tokensRequirement: "any";
|
|
1888
1894
|
}>;
|
|
1895
|
+
claimRewardsUrl: z.ZodOptional<z.ZodString>;
|
|
1889
1896
|
fees: z.ZodObject<{
|
|
1890
1897
|
depositFees: z.ZodObject<{
|
|
1891
1898
|
totalFee: z.ZodString;
|
|
@@ -1960,6 +1967,7 @@ export declare const investmentsResponseSchema: z.ZodObject<{
|
|
|
1960
1967
|
};
|
|
1961
1968
|
};
|
|
1962
1969
|
learnMoreUrl?: string | undefined;
|
|
1970
|
+
claimRewardsUrl?: string | undefined;
|
|
1963
1971
|
}, {
|
|
1964
1972
|
name: string;
|
|
1965
1973
|
chain: string;
|
|
@@ -2004,6 +2012,7 @@ export declare const investmentsResponseSchema: z.ZodObject<{
|
|
|
2004
2012
|
};
|
|
2005
2013
|
};
|
|
2006
2014
|
learnMoreUrl?: string | undefined;
|
|
2015
|
+
claimRewardsUrl?: string | undefined;
|
|
2007
2016
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
2008
2017
|
id: z.ZodString;
|
|
2009
2018
|
dappId: z.ZodString;
|
|
@@ -2427,6 +2436,7 @@ export declare const investmentsResponseSchema: z.ZodObject<{
|
|
|
2427
2436
|
};
|
|
2428
2437
|
};
|
|
2429
2438
|
learnMoreUrl?: string | undefined;
|
|
2439
|
+
claimRewardsUrl?: string | undefined;
|
|
2430
2440
|
} | {
|
|
2431
2441
|
name: string;
|
|
2432
2442
|
chain: string;
|
|
@@ -2591,6 +2601,7 @@ export declare const investmentsResponseSchema: z.ZodObject<{
|
|
|
2591
2601
|
};
|
|
2592
2602
|
};
|
|
2593
2603
|
learnMoreUrl?: string | undefined;
|
|
2604
|
+
claimRewardsUrl?: string | undefined;
|
|
2594
2605
|
} | {
|
|
2595
2606
|
name: string;
|
|
2596
2607
|
chain: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./isNumeric.cjs"),i=(e,r=16)=>e===""?!0:!t.isNumeric(e)||e.length>1&&e[0]==="0"&&e[1]!=="."||e.startsWith(".")?!1:new RegExp(`^[0-9]*.?[0-9]{0,${r}}$`).test(e);exports.isAllowedNumericInputValue=i;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import { isNumeric as
|
|
2
|
-
const
|
|
3
|
-
const t = new RegExp(`^[0-9]*.?[0-9]{0,${r}}$`);
|
|
4
|
-
return e === "" ? !0 : i(e) ? !!t.test(e) : !1;
|
|
5
|
-
};
|
|
1
|
+
import { isNumeric as t } from "./isNumeric.js";
|
|
2
|
+
const s = (r, e = 16) => r === "" ? !0 : !t(r) || r.length > 1 && r[0] === "0" && r[1] !== "." || r.startsWith(".") ? !1 : new RegExp(`^[0-9]*.?[0-9]{0,${e}}$`).test(r);
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
s as isAllowedNumericInputValue
|
|
8
5
|
};
|