@argent/x-shared 1.35.0 → 1.37.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/{bips-zBtnMbia.mjs → bips-DKbEGvGl.mjs} +9 -9
- package/dist/{bips-CP71ZN9a.js → bips-DxN0hSiY.js} +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +440 -425
- package/dist/simulation.js +1 -1
- package/dist/simulation.mjs +13 -13
- package/dist/swap.js +1 -1
- package/dist/swap.mjs +2 -2
- package/dist/tokens/getCurrencySymbol.d.ts +2 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/service/implementation.d.ts +192 -12
- package/dist/tokens/service/types/backend.model.d.ts +7562 -555
- package/dist/tokens/service/types/defiPosition.model.d.ts +11 -11
- package/dist/tokens/service/types/defiPositionType.model.d.ts +1 -1
- package/dist/{transactionVersion-CaRQ5Df4.js → transactionVersion-C7p_qk9x.js} +1 -1
- package/dist/{transactionVersion-CACUj2ch.mjs → transactionVersion-Cjoucwcx.mjs} +7 -7
- package/dist/utils/schemas.d.ts +8 -0
- package/dist/webToken.model-5HUiR8ER.js +1 -0
- package/dist/{webToken.model-Cl4dvcmj.mjs → webToken.model-CpudLBp0.mjs} +646 -614
- package/package.json +6 -6
- package/dist/webToken.model-Dsd8Rd3e.js +0 -1
|
@@ -1805,7 +1805,7 @@ export declare const productGroupsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
|
1805
1805
|
healthRatio?: string | undefined;
|
|
1806
1806
|
}>>;
|
|
1807
1807
|
export declare const defiProductSchema: z.ZodObject<{
|
|
1808
|
-
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">]>;
|
|
1808
|
+
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"staking">]>;
|
|
1809
1809
|
manageUrl: z.ZodOptional<z.ZodString>;
|
|
1810
1810
|
name: z.ZodString;
|
|
1811
1811
|
positions: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -2390,7 +2390,7 @@ export declare const defiProductSchema: z.ZodObject<{
|
|
|
2390
2390
|
accountAddress: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
|
|
2391
2391
|
}, "strip", z.ZodTypeAny, {
|
|
2392
2392
|
name: string;
|
|
2393
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
2393
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
2394
2394
|
accountAddress: `0x${string}`;
|
|
2395
2395
|
positions: ({
|
|
2396
2396
|
poolFeePercentage: string;
|
|
@@ -2514,7 +2514,7 @@ export declare const defiProductSchema: z.ZodObject<{
|
|
|
2514
2514
|
}> | undefined;
|
|
2515
2515
|
}, {
|
|
2516
2516
|
name: string;
|
|
2517
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
2517
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
2518
2518
|
accountAddress: string;
|
|
2519
2519
|
positions: ({
|
|
2520
2520
|
poolFeePercentage: string;
|
|
@@ -2638,7 +2638,7 @@ export declare const defiProductSchema: z.ZodObject<{
|
|
|
2638
2638
|
}> | undefined;
|
|
2639
2639
|
}>;
|
|
2640
2640
|
export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
|
|
2641
|
-
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">]>;
|
|
2641
|
+
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"staking">]>;
|
|
2642
2642
|
manageUrl: z.ZodOptional<z.ZodString>;
|
|
2643
2643
|
name: z.ZodString;
|
|
2644
2644
|
positions: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -3223,7 +3223,7 @@ export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
|
|
|
3223
3223
|
accountAddress: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
|
|
3224
3224
|
}, "strip", z.ZodTypeAny, {
|
|
3225
3225
|
name: string;
|
|
3226
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
3226
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
3227
3227
|
accountAddress: `0x${string}`;
|
|
3228
3228
|
positions: ({
|
|
3229
3229
|
poolFeePercentage: string;
|
|
@@ -3347,7 +3347,7 @@ export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
|
|
|
3347
3347
|
}> | undefined;
|
|
3348
3348
|
}, {
|
|
3349
3349
|
name: string;
|
|
3350
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
3350
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
3351
3351
|
accountAddress: string;
|
|
3352
3352
|
positions: ({
|
|
3353
3353
|
poolFeePercentage: string;
|
|
@@ -3473,7 +3473,7 @@ export declare const defiProductsSchema: z.ZodArray<z.ZodObject<{
|
|
|
3473
3473
|
export declare const defiDappsProductsSchema: z.ZodObject<{
|
|
3474
3474
|
dappId: z.ZodString;
|
|
3475
3475
|
products: z.ZodArray<z.ZodObject<{
|
|
3476
|
-
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">]>;
|
|
3476
|
+
type: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"staking">]>;
|
|
3477
3477
|
manageUrl: z.ZodOptional<z.ZodString>;
|
|
3478
3478
|
name: z.ZodString;
|
|
3479
3479
|
positions: z.ZodArray<z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
@@ -4058,7 +4058,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
|
|
|
4058
4058
|
accountAddress: z.ZodEffects<z.ZodPipeline<z.ZodString, z.ZodEffects<z.ZodString, string, string>>, `0x${string}`, string>;
|
|
4059
4059
|
}, "strip", z.ZodTypeAny, {
|
|
4060
4060
|
name: string;
|
|
4061
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
4061
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
4062
4062
|
accountAddress: `0x${string}`;
|
|
4063
4063
|
positions: ({
|
|
4064
4064
|
poolFeePercentage: string;
|
|
@@ -4182,7 +4182,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
|
|
|
4182
4182
|
}> | undefined;
|
|
4183
4183
|
}, {
|
|
4184
4184
|
name: string;
|
|
4185
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
4185
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
4186
4186
|
accountAddress: string;
|
|
4187
4187
|
positions: ({
|
|
4188
4188
|
poolFeePercentage: string;
|
|
@@ -4309,7 +4309,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
|
|
|
4309
4309
|
dappId: string;
|
|
4310
4310
|
products: {
|
|
4311
4311
|
name: string;
|
|
4312
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
4312
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
4313
4313
|
accountAddress: `0x${string}`;
|
|
4314
4314
|
positions: ({
|
|
4315
4315
|
poolFeePercentage: string;
|
|
@@ -4436,7 +4436,7 @@ export declare const defiDappsProductsSchema: z.ZodObject<{
|
|
|
4436
4436
|
dappId: string;
|
|
4437
4437
|
products: {
|
|
4438
4438
|
name: string;
|
|
4439
|
-
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition";
|
|
4439
|
+
type: "concentratedLiquidityPosition" | "collateralizedDebtPosition" | "staking";
|
|
4440
4440
|
accountAddress: string;
|
|
4441
4441
|
positions: ({
|
|
4442
4442
|
poolFeePercentage: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">]>;
|
|
2
|
+
export declare const defiPositionTypeSchema: z.ZodUnion<[z.ZodLiteral<"concentratedLiquidityPosition">, z.ZodLiteral<"collateralizedDebtPosition">, z.ZodLiteral<"staking">]>;
|
|
3
3
|
export type DefiPositionType = z.infer<typeof defiPositionTypeSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("zod"),a=require("./webToken.model-Dsd8Rd3e.js"),l=require("starknet"),C=require("lodash-es");require("@scure/base");require("react");require("object-hash");require("swr");const vt="0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",Et="0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",kt="0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003",It="0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f",Nt="0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48",wt="0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72",jt="0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f";var B={};function m(e,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Dt=m;m.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};m.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};m.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var n=new Date().getTime();if(e&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0};m.prototype.attempt=function(e,n){this._fn=e,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};m.prototype.try=function(e){this.attempt(e)};m.prototype.start=function(e){this.attempt(e)};m.prototype.start=m.prototype.try;m.prototype.errors=function(){return this._errors};m.prototype.attempts=function(){return this._attempts};m.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},n=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],c=s.message,o=(e[c]||0)+1;e[c]=o,o>=i&&(n=s,i=o)}return n};(function(e){var n=Dt;e.operation=function(i){var r=e.timeouts(i);return new n(r,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})},e.timeouts=function(i){if(i instanceof Array)return[].concat(i);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in i)r[s]=i[s];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var c=[],o=0;o<r.retries;o++)c.push(this.createTimeout(o,r));return i&&i.forever&&!c.length&&c.push(this.createTimeout(o,r)),c.sort(function(u,g){return u-g}),c},e.createTimeout=function(i,r){var s=r.randomize?Math.random()+1:1,c=Math.round(s*Math.max(r.minTimeout,1)*Math.pow(r.factor,i));return c=Math.min(c,r.maxTimeout),c},e.wrap=function(i,r,s){if(r instanceof Array&&(s=r,r=null),!s){s=[];for(var c in i)typeof i[c]=="function"&&s.push(c)}for(var o=0;o<s.length;o++){var u=s[o],g=i[u];i[u]=(function(_t){var h=e.operation(r),S=Array.prototype.slice.call(arguments,1),Tt=S.pop();S.push(function(P){h.retry(P)||(P&&(arguments[0]=h.mainError()),Tt.apply(this,arguments))}),h.attempt(function(){_t.apply(i,S)})}).bind(i,g),i[u].options=r}}})(B);exports.TOKEN_ERROR_MESSAGES=void 0;(function(e){e.NO_TOKEN_API_URL="NO_TOKEN_API_URL is not defined",e.NO_TOKEN_PRICE_API_URL="NO_TOKEN_PRICE_API_URL is not defined",e.TOKENS_DEFI_DECOMPOSITION_URL="TOKENS_DEFI_DECOMPOSITION_URL is not defined",e.TOKENS_AIRDROPS_API_URL="TOKENS_AIRDROPS_API_URL is not defined",e.TOKEN_PARSING_ERROR="Unable to parse token data response",e.TOKEN_PRICE_PARSING_ERROR="Unable to parse token price response",e.TOKEN_DEFI_DECOMPOSITION_PARSING_ERROR="Unable to parse token defi decomposition response",e.TOKEN_PRICE_NOT_FOUND="Token price not found",e.TOKEN_NOT_FOUND="Token not found",e.TOKEN_DETAILS_NOT_FOUND="Token details not found",e.FEE_TOKEN_NOT_FOUND="Fee token not found",e.UNABLE_TO_CALCULATE_CURRENCY_VALUE="Unable to calculate currency value",e.UNSAFE_DECIMALS="Unsafe decimals in token"})(exports.TOKEN_ERROR_MESSAGES||(exports.TOKEN_ERROR_MESSAGES={}));class Ot extends a.BaseError{constructor(n){super(n,exports.TOKEN_ERROR_MESSAGES),this.name="TokenError"}}const U=a.webTokenWithBalanceAndPriceSchema.extend({accruedFees:t.z.string(),currentPrice:t.z.string(),maxPrice:t.z.string(),minPrice:t.z.string(),principal:t.z.string()}),L=t.z.object({address:a.addressSchema.optional(),currencyValue:t.z.string().default("0")}),T=L.extend({poolFeePercentage:t.z.string(),tickSpacingPercentage:t.z.string().optional(),tokenId:t.z.string().optional(),unitCurrencyValueToken0:t.z.string().optional(),unitCurrencyValueToken1:t.z.string().optional(),token0:U,token1:U}),Rt=t.z.array(T),Pt=t.z.object({name:t.z.string().optional(),healthRatio:t.z.string().optional(),accountAddress:a.addressSchema.optional()}),v=L.extend({totalBalances:t.z.record(t.z.string()),collateral:t.z.boolean(),debt:t.z.boolean(),lending:t.z.boolean(),apy:t.z.string().optional(),group:t.z.string().optional(),unitCurrencyValue:t.z.string().optional(),positionToken:a.apiTokenInfoSchema.or(t.z.undefined()),token:a.webTokenWithBalanceAndPriceSchema.optional(),accountAddress:a.addressSchema.optional(),accountAddressGroup:t.z.string().optional()}),Ct=t.z.array(v),V=T.or(v),H=t.z.record(t.z.object({name:t.z.string().optional(),healthRatio:t.z.string().optional(),accountAddress:a.addressSchema.optional()})),M=t.z.object({type:a.defiPositionTypeSchema,manageUrl:t.z.string().url().optional(),name:t.z.string(),positions:t.z.array(V),positionsTotalValue:t.z.string(),brandColor:t.z.string().optional(),groups:H.optional(),accountAddress:a.addressSchema}),K=t.z.array(M),Ut=t.z.object({dappId:t.z.string(),products:K}),G=t.z.object({name:t.z.string().optional(),tokenAddress:a.addressSchema,token:a.apiTokenInfoSchema.optional(),amount:t.z.string().optional(),claimUrl:t.z.string().optional(),claimStart:t.z.number(),claimEnd:t.z.number().optional()}),Ft=t.z.array(G),q=(e,n=18)=>a.parseUnits(e.replace(",","."),Number(n)),X=t.z.string().trim().refine(e=>e!=="",{message:"Amount is required"}).refine(e=>{try{const n=q(e).value;if(n<0n)throw new Error("Amount must be positive");if(n===0n)throw new Error("Amount can not be zero");if(n>l.uint256.UINT_256_MAX)throw new Error("Amount is too big")}catch{throw new Error("Amount should be a number")}return!0},{message:"Invalid amount"}),xt=e=>!!X.parse(e),W=t.z.object({data:t.z.object({code:t.z.string().optional(),name:t.z.string().optional(),message:t.z.string()})}),Bt=e=>{const n=W.safeParse(e);if(n.success)return n.data.data.message},Lt=3,E=process.env.FEE_OVERHEAD?parseFloat(process.env.FEE_OVERHEAD):Lt,Vt=1.5,z=10,J=({estimatedFee:e,overheadMultiplier:n=E})=>{const r=l.num.toBigInt(e)*BigInt(n*z)/BigInt(z);return l.num.toHex(r)},Ht=({suggestedMaxFee:e,overheadMultiplier:n=E,starknetJsOverheadMultiplier:i=Vt})=>{const s=l.num.toBigInt(e)*BigInt(z)/BigInt(i*z);return J({estimatedFee:s,overheadMultiplier:n})};exports.ESTIMATE_ERROR_MESSAGES=void 0;(function(e){e.SIMULATE_AND_REVIEW_FAILED="Missing simulation"})(exports.ESTIMATE_ERROR_MESSAGES||(exports.ESTIMATE_ERROR_MESSAGES={}));class Mt extends a.BaseError{constructor(n){super(n,exports.ESTIMATE_ERROR_MESSAGES),this.name="EstimateError"}}const Kt=t.z.object({type:t.z.enum(["DECLARE","DEPLOY","DEPLOY_ACCOUNT","INVOKE"]).default("INVOKE"),calls:t.z.array(a.callSchema).or(a.callSchema).optional(),calldata:t.z.array(t.z.string()).optional(),classHash:a.hexSchema.optional(),salt:a.hexSchema.optional(),signature:t.z.array(t.z.string()).optional()}),Gt=t.z.object({amount:t.z.bigint(),pricePerUnit:t.z.bigint()}).or(t.z.object({maxFee:t.z.bigint()})),y=t.z.object({feeTokenAddress:a.addressSchema,amount:t.z.bigint(),pricePerUnit:t.z.bigint(),max:Gt.optional(),dataGasConsumed:t.z.bigint().optional(),dataGasPrice:t.z.bigint().optional()}),Y=t.z.object({deployment:y.optional(),transactions:y}),Q=t.z.union([t.z.literal("critical"),t.z.literal("high"),t.z.literal("caution"),t.z.literal("info")]),$=t.z.string(),qt=t.z.object({name:t.z.string(),url:t.z.string(),position:t.z.number()}),f=t.z.object({address:t.z.string(),name:t.z.string(),symbol:t.z.string().optional(),decimals:t.z.number().optional(),unknown:t.z.boolean(),iconUrl:t.z.string().optional(),type:t.z.string()}),b=t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("amount"),label:t.z.string(),token:f,amount:t.z.string(),usd:t.z.string(),editable:t.z.boolean()}),t.z.object({type:t.z.literal("address"),label:t.z.string(),address:t.z.string(),addressName:t.z.string().optional(),verified:t.z.boolean().optional()}),t.z.object({type:t.z.literal("timestamp"),label:t.z.string(),value:t.z.string()}),t.z.object({type:t.z.literal("token_address"),label:t.z.string(),token:f}),t.z.object({type:t.z.literal("calldata"),label:t.z.string(),entrypoint:t.z.string(),calldata:t.z.array(t.z.string())}),t.z.object({type:t.z.literal("text"),label:t.z.string(),text:t.z.string()}),t.z.object({type:t.z.literal("nft"),label:t.z.string(),token:f})]),k=t.z.object({name:t.z.string(),properties:t.z.array(b),defaultProperties:t.z.array(b).optional()}),Z=t.z.union([t.z.literal("verified"),t.z.literal("neutral"),t.z.literal("partial"),t.z.literal("warn")]),tt=t.z.object({unknown_token:t.z.unknown().optional(),date_of_addition:t.z.string().optional(),contract_address:a.addressSchema.optional(),reason:t.z.string().optional(),value:t.z.string().or(t.z.number()).optional()}),I=t.z.object({reason:$,details:tt.optional(),severity:Q}),et=t.z.object({assessment:Z,warnings:t.z.array(I).optional(),assessmentReasons:t.z.array(t.z.string()).optional(),assessmentDetails:t.z.object({contract_address:t.z.string()}).optional(),action:k}),N=t.z.object({name:t.z.string(),description:t.z.string(),logoUrl:t.z.string(),iconUrl:t.z.string(),argentVerified:t.z.boolean(),links:t.z.array(qt)}),nt=t.z.object({assessment:t.z.union([t.z.literal("verified"),t.z.literal("neutral"),t.z.literal("partial"),t.z.literal("warn")]),warnings:t.z.array(I).optional(),assessmentDetails:t.z.object({contract_address:t.z.string()}).optional(),targetedDapp:N.optional(),reviews:t.z.array(et)}).optional(),at=t.z.object({banner:t.z.string().nullable().optional(),preview:t.z.string().nullable().optional(),full:t.z.string().nullable().optional(),original:t.z.string().nullable().optional()}),Xt=t.z.object({twitter:t.z.string().optional(),external:t.z.string().optional(),discord:t.z.string().optional()}),w=t.z.object({address:a.addressSchemaArgentBackend,decimals:t.z.number().optional(),symbol:t.z.string().optional(),name:t.z.string(),description:t.z.string().optional(),type:t.z.string().optional(),usdValue:t.z.string().optional(),iconUrl:t.z.string().optional(),unknown:t.z.boolean().optional(),imageUrls:at.optional(),links:Xt.optional()}),Wt=t.z.object({tokenAddress:a.addressSchemaArgentBackend,owner:a.addressSchemaArgentBackend,spender:a.addressSchemaArgentBackend,value:t.z.string().optional(),approvalForAll:t.z.boolean(),details:w.optional()}),Jt=t.z.object({tokenAddress:a.addressSchemaArgentBackend,from:a.addressSchemaArgentBackend,to:a.addressSchemaArgentBackend,tokenId:t.z.string().optional(),value:t.z.string().optional(),details:w.optional()}),d=t.z.union([t.z.string(),t.z.number(),t.z.bigint()]).transform(e=>parseInt(e.toString(),10)),F={overallFee:d,gasPrice:d,gasUsage:d,dataGasPrice:d.optional(),dataGasConsumed:d.optional()},it=t.z.object({...F,unit:t.z.string().transform(e=>e.toUpperCase()).pipe(t.z.literal("WEI")),maxFee:d}).or(t.z.object({...F,unit:t.z.string().transform(e=>e.toUpperCase()).pipe(t.z.literal("FRI")),maxAmount:d,maxPricePerUnit:d})),Yt=t.z.object({type:t.z.string(),label:t.z.string(),tokenId:t.z.string().optional(),value:t.z.string().optional(),usdValue:t.z.string().optional(),token:w,sent:t.z.boolean().optional(),tokenIdDetails:t.z.object({name:t.z.string().optional(),description:t.z.string().optional(),imageUrls:at.optional()}).optional()}),Qt=t.z.object({approvals:t.z.array(Wt).optional(),transfers:t.z.array(Jt).optional(),calculatedNonce:t.z.string().optional(),feeEstimation:it,summary:t.z.array(Yt).optional()}),$t=t.z.object({label:t.z.string().optional(),code:t.z.number().optional(),message:t.z.string().optional(),error:t.z.string().optional()}),rt=t.z.object({reviewOfTransaction:nt,simulation:Qt,simulationError:t.z.undefined()}),ot=t.z.object({reviewOfTransaction:nt,simulation:t.z.undefined(),simulationError:$t}),st=rt.or(ot),Zt=t.z.object({transactions:t.z.array(st)}),te=t.z.object({transactions:t.z.array(st),enrichedFeeEstimation:Y.optional(),isBackendDown:t.z.boolean().default(!1).optional()});function ee(e){return rt.safeParse(e).success}function ne(e){return ot.safeParse(e).success}const ct=t.z.object({network:t.z.string(),hash:t.z.string(),status:t.z.string(),blockNumber:t.z.number().optional(),transactionIndex:t.z.number()}),p=t.z.object({type:t.z.enum(["token","nft"]),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()}),j=t.z.enum(["ethereum","starknet","zksync","zksync2"]),lt=t.z.object({type:t.z.enum(["payment","gasFee"]),leg:t.z.enum(["credit","debit"]),asset:p,counterParty:a.addressSchemaArgentBackend.optional(),counterPartyNetwork:j.optional()}),ae=t.z.object({address:a.addressSchemaArgentBackend,network:j,type:t.z.enum(["wallet","token"])}),ie=t.z.object({chainId:t.z.enum(["TESTNET","MAINNET","SEPOLIA"]),ethereumNetwork:t.z.enum(["mainnet","sepolia"])}),re=t.z.enum(["approval","changePubKey","dappInteraction","deploy","gift","multicall","payment","security","trade"]),mt=t.z.enum(["triggerEscapeGuardian","triggerEscapeSigner","escapeGuardian","escapeSigner","guardianChanged","guardianBackupChanged","signerChanged","cancelEscape","accountUpgraded","multisigConfigurationUpdated"]),oe=t.z.object({name:t.z.string(),parameters:t.z.array(t.z.unknown()).optional()}),se=t.z.object({guid:t.z.string().optional(),signerType:t.z.string().optional(),signer:t.z.object({publicKey:t.z.string().optional()}).optional()}),ce=t.z.object({activeAt:t.z.string().optional(),newGuardian:t.z.string().optional(),newImplementation:t.z.string().optional(),newVersion:t.z.string().optional(),signerGuid:t.z.string().optional(),signers:t.z.array(se).optional()}),x=t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("deploy"),deployer:a.addressSchemaArgentBackend,contractAddress:a.addressSchemaArgentBackend}),t.z.object({type:t.z.literal("approval"),spender:a.addressSchemaArgentBackend,asset:p,approvalType:t.z.string()}),t.z.object({type:t.z.literal("payment"),counterparty:a.addressSchemaArgentBackend,leg:t.z.string(),asset:p,counterpartyNetwork:j.optional()}),t.z.object({type:t.z.literal("trade"),srcAsset:p,destAsset:p}),t.z.object({type:t.z.literal("security"),action:mt,context:ce.optional()}),t.z.object({type:t.z.literal("dappInteraction"),dappAddress:a.addressSchemaArgentBackend,function:oe.optional().nullable()})]),ut=t.z.union([x,t.z.object({type:t.z.literal("multicall"),calls:t.z.array(t.z.object({details:x}))})]),dt=t.z.object({dappId:t.z.string(),name:t.z.string().optional().nullable()}),D=t.z.object({sent:t.z.boolean(),asset:t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("nft"),tokenAddress:a.addressSchemaArgentBackend,tokenId:t.z.coerce.number().optional(),amount:t.z.string().optional(),collectionName:t.z.string().optional(),collectionPreviewImage:t.z.string().optional().nullable(),nftName:t.z.string().optional().nullable(),nftPreviewImage:t.z.string().optional().nullable()}),t.z.object({type:t.z.literal("token"),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.coerce.string()}).optional().nullable()})])}),pt=t.z.object({type:t.z.string(),to:a.addressSchemaArgentBackend,actualFee:t.z.object({type:t.z.string(),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()})}),zt=t.z.enum(["pending","success","failure"]),O=t.z.object({compositeId:t.z.string(),id:t.z.string().uuid(),status:zt,wallet:a.addressSchemaArgentBackend,txSender:a.addressSchemaArgentBackend,source:t.z.string(),type:re,group:t.z.enum(["finance","security"]),submitted:t.z.number(),lastModified:t.z.number(),transaction:ct,transfers:t.z.array(lt),fees:t.z.array(pt).optional(),relatedAddresses:t.z.array(ae).nullable(),network:t.z.string(),networkDetails:ie.optional(),details:ut,transferSummary:t.z.array(D).optional(),dapp:dt.optional(),actions:t.z.array(k).optional(),title:t.z.string().optional(),multisigDetails:t.z.object({signers:t.z.array(a.addressSchemaArgentBackend)}).optional()}),gt=t.z.object({title:t.z.string().optional(),shortTitle:t.z.string().optional(),subtitle:t.z.string().optional(),icon:t.z.string().optional()}),ht="native",St="rejected",ft="cancelled",yt="queued",le=O.pick({status:!0,actions:!0,submitted:!0,lastModified:!0,transferSummary:!0,fees:!0,multisigDetails:!0}).extend({status:t.z.union([zt,t.z.enum([St,ft,yt])]),type:t.z.literal(ht),transaction:ct.pick({hash:!0}),dapp:N.optional(),meta:gt.optional()}),bt=t.z.array(O),me=t.z.object({activities:bt,page:t.z.number(),pageSize:t.z.number(),totalElements:t.z.number(),totalPages:t.z.number()});function ue(e){return mt.safeParse(e).success}const R=e=>D.safeParse(e).success,de=e=>R(e)&&e.asset.type==="token",pe=e=>R(e)&&e.asset.type==="nft",A={Transfer:l.hash.getSelectorFromName("Transfer"),Approval:l.hash.getSelectorFromName("Approval")},At=(e,n,i)=>{for(const r of e){const{events:s,internal_calls:c}=r;for(const o of s)for(const u of o.keys)u===A.Approval&&n.push({tokenAddress:a.addressSchema.parse(r.contract_address),owner:o.data[0],spender:o.data[1],value:l.uint256.uint256ToBN({low:o.data[2],high:o.data[3]}).toString()}),u===A.Transfer&&i.push({tokenAddress:a.addressSchema.parse(r.contract_address),from:o.data[0],to:o.data[1],value:l.uint256.uint256ToBN({low:o.data[2],high:o.data[3]}).toString()});c&&At(c,n,i)}return{approvals:n,transfers:i}},ze=/(0x[a-fA-F0-9]+)\s*\('(.*?)'\)/,ge=e=>{if(!C.isString(e))return;const n=e.match(ze);if(n&&!C.isEmpty(n[2]))return n[2]};var _;(function(e){e.SIMULATE_AND_REVIEW_FAILED="Something went wrong fetching review",e.NO_CALLS_FOUND="No calls found",e.ONCHAIN_FEE_ESTIMATION_FAILED="Failed to estimate fees onchain"})(_||(_={}));class he extends a.BaseError{constructor(n){super(n,_),this.name="ReviewError"}}const Se=t.z.object({reason:t.z.string(),severity:t.z.string().optional(),title:t.z.string(),description:t.z.string().optional()}),fe=Object.values(l.constants.TRANSACTION_VERSION),ye=t.z.string().default("0x3").refine(e=>{const n=l.num.toBigInt(e);return fe.map(i=>l.num.toBigInt(i)).includes(n)}).transform(e=>l.num.toHex(e));function be(e){if(e===l.constants.TRANSACTION_VERSION.V3||e===l.constants.TRANSACTION_VERSION.F3)throw Error("Only txv1 is supported")}exports.ETH_TOKEN_ADDRESS=vt;exports.EstimateError=Mt;exports.EventsBySelector=A;exports.FEE_OVERHEAD=E;exports.NativeActivityStatusCancelled=ft;exports.NativeActivityStatusQueued=yt;exports.NativeActivityStatusRejected=St;exports.NativeActivityTypeNative=ht;exports.ReviewError=he;exports.STANDARD_DEVNET_ACCOUNT_CLASS_HASH=jt;exports.STRK_TOKEN_ADDRESS=Et;exports.TXV1_ACCOUNT_CLASS_HASH=kt;exports.TXV1_MULTISIG_CLASS_HASH=Nt;exports.TXV3_ACCOUNT_CLASS_HASH=It;exports.TXV3_MULTISIG_CLASS_HASH=wt;exports.TokenError=Ot;exports.actionSchema=k;exports.activitiesSchema=bt;exports.activityDappSchema=dt;exports.activityDetailsSchema=ut;exports.activityResponseSchema=me;exports.activitySchema=O;exports.activitySummarySchema=D;exports.activityTransferSchema=lt;exports.airdropSchema=G;exports.argentMaxFee=J;exports.assessmentSchema=Z;exports.collateralizedDebtGroupSchema=Pt;exports.collateralizedDebtPositionSchema=v;exports.collateralizedDebtPositionsSchema=Ct;exports.concentratedLiquidityPositionSchema=T;exports.concentratedLiquidityPositionsSchema=Rt;exports.defiDappsProductsSchema=Ut;exports.defiPositionSchema=V;exports.defiProductSchema=M;exports.defiProductsSchema=K;exports.denyTxV3=be;exports.enrichedSimulateAndReviewSchema=te;exports.estimatedFeeSchema=y;exports.estimatedFeesSchema=Y;exports.feeEstimationSchema=it;exports.feeSchema=pt;exports.findTransfersAndApprovals=At;exports.getMessageFromTrpcError=Bt;exports.getPrettyRpcError=ge;exports.inputAmountSchema=X;exports.isActivityDetailsAction=ue;exports.isActivitySummary=R;exports.isNftActivitySummary=pe;exports.isNotTransactionSimulationError=ee;exports.isTokenActivitySummary=de;exports.isTransactionSimulationError=ne;exports.isValidInputAmount=xt;exports.modifySnjsFeeOverhead=Ht;exports.nativeActivityMetaSchema=gt;exports.nativeActivitySchema=le;exports.parseAmount=q;exports.productGroupsSchema=H;exports.propertySchema=b;exports.reasonsSchema=$;exports.retry=B;exports.reviewSchema=et;exports.severitySchema=Q;exports.simulateAndReviewSchema=Zt;exports.targetedDappSchema=N;exports.transactionReviewTransactionsSchema=Kt;exports.transactionReviewWarningSchema=Se;exports.trpcErrorSchema=W;exports.txVersionSchema=ye;exports.unclaimedRewardsSchema=Ft;exports.warningDetailsSchema=tt;exports.warningSchema=I;
|
|
1
|
+
"use strict";const t=require("zod"),a=require("./webToken.model-5HUiR8ER.js"),l=require("starknet"),C=require("lodash-es");require("@scure/base");require("react");require("object-hash");require("swr");const vt="0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7",Et="0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d",kt="0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003",It="0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f",Nt="0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48",wt="0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72",jt="0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f";var B={};function m(e,n){typeof n=="boolean"&&(n={forever:n}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=n||{},this._maxRetryTime=n&&n.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Dt=m;m.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};m.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};m.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var n=new Date().getTime();if(e&&n-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(i===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},i),this._options.unref&&this._timer.unref(),!0};m.prototype.attempt=function(e,n){this._fn=e,n&&(n.timeout&&(this._operationTimeout=n.timeout),n.cb&&(this._operationTimeoutCb=n.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){i._operationTimeoutCb()},i._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};m.prototype.try=function(e){this.attempt(e)};m.prototype.start=function(e){this.attempt(e)};m.prototype.start=m.prototype.try;m.prototype.errors=function(){return this._errors};m.prototype.attempts=function(){return this._attempts};m.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},n=null,i=0,r=0;r<this._errors.length;r++){var s=this._errors[r],c=s.message,o=(e[c]||0)+1;e[c]=o,o>=i&&(n=s,i=o)}return n};(function(e){var n=Dt;e.operation=function(i){var r=e.timeouts(i);return new n(r,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})},e.timeouts=function(i){if(i instanceof Array)return[].concat(i);var r={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var s in i)r[s]=i[s];if(r.minTimeout>r.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var c=[],o=0;o<r.retries;o++)c.push(this.createTimeout(o,r));return i&&i.forever&&!c.length&&c.push(this.createTimeout(o,r)),c.sort(function(u,g){return u-g}),c},e.createTimeout=function(i,r){var s=r.randomize?Math.random()+1:1,c=Math.round(s*Math.max(r.minTimeout,1)*Math.pow(r.factor,i));return c=Math.min(c,r.maxTimeout),c},e.wrap=function(i,r,s){if(r instanceof Array&&(s=r,r=null),!s){s=[];for(var c in i)typeof i[c]=="function"&&s.push(c)}for(var o=0;o<s.length;o++){var u=s[o],g=i[u];i[u]=(function(_t){var h=e.operation(r),S=Array.prototype.slice.call(arguments,1),Tt=S.pop();S.push(function(P){h.retry(P)||(P&&(arguments[0]=h.mainError()),Tt.apply(this,arguments))}),h.attempt(function(){_t.apply(i,S)})}).bind(i,g),i[u].options=r}}})(B);exports.TOKEN_ERROR_MESSAGES=void 0;(function(e){e.NO_TOKEN_API_URL="NO_TOKEN_API_URL is not defined",e.NO_TOKEN_PRICE_API_URL="NO_TOKEN_PRICE_API_URL is not defined",e.TOKENS_DEFI_DECOMPOSITION_URL="TOKENS_DEFI_DECOMPOSITION_URL is not defined",e.TOKENS_AIRDROPS_API_URL="TOKENS_AIRDROPS_API_URL is not defined",e.TOKEN_PARSING_ERROR="Unable to parse token data response",e.TOKEN_PRICE_PARSING_ERROR="Unable to parse token price response",e.TOKEN_DEFI_DECOMPOSITION_PARSING_ERROR="Unable to parse token defi decomposition response",e.TOKEN_PRICE_NOT_FOUND="Token price not found",e.TOKEN_NOT_FOUND="Token not found",e.TOKEN_DETAILS_NOT_FOUND="Token details not found",e.FEE_TOKEN_NOT_FOUND="Fee token not found",e.UNABLE_TO_CALCULATE_CURRENCY_VALUE="Unable to calculate currency value",e.UNSAFE_DECIMALS="Unsafe decimals in token"})(exports.TOKEN_ERROR_MESSAGES||(exports.TOKEN_ERROR_MESSAGES={}));class Ot extends a.BaseError{constructor(n){super(n,exports.TOKEN_ERROR_MESSAGES),this.name="TokenError"}}const U=a.webTokenWithBalanceAndPriceSchema.extend({accruedFees:t.z.string(),currentPrice:t.z.string(),maxPrice:t.z.string(),minPrice:t.z.string(),principal:t.z.string()}),L=t.z.object({address:a.addressSchema.optional(),currencyValue:t.z.string().default("0")}),T=L.extend({poolFeePercentage:t.z.string(),tickSpacingPercentage:t.z.string().optional(),tokenId:t.z.string().optional(),unitCurrencyValueToken0:t.z.string().optional(),unitCurrencyValueToken1:t.z.string().optional(),token0:U,token1:U}),Rt=t.z.array(T),Pt=t.z.object({name:t.z.string().optional(),healthRatio:t.z.string().optional(),accountAddress:a.addressSchema.optional()}),v=L.extend({totalBalances:t.z.record(t.z.string()),collateral:t.z.boolean(),debt:t.z.boolean(),lending:t.z.boolean(),apy:t.z.string().optional(),group:t.z.string().optional(),unitCurrencyValue:t.z.string().optional(),positionToken:a.apiTokenInfoSchema.or(t.z.undefined()),token:a.webTokenWithBalanceAndPriceSchema.optional(),accountAddress:a.addressSchema.optional(),accountAddressGroup:t.z.string().optional()}),Ct=t.z.array(v),V=T.or(v),H=t.z.record(t.z.object({name:t.z.string().optional(),healthRatio:t.z.string().optional(),accountAddress:a.addressSchema.optional()})),M=t.z.object({type:a.defiPositionTypeSchema,manageUrl:t.z.string().url().optional(),name:t.z.string(),positions:t.z.array(V),positionsTotalValue:t.z.string(),brandColor:t.z.string().optional(),groups:H.optional(),accountAddress:a.addressSchema}),K=t.z.array(M),Ut=t.z.object({dappId:t.z.string(),products:K}),G=t.z.object({name:t.z.string().optional(),tokenAddress:a.addressSchema,token:a.apiTokenInfoSchema.optional(),amount:t.z.string().optional(),claimUrl:t.z.string().optional(),claimStart:t.z.number(),claimEnd:t.z.number().optional()}),Ft=t.z.array(G),q=(e,n=18)=>a.parseUnits(e.replace(",","."),Number(n)),X=t.z.string().trim().refine(e=>e!=="",{message:"Amount is required"}).refine(e=>{try{const n=q(e).value;if(n<0n)throw new Error("Amount must be positive");if(n===0n)throw new Error("Amount can not be zero");if(n>l.uint256.UINT_256_MAX)throw new Error("Amount is too big")}catch{throw new Error("Amount should be a number")}return!0},{message:"Invalid amount"}),xt=e=>!!X.parse(e),W=t.z.object({data:t.z.object({code:t.z.string().optional(),name:t.z.string().optional(),message:t.z.string()})}),Bt=e=>{const n=W.safeParse(e);if(n.success)return n.data.data.message},Lt=3,E=process.env.FEE_OVERHEAD?parseFloat(process.env.FEE_OVERHEAD):Lt,Vt=1.5,z=10,J=({estimatedFee:e,overheadMultiplier:n=E})=>{const r=l.num.toBigInt(e)*BigInt(n*z)/BigInt(z);return l.num.toHex(r)},Ht=({suggestedMaxFee:e,overheadMultiplier:n=E,starknetJsOverheadMultiplier:i=Vt})=>{const s=l.num.toBigInt(e)*BigInt(z)/BigInt(i*z);return J({estimatedFee:s,overheadMultiplier:n})};exports.ESTIMATE_ERROR_MESSAGES=void 0;(function(e){e.SIMULATE_AND_REVIEW_FAILED="Missing simulation"})(exports.ESTIMATE_ERROR_MESSAGES||(exports.ESTIMATE_ERROR_MESSAGES={}));class Mt extends a.BaseError{constructor(n){super(n,exports.ESTIMATE_ERROR_MESSAGES),this.name="EstimateError"}}const Kt=t.z.object({type:t.z.enum(["DECLARE","DEPLOY","DEPLOY_ACCOUNT","INVOKE"]).default("INVOKE"),calls:t.z.array(a.callSchema).or(a.callSchema).optional(),calldata:t.z.array(t.z.string()).optional(),classHash:a.hexSchema.optional(),salt:a.hexSchema.optional(),signature:t.z.array(t.z.string()).optional()}),Gt=t.z.object({amount:t.z.bigint(),pricePerUnit:t.z.bigint()}).or(t.z.object({maxFee:t.z.bigint()})),y=t.z.object({feeTokenAddress:a.addressSchema,amount:t.z.bigint(),pricePerUnit:t.z.bigint(),max:Gt.optional(),dataGasConsumed:t.z.bigint().optional(),dataGasPrice:t.z.bigint().optional()}),Y=t.z.object({deployment:y.optional(),transactions:y}),Q=t.z.union([t.z.literal("critical"),t.z.literal("high"),t.z.literal("caution"),t.z.literal("info")]),$=t.z.string(),qt=t.z.object({name:t.z.string(),url:t.z.string(),position:t.z.number()}),f=t.z.object({address:t.z.string(),name:t.z.string(),symbol:t.z.string().optional(),decimals:t.z.number().optional(),unknown:t.z.boolean(),iconUrl:t.z.string().optional(),type:t.z.string()}),b=t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("amount"),label:t.z.string(),token:f,amount:t.z.string(),usd:t.z.string(),editable:t.z.boolean()}),t.z.object({type:t.z.literal("address"),label:t.z.string(),address:t.z.string(),addressName:t.z.string().optional(),verified:t.z.boolean().optional()}),t.z.object({type:t.z.literal("timestamp"),label:t.z.string(),value:t.z.string()}),t.z.object({type:t.z.literal("token_address"),label:t.z.string(),token:f}),t.z.object({type:t.z.literal("calldata"),label:t.z.string(),entrypoint:t.z.string(),calldata:t.z.array(t.z.string())}),t.z.object({type:t.z.literal("text"),label:t.z.string(),text:t.z.string()}),t.z.object({type:t.z.literal("nft"),label:t.z.string(),token:f})]),k=t.z.object({name:t.z.string(),properties:t.z.array(b),defaultProperties:t.z.array(b).optional()}),Z=t.z.union([t.z.literal("verified"),t.z.literal("neutral"),t.z.literal("partial"),t.z.literal("warn")]),tt=t.z.object({unknown_token:t.z.unknown().optional(),date_of_addition:t.z.string().optional(),contract_address:a.addressSchema.optional(),reason:t.z.string().optional(),value:t.z.string().or(t.z.number()).optional()}),I=t.z.object({reason:$,details:tt.optional(),severity:Q}),et=t.z.object({assessment:Z,warnings:t.z.array(I).optional(),assessmentReasons:t.z.array(t.z.string()).optional(),assessmentDetails:t.z.object({contract_address:t.z.string()}).optional(),action:k}),N=t.z.object({name:t.z.string(),description:t.z.string(),logoUrl:t.z.string(),iconUrl:t.z.string(),argentVerified:t.z.boolean(),links:t.z.array(qt)}),nt=t.z.object({assessment:t.z.union([t.z.literal("verified"),t.z.literal("neutral"),t.z.literal("partial"),t.z.literal("warn")]),warnings:t.z.array(I).optional(),assessmentDetails:t.z.object({contract_address:t.z.string()}).optional(),targetedDapp:N.optional(),reviews:t.z.array(et)}).optional(),at=t.z.object({banner:t.z.string().nullable().optional(),preview:t.z.string().nullable().optional(),full:t.z.string().nullable().optional(),original:t.z.string().nullable().optional()}),Xt=t.z.object({twitter:t.z.string().optional(),external:t.z.string().optional(),discord:t.z.string().optional()}),w=t.z.object({address:a.addressSchemaArgentBackend,decimals:t.z.number().optional(),symbol:t.z.string().optional(),name:t.z.string(),description:t.z.string().optional(),type:t.z.string().optional(),usdValue:t.z.string().optional(),iconUrl:t.z.string().optional(),unknown:t.z.boolean().optional(),imageUrls:at.optional(),links:Xt.optional()}),Wt=t.z.object({tokenAddress:a.addressSchemaArgentBackend,owner:a.addressSchemaArgentBackend,spender:a.addressSchemaArgentBackend,value:t.z.string().optional(),approvalForAll:t.z.boolean(),details:w.optional()}),Jt=t.z.object({tokenAddress:a.addressSchemaArgentBackend,from:a.addressSchemaArgentBackend,to:a.addressSchemaArgentBackend,tokenId:t.z.string().optional(),value:t.z.string().optional(),details:w.optional()}),d=t.z.union([t.z.string(),t.z.number(),t.z.bigint()]).transform(e=>parseInt(e.toString(),10)),F={overallFee:d,gasPrice:d,gasUsage:d,dataGasPrice:d.optional(),dataGasConsumed:d.optional()},it=t.z.object({...F,unit:t.z.string().transform(e=>e.toUpperCase()).pipe(t.z.literal("WEI")),maxFee:d}).or(t.z.object({...F,unit:t.z.string().transform(e=>e.toUpperCase()).pipe(t.z.literal("FRI")),maxAmount:d,maxPricePerUnit:d})),Yt=t.z.object({type:t.z.string(),label:t.z.string(),tokenId:t.z.string().optional(),value:t.z.string().optional(),usdValue:t.z.string().optional(),token:w,sent:t.z.boolean().optional(),tokenIdDetails:t.z.object({name:t.z.string().optional(),description:t.z.string().optional(),imageUrls:at.optional()}).optional()}),Qt=t.z.object({approvals:t.z.array(Wt).optional(),transfers:t.z.array(Jt).optional(),calculatedNonce:t.z.string().optional(),feeEstimation:it,summary:t.z.array(Yt).optional()}),$t=t.z.object({label:t.z.string().optional(),code:t.z.number().optional(),message:t.z.string().optional(),error:t.z.string().optional()}),rt=t.z.object({reviewOfTransaction:nt,simulation:Qt,simulationError:t.z.undefined()}),ot=t.z.object({reviewOfTransaction:nt,simulation:t.z.undefined(),simulationError:$t}),st=rt.or(ot),Zt=t.z.object({transactions:t.z.array(st)}),te=t.z.object({transactions:t.z.array(st),enrichedFeeEstimation:Y.optional(),isBackendDown:t.z.boolean().default(!1).optional()});function ee(e){return rt.safeParse(e).success}function ne(e){return ot.safeParse(e).success}const ct=t.z.object({network:t.z.string(),hash:t.z.string(),status:t.z.string(),blockNumber:t.z.number().optional(),transactionIndex:t.z.number()}),p=t.z.object({type:t.z.enum(["token","nft"]),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()}),j=t.z.enum(["ethereum","starknet","zksync","zksync2"]),lt=t.z.object({type:t.z.enum(["payment","gasFee"]),leg:t.z.enum(["credit","debit"]),asset:p,counterParty:a.addressSchemaArgentBackend.optional(),counterPartyNetwork:j.optional()}),ae=t.z.object({address:a.addressSchemaArgentBackend,network:j,type:t.z.enum(["wallet","token"])}),ie=t.z.object({chainId:t.z.enum(["TESTNET","MAINNET","SEPOLIA"]),ethereumNetwork:t.z.enum(["mainnet","sepolia"])}),re=t.z.enum(["approval","changePubKey","dappInteraction","deploy","gift","multicall","payment","security","trade"]),mt=t.z.enum(["triggerEscapeGuardian","triggerEscapeSigner","escapeGuardian","escapeSigner","guardianChanged","guardianBackupChanged","signerChanged","cancelEscape","accountUpgraded","multisigConfigurationUpdated"]),oe=t.z.object({name:t.z.string(),parameters:t.z.array(t.z.unknown()).optional()}),se=t.z.object({guid:t.z.string().optional(),signerType:t.z.string().optional(),signer:t.z.object({publicKey:t.z.string().optional()}).optional()}),ce=t.z.object({activeAt:t.z.string().optional(),newGuardian:t.z.string().optional(),newImplementation:t.z.string().optional(),newVersion:t.z.string().optional(),signerGuid:t.z.string().optional(),signers:t.z.array(se).optional()}),x=t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("deploy"),deployer:a.addressSchemaArgentBackend,contractAddress:a.addressSchemaArgentBackend}),t.z.object({type:t.z.literal("approval"),spender:a.addressSchemaArgentBackend,asset:p,approvalType:t.z.string()}),t.z.object({type:t.z.literal("payment"),counterparty:a.addressSchemaArgentBackend,leg:t.z.string(),asset:p,counterpartyNetwork:j.optional()}),t.z.object({type:t.z.literal("trade"),srcAsset:p,destAsset:p}),t.z.object({type:t.z.literal("security"),action:mt,context:ce.optional()}),t.z.object({type:t.z.literal("dappInteraction"),dappAddress:a.addressSchemaArgentBackend,function:oe.optional().nullable()})]),ut=t.z.union([x,t.z.object({type:t.z.literal("multicall"),calls:t.z.array(t.z.object({details:x}))})]),dt=t.z.object({dappId:t.z.string(),name:t.z.string().optional().nullable()}),D=t.z.object({sent:t.z.boolean(),asset:t.z.discriminatedUnion("type",[t.z.object({type:t.z.literal("nft"),tokenAddress:a.addressSchemaArgentBackend,tokenId:t.z.coerce.number().optional(),amount:t.z.string().optional(),collectionName:t.z.string().optional(),collectionPreviewImage:t.z.string().optional().nullable(),nftName:t.z.string().optional().nullable(),nftPreviewImage:t.z.string().optional().nullable()}),t.z.object({type:t.z.literal("token"),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.coerce.string()}).optional().nullable()})])}),pt=t.z.object({type:t.z.string(),to:a.addressSchemaArgentBackend,actualFee:t.z.object({type:t.z.string(),tokenAddress:a.addressSchemaArgentBackend,amount:t.z.string().optional(),fiatAmount:t.z.object({currency:t.z.string(),currencyAmount:t.z.number()}).optional().nullable()})}),zt=t.z.enum(["pending","success","failure"]),O=t.z.object({compositeId:t.z.string(),id:t.z.string().uuid(),status:zt,wallet:a.addressSchemaArgentBackend,txSender:a.addressSchemaArgentBackend,source:t.z.string(),type:re,group:t.z.enum(["finance","security"]),submitted:t.z.number(),lastModified:t.z.number(),transaction:ct,transfers:t.z.array(lt),fees:t.z.array(pt).optional(),relatedAddresses:t.z.array(ae).nullable(),network:t.z.string(),networkDetails:ie.optional(),details:ut,transferSummary:t.z.array(D).optional(),dapp:dt.optional(),actions:t.z.array(k).optional(),title:t.z.string().optional(),multisigDetails:t.z.object({signers:t.z.array(a.addressSchemaArgentBackend)}).optional()}),gt=t.z.object({title:t.z.string().optional(),shortTitle:t.z.string().optional(),subtitle:t.z.string().optional(),icon:t.z.string().optional()}),ht="native",St="rejected",ft="cancelled",yt="queued",le=O.pick({status:!0,actions:!0,submitted:!0,lastModified:!0,transferSummary:!0,fees:!0,multisigDetails:!0}).extend({status:t.z.union([zt,t.z.enum([St,ft,yt])]),type:t.z.literal(ht),transaction:ct.pick({hash:!0}),dapp:N.optional(),meta:gt.optional()}),bt=t.z.array(O),me=t.z.object({activities:bt,page:t.z.number(),pageSize:t.z.number(),totalElements:t.z.number(),totalPages:t.z.number()});function ue(e){return mt.safeParse(e).success}const R=e=>D.safeParse(e).success,de=e=>R(e)&&e.asset.type==="token",pe=e=>R(e)&&e.asset.type==="nft",A={Transfer:l.hash.getSelectorFromName("Transfer"),Approval:l.hash.getSelectorFromName("Approval")},At=(e,n,i)=>{for(const r of e){const{events:s,internal_calls:c}=r;for(const o of s)for(const u of o.keys)u===A.Approval&&n.push({tokenAddress:a.addressSchema.parse(r.contract_address),owner:o.data[0],spender:o.data[1],value:l.uint256.uint256ToBN({low:o.data[2],high:o.data[3]}).toString()}),u===A.Transfer&&i.push({tokenAddress:a.addressSchema.parse(r.contract_address),from:o.data[0],to:o.data[1],value:l.uint256.uint256ToBN({low:o.data[2],high:o.data[3]}).toString()});c&&At(c,n,i)}return{approvals:n,transfers:i}},ze=/(0x[a-fA-F0-9]+)\s*\('(.*?)'\)/,ge=e=>{if(!C.isString(e))return;const n=e.match(ze);if(n&&!C.isEmpty(n[2]))return n[2]};var _;(function(e){e.SIMULATE_AND_REVIEW_FAILED="Something went wrong fetching review",e.NO_CALLS_FOUND="No calls found",e.ONCHAIN_FEE_ESTIMATION_FAILED="Failed to estimate fees onchain"})(_||(_={}));class he extends a.BaseError{constructor(n){super(n,_),this.name="ReviewError"}}const Se=t.z.object({reason:t.z.string(),severity:t.z.string().optional(),title:t.z.string(),description:t.z.string().optional()}),fe=Object.values(l.constants.TRANSACTION_VERSION),ye=t.z.string().default("0x3").refine(e=>{const n=l.num.toBigInt(e);return fe.map(i=>l.num.toBigInt(i)).includes(n)}).transform(e=>l.num.toHex(e));function be(e){if(e===l.constants.TRANSACTION_VERSION.V3||e===l.constants.TRANSACTION_VERSION.F3)throw Error("Only txv1 is supported")}exports.ETH_TOKEN_ADDRESS=vt;exports.EstimateError=Mt;exports.EventsBySelector=A;exports.FEE_OVERHEAD=E;exports.NativeActivityStatusCancelled=ft;exports.NativeActivityStatusQueued=yt;exports.NativeActivityStatusRejected=St;exports.NativeActivityTypeNative=ht;exports.ReviewError=he;exports.STANDARD_DEVNET_ACCOUNT_CLASS_HASH=jt;exports.STRK_TOKEN_ADDRESS=Et;exports.TXV1_ACCOUNT_CLASS_HASH=kt;exports.TXV1_MULTISIG_CLASS_HASH=Nt;exports.TXV3_ACCOUNT_CLASS_HASH=It;exports.TXV3_MULTISIG_CLASS_HASH=wt;exports.TokenError=Ot;exports.actionSchema=k;exports.activitiesSchema=bt;exports.activityDappSchema=dt;exports.activityDetailsSchema=ut;exports.activityResponseSchema=me;exports.activitySchema=O;exports.activitySummarySchema=D;exports.activityTransferSchema=lt;exports.airdropSchema=G;exports.argentMaxFee=J;exports.assessmentSchema=Z;exports.collateralizedDebtGroupSchema=Pt;exports.collateralizedDebtPositionSchema=v;exports.collateralizedDebtPositionsSchema=Ct;exports.concentratedLiquidityPositionSchema=T;exports.concentratedLiquidityPositionsSchema=Rt;exports.defiDappsProductsSchema=Ut;exports.defiPositionSchema=V;exports.defiProductSchema=M;exports.defiProductsSchema=K;exports.denyTxV3=be;exports.enrichedSimulateAndReviewSchema=te;exports.estimatedFeeSchema=y;exports.estimatedFeesSchema=Y;exports.feeEstimationSchema=it;exports.feeSchema=pt;exports.findTransfersAndApprovals=At;exports.getMessageFromTrpcError=Bt;exports.getPrettyRpcError=ge;exports.inputAmountSchema=X;exports.isActivityDetailsAction=ue;exports.isActivitySummary=R;exports.isNftActivitySummary=pe;exports.isNotTransactionSimulationError=ee;exports.isTokenActivitySummary=de;exports.isTransactionSimulationError=ne;exports.isValidInputAmount=xt;exports.modifySnjsFeeOverhead=Ht;exports.nativeActivityMetaSchema=gt;exports.nativeActivitySchema=le;exports.parseAmount=q;exports.productGroupsSchema=H;exports.propertySchema=b;exports.reasonsSchema=$;exports.retry=B;exports.reviewSchema=et;exports.severitySchema=Q;exports.simulateAndReviewSchema=Zt;exports.targetedDappSchema=N;exports.transactionReviewTransactionsSchema=Kt;exports.transactionReviewWarningSchema=Se;exports.trpcErrorSchema=W;exports.txVersionSchema=ye;exports.unclaimedRewardsSchema=Ft;exports.warningDetailsSchema=tt;exports.warningSchema=I;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z as t } from "zod";
|
|
2
|
-
import {
|
|
2
|
+
import { a8 as E, au as L, t as u, a9 as V, ao as rt, p as st, c as w, v as D, q as r } from "./webToken.model-CpudLBp0.mjs";
|
|
3
3
|
import { uint256 as S, num as d, hash as P, constants as T } from "starknet";
|
|
4
4
|
import { isString as ct, isEmpty as lt } from "lodash-es";
|
|
5
5
|
import "@scure/base";
|
|
@@ -736,7 +736,7 @@ export {
|
|
|
736
736
|
Jt as Q,
|
|
737
737
|
Be as R,
|
|
738
738
|
ye as S,
|
|
739
|
-
|
|
739
|
+
ge as T,
|
|
740
740
|
Ce as U,
|
|
741
741
|
Lt as V,
|
|
742
742
|
Wt as W,
|
|
@@ -767,13 +767,13 @@ export {
|
|
|
767
767
|
Nt as aj,
|
|
768
768
|
je as b,
|
|
769
769
|
At as c,
|
|
770
|
-
|
|
771
|
-
|
|
770
|
+
fe as d,
|
|
771
|
+
he as e,
|
|
772
772
|
Ct as f,
|
|
773
|
-
|
|
774
|
-
|
|
773
|
+
be as g,
|
|
774
|
+
A as h,
|
|
775
775
|
Oe as i,
|
|
776
|
-
|
|
776
|
+
_e as j,
|
|
777
777
|
H as k,
|
|
778
778
|
Se as l,
|
|
779
779
|
Te as m,
|
package/dist/utils/schemas.d.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const booleanToStringSchema: z.ZodEffects<z.ZodBoolean, string, boolean>;
|
|
3
3
|
export declare const stringToBooleanSchema: z.ZodEffects<z.ZodString, boolean, string>;
|
|
4
|
+
export declare function createSchemaWithWarnings<T extends z.ZodRawShape>(shape: T): z.ZodEffects<z.ZodObject<T, "passthrough", z.ZodTypeAny, z.objectOutputType<T, z.ZodTypeAny, "passthrough">, z.objectInputType<T, z.ZodTypeAny, "passthrough">>, z.objectOutputType<T, z.ZodTypeAny, "passthrough">, z.objectInputType<T, z.ZodTypeAny, "passthrough">> & {
|
|
5
|
+
extend: <E extends z.ZodRawShape>(extension: E) => z.ZodEffects<z.ZodObject<T & E, "passthrough", z.ZodTypeAny, z.objectOutputType<T & E, z.ZodTypeAny, "passthrough">, z.objectInputType<T & E, z.ZodTypeAny, "passthrough">>, z.objectOutputType<T & E, z.ZodTypeAny, "passthrough">, z.objectInputType<T & E, z.ZodTypeAny, "passthrough">>;
|
|
6
|
+
};
|
|
7
|
+
export declare const safeParseAndWarn: <T extends z.ZodType>(schema: T, data: unknown) => {
|
|
8
|
+
success: boolean;
|
|
9
|
+
data?: z.infer<T>;
|
|
10
|
+
error?: z.ZodError;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("zod"),Ne=require("starknet"),or=require("lodash-es"),cr=require("react");require("swr");require("@scure/base");const jt=require("react/jsx-runtime");function Bt(i,f){let[z,w=""]=i.split(".");const R=z.startsWith("-");return R&&(z=z.slice(1)),w.length>f?Number(w[f])>=5?w=(BigInt(w.slice(0,f))+1n).toString().padStart(f,"0"):w=w.slice(0,f):w=w.padEnd(f,"0"),{value:BigInt(`${R?"-":""}${z}${w}`),decimals:f}}const lr=t.z.string().refine(i=>{if(i.toLowerCase()===i)return!0;try{return Ne.validateChecksumAddress(i)&&Mt(i)}catch{}return!1},"Invalid address (checksum error)"),wr=t.z.string().refine(i=>{try{return Ne.validateAndParseAddress(i)}catch{}return!1},"Invalid address (validation error)"),Ce=t.z.string().regex(/^0x[0-9a-fA-F]+$/,"Invalid address"),vr=Ce.min(50,"Addresses must at least be 50 characters long").max(66,"Addresses must at most be 66 characters long"),Lr=Ce.length(66,"Address must be 66 characters long"),me=vr.pipe(lr).transform(i=>`0x${(i.startsWith("0x")?i.slice(2):i).padStart(64,"0")}`),Ft=me.or(t.z.literal("")).transform(i=>i===""?void 0:i).optional(),Xe=Ce.transform(i=>`0x${i.replace(/^0x/,"").toLowerCase().padStart(64,"0")}`),yr=i=>me.safeParse(i).success,Cr=yr,De=i=>Ne.getChecksumAddress(i),Ut=i=>{const f=De(i),z=f.slice(0,2),w=f.slice(2,6),R=f.slice(-4);return`${z}${w}…${R}`},xt=i=>{const f=De(i),z=f.slice(0,2),R=f.slice(2).match(/.{1,4}/g)||[];return`${z} ${R.join(" ")}`},Mt=i=>!/^0x[0-9a-f]{63,64}$/.test(i),Dr=(i,f)=>{try{return!i||!f?!1:Ne.num.hexToDecimalString(i)===Ne.num.hexToDecimalString(f)}catch{}return!1},Pr=i=>{try{return Ne.num.toBigInt(Ce.parse(i))===Ne.constants.ZERO}catch{}return!1},Gt=(i,f)=>!!(f!=null&&f.some(z=>Dr(z,i))),$t=or.memoize(i=>{const f=i.slice(0,6),z=i.slice(-4);return`${f}…${z}`}),Xt=or.memoize((i,f)=>{if(i.length<f)return i;const z=Math.floor((f-1)/2),w=i.slice(0,z),R=i.slice(-z);return`${w}…${R}`}),Vt=t.z.string().regex(/^[a-zA-Z0-9.-]*$/g,"Invalid address character").max(66,"Address cannot be over 66 characters"),br=Lr.pipe(lr).pipe(wr),Pe=t.z.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/,"Invalid Argent name").max(253,"Argent name cannot be over 253 characters"),_r=i=>Pe.safeParse(i).success,kr=(i,f)=>{try{return f?xe(i)===xe(f):!1}catch{}return!1},xe=i=>Pe.parse(i).toLowerCase(),Ve=t.z.string().regex(/^([a-zA-Z0-9-]+\.)+stark$/,"Invalid Starknet ID").max(50,"Starknet ID cannot be over 50 characters"),jr=i=>Ve.safeParse(i).success,Br=(i,f)=>{try{return f?Me(i)===Me(f):!1}catch{}return!1},Me=i=>Ve.parse(i).toLowerCase(),qe=t.z.union([Pe,Ve]),qt=t.z.union([me,qe]),Ht=t.z.union([br,qe]),Wt=i=>qe.safeParse(i).success,Zt=(i,f)=>{try{return f?kr(i,f)||Br(i,f):!1}catch{}return!1},Yt=i=>jr(i)?Me(i):_r(i)?xe(i):De(i),Fr=t.z.union([t.z.literal("0"),t.z.literal("1")]);function Kt(i){var f=[];if(i.length===0)return"";if(typeof i[0]!="string")throw new TypeError("Url must be a string. Received "+i[0]);if(i[0].match(/^[^/:]+:\/*$/)&&i.length>1){var z=i.shift();i[0]=z+i[0]}i[0].match(/^file:\/\/\//)?i[0]=i[0].replace(/^([^/:]+):\/*/,"$1:///"):i[0]=i[0].replace(/^([^/:]+):\/*/,"$1://");for(var w=0;w<i.length;w++){var R=i[w];if(typeof R!="string")throw new TypeError("Url must be a string. Received "+R);R!==""&&(w>0&&(R=R.replace(/^[\/]+/,"")),w<i.length-1?R=R.replace(/[\/]+$/,""):R=R.replace(/[\/]+$/,"/"),f.push(R))}var x=f.join("/");x=x.replace(/\/(\?|&|#[^!])/g,"$1");var U=x.split("?");return x=U.shift()+(U.length>0?"?":"")+U.join("&"),x}function Ur(){var i;return typeof arguments[0]=="object"?i=arguments[0]:i=[].slice.call(arguments),Kt(i)}class be extends Error{constructor({code:f,message:z,options:w={}},R){const{error:x,context:U}=w;super(z,{cause:x}),this.errorMessages=R,this.name="BaseError",this.context=U,this.code=f,this.setMessageByCode(f,z)}setMessageByCode(f,z){!f||!this.errorMessages||z||(this.message=this.errorMessages[f])}toString(){return this.message||""}}var er;(function(i){i.NOT_VALID="Invalid address",i.NOT_FOUND="Address not found",i.STARKNAME_NOT_FOUND="Stark name not found",i.STARKNAME_ERROR="Could not get address from stark name",i.STARKNAME_INVALID_ADDRESS="Stark name resolved to an invalid address",i.ARGENT_NAME_NOT_FOUND="Argent name not found",i.NO_ADDRESS_FROM_ARGENT_NAME="Could not get address from Argent name",i.ARGENT_NAME_INVALID_ADDRESS="Argent name resolved to an invalid address",i.NO_ADDRESS_FROM_DOMAIN="Could not get address from domain",i.ARGENT_NAME_INVALID_NETWORK="Argent name is not enabled on the requested network"})(er||(er={}));class Le extends be{constructor(f){super(f,er),this.name="AddressError"}}class He extends Error{constructor(f,z,w){super(f),this.status=z,this.data=w,Object.setPrototypeOf(this,He.prototype)}}exports.HTTP_ERROR_MESSAGE=void 0;(function(i){i.FAILED_TO_FETCH_URL="Failed to fetch url",i.FAILED_TO_POST_URL="Failed to post url"})(exports.HTTP_ERROR_MESSAGE||(exports.HTTP_ERROR_MESSAGE={}));const Jt=t.z.object({walletAddress:Xe,ens:Pe,chain:t.z.enum(["ethereum","starknet"]),deleted:t.z.boolean(),walletDeployed:t.z.boolean()}).or(t.z.object({status:t.z.string()}));async function Qt(i,f,z,w="starknet"){const R={ens:i,chain:w},x=new URLSearchParams(R),U=Ur(z,"wallet",`?${x}`);try{const k=await f.get(U),C=k&&"walletAddress"in k?k.walletAddress:void 0;if(!C)throw new Le({code:"NO_ADDRESS_FROM_ARGENT_NAME"});if(Pr(C))throw new Le({code:"ARGENT_NAME_NOT_FOUND",message:`${i} not found`});if(!Cr(C))throw new Le({code:"ARGENT_NAME_INVALID_ADDRESS",message:`${i} resolved to an invalid address (${C})`});return De(C)}catch(k){throw k instanceof He&&k.status===404?new Le({code:"ARGENT_NAME_NOT_FOUND",message:`${i} not found`}):k}}var rr;(function(i){i.NOT_VALID="Invalid call"})(rr||(rr={}));class en extends be{constructor(f){super(f,rr),this.name="CallError"}}var tr;(function(i){i.NO_NETWORK_OR_MULTICALL="Missing networkId or multicall",i.NOT_FOUND="Network not found"})(tr||(tr={}));class rn extends be{constructor(f){super(f,tr),this.name="NetworkError"}}const Te=t.z.union([t.z.string(),t.z.number(),t.z.bigint()]),xr=t.z.object({low:Te,high:Te}),Mr=t.z.array(t.z.string()).and(t.z.object({__compiled__:t.z.boolean().optional()}).optional()),Gr=t.z.lazy(()=>t.z.array(t.z.union([ye,t.z.array(ye),We]))),ye=t.z.union([Te,xr,t.z.any(),t.z.boolean()]),$r=t.z.lazy(()=>t.z.record(t.z.union([ye,t.z.array(ye),We]))),We=t.z.lazy(()=>t.z.union([$r,Gr])),Xr=t.z.union([We,Mr]).optional(),Vr=t.z.lazy(()=>t.z.object({contractAddress:t.z.string(),calldata:Xr,entrypoint:t.z.string().optional()})),tn=t.z.lazy(()=>Vr.and(t.z.object({entrypoint:t.z.string()}))),ce=t.z.string().refine(i=>typeof parseInt(i)=="number"),nn=t.z.tuple([ce]),an=t.z.tuple([ce]),sn=t.z.object({new_threshold:t.z.string().refine(i=>typeof parseInt(i)=="number"),signers_to_add:t.z.array(ce)}),on=t.z.object({new_threshold:t.z.string().refine(i=>typeof parseInt(i)=="number"),signers_to_remove:t.z.array(ce)}),cn=t.z.object({signer_to_remove:ce,signer_to_add:ce}),ln=t.z.tuple([ce]),un=t.z.tuple([ce]),fn=t.z.tuple([ce]),hn=t.z.tuple([ce]).rest(ce),dn=t.z.object({recipient:me,amount:t.z.object({low:Te,high:Te})}),qr=t.z.string().regex(/^(0x)?[0-9a-fA-F]+$/,"Invalid hex string"),ur=qr.transform(i=>{const f=i.startsWith("0x")?i.slice(2):i;return`0x${f.length%2===0?f:`0${f}`}`}),mn=t.z.object({cairoVersion:Fr,accountClassHash:ur}),En=t.z.array(t.z.string()),pn=t.z.object({implementation:t.z.string(),selector:ur,calldata:En}),gn=t.z.object({owner:t.z.string(),guardian:t.z.string().optional().transform(i=>i??"0")});exports.MultiSigner=void 0;(function(i){i.Starknet="Starknet",i.Secp256k1="Secp256k1",i.Secp256r1="Secp256r1",i.Eip191="Eip191",i.Webauthn="Webauthn"})(exports.MultiSigner||(exports.MultiSigner={}));function Sn(i,f){const z={Starknet:void 0,Secp256k1:void 0,Secp256r1:void 0,Eip191:void 0,Webauthn:void 0};return z[f]=i,new Ne.CairoCustomEnum(z)}var nr;(function(i){i.NOT_FOUND="Account not found",i.CALCULATED_ADDRESS_NO_MATCH="Calculated address does not match account address"})(nr||(nr={}));class In extends be{constructor(f){super(f,nr),this.name="AccountError"}}function Hr(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var ir={exports:{}};(function(i,f){f=i.exports=D;var z;typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?z=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER"),console.log.apply(console,e)}:z=function(){},f.SEMVER_SPEC_VERSION="2.0.0";var w=256,R=Number.MAX_SAFE_INTEGER||9007199254740991,x=16,U=w-6,k=f.re=[],C=f.safeRe=[],S=f.src=[],E=f.tokens={},K=0;function P(e){E[e]=K++}var Ee="[a-zA-Z0-9-]",ne=[["\\s",1],["\\d",w],[Ee,U]];function pe(e){for(var s=0;s<ne.length;s++){var c=ne[s][0],I=ne[s][1];e=e.split(c+"*").join(c+"{0,"+I+"}").split(c+"+").join(c+"{1,"+I+"}")}return e}P("NUMERICIDENTIFIER"),S[E.NUMERICIDENTIFIER]="0|[1-9]\\d*",P("NUMERICIDENTIFIERLOOSE"),S[E.NUMERICIDENTIFIERLOOSE]="\\d+",P("NONNUMERICIDENTIFIER"),S[E.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-]"+Ee+"*",P("MAINVERSION"),S[E.MAINVERSION]="("+S[E.NUMERICIDENTIFIER]+")\\.("+S[E.NUMERICIDENTIFIER]+")\\.("+S[E.NUMERICIDENTIFIER]+")",P("MAINVERSIONLOOSE"),S[E.MAINVERSIONLOOSE]="("+S[E.NUMERICIDENTIFIERLOOSE]+")\\.("+S[E.NUMERICIDENTIFIERLOOSE]+")\\.("+S[E.NUMERICIDENTIFIERLOOSE]+")",P("PRERELEASEIDENTIFIER"),S[E.PRERELEASEIDENTIFIER]="(?:"+S[E.NUMERICIDENTIFIER]+"|"+S[E.NONNUMERICIDENTIFIER]+")",P("PRERELEASEIDENTIFIERLOOSE"),S[E.PRERELEASEIDENTIFIERLOOSE]="(?:"+S[E.NUMERICIDENTIFIERLOOSE]+"|"+S[E.NONNUMERICIDENTIFIER]+")",P("PRERELEASE"),S[E.PRERELEASE]="(?:-("+S[E.PRERELEASEIDENTIFIER]+"(?:\\."+S[E.PRERELEASEIDENTIFIER]+")*))",P("PRERELEASELOOSE"),S[E.PRERELEASELOOSE]="(?:-?("+S[E.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+S[E.PRERELEASEIDENTIFIERLOOSE]+")*))",P("BUILDIDENTIFIER"),S[E.BUILDIDENTIFIER]=Ee+"+",P("BUILD"),S[E.BUILD]="(?:\\+("+S[E.BUILDIDENTIFIER]+"(?:\\."+S[E.BUILDIDENTIFIER]+")*))",P("FULL"),P("FULLPLAIN"),S[E.FULLPLAIN]="v?"+S[E.MAINVERSION]+S[E.PRERELEASE]+"?"+S[E.BUILD]+"?",S[E.FULL]="^"+S[E.FULLPLAIN]+"$",P("LOOSEPLAIN"),S[E.LOOSEPLAIN]="[v=\\s]*"+S[E.MAINVERSIONLOOSE]+S[E.PRERELEASELOOSE]+"?"+S[E.BUILD]+"?",P("LOOSE"),S[E.LOOSE]="^"+S[E.LOOSEPLAIN]+"$",P("GTLT"),S[E.GTLT]="((?:<|>)?=?)",P("XRANGEIDENTIFIERLOOSE"),S[E.XRANGEIDENTIFIERLOOSE]=S[E.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*",P("XRANGEIDENTIFIER"),S[E.XRANGEIDENTIFIER]=S[E.NUMERICIDENTIFIER]+"|x|X|\\*",P("XRANGEPLAIN"),S[E.XRANGEPLAIN]="[v=\\s]*("+S[E.XRANGEIDENTIFIER]+")(?:\\.("+S[E.XRANGEIDENTIFIER]+")(?:\\.("+S[E.XRANGEIDENTIFIER]+")(?:"+S[E.PRERELEASE]+")?"+S[E.BUILD]+"?)?)?",P("XRANGEPLAINLOOSE"),S[E.XRANGEPLAINLOOSE]="[v=\\s]*("+S[E.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+S[E.XRANGEIDENTIFIERLOOSE]+")(?:\\.("+S[E.XRANGEIDENTIFIERLOOSE]+")(?:"+S[E.PRERELEASELOOSE]+")?"+S[E.BUILD]+"?)?)?",P("XRANGE"),S[E.XRANGE]="^"+S[E.GTLT]+"\\s*"+S[E.XRANGEPLAIN]+"$",P("XRANGELOOSE"),S[E.XRANGELOOSE]="^"+S[E.GTLT]+"\\s*"+S[E.XRANGEPLAINLOOSE]+"$",P("COERCE"),S[E.COERCE]="(^|[^\\d])(\\d{1,"+x+"})(?:\\.(\\d{1,"+x+"}))?(?:\\.(\\d{1,"+x+"}))?(?:$|[^\\d])",P("COERCERTL"),k[E.COERCERTL]=new RegExp(S[E.COERCE],"g"),C[E.COERCERTL]=new RegExp(pe(S[E.COERCE]),"g"),P("LONETILDE"),S[E.LONETILDE]="(?:~>?)",P("TILDETRIM"),S[E.TILDETRIM]="(\\s*)"+S[E.LONETILDE]+"\\s+",k[E.TILDETRIM]=new RegExp(S[E.TILDETRIM],"g"),C[E.TILDETRIM]=new RegExp(pe(S[E.TILDETRIM]),"g");var ge="$1~";P("TILDE"),S[E.TILDE]="^"+S[E.LONETILDE]+S[E.XRANGEPLAIN]+"$",P("TILDELOOSE"),S[E.TILDELOOSE]="^"+S[E.LONETILDE]+S[E.XRANGEPLAINLOOSE]+"$",P("LONECARET"),S[E.LONECARET]="(?:\\^)",P("CARETTRIM"),S[E.CARETTRIM]="(\\s*)"+S[E.LONECARET]+"\\s+",k[E.CARETTRIM]=new RegExp(S[E.CARETTRIM],"g"),C[E.CARETTRIM]=new RegExp(pe(S[E.CARETTRIM]),"g");var we="$1^";P("CARET"),S[E.CARET]="^"+S[E.LONECARET]+S[E.XRANGEPLAIN]+"$",P("CARETLOOSE"),S[E.CARETLOOSE]="^"+S[E.LONECARET]+S[E.XRANGEPLAINLOOSE]+"$",P("COMPARATORLOOSE"),S[E.COMPARATORLOOSE]="^"+S[E.GTLT]+"\\s*("+S[E.LOOSEPLAIN]+")$|^$",P("COMPARATOR"),S[E.COMPARATOR]="^"+S[E.GTLT]+"\\s*("+S[E.FULLPLAIN]+")$|^$",P("COMPARATORTRIM"),S[E.COMPARATORTRIM]="(\\s*)"+S[E.GTLT]+"\\s*("+S[E.LOOSEPLAIN]+"|"+S[E.XRANGEPLAIN]+")",k[E.COMPARATORTRIM]=new RegExp(S[E.COMPARATORTRIM],"g"),C[E.COMPARATORTRIM]=new RegExp(pe(S[E.COMPARATORTRIM]),"g");var O="$1$2$3";P("HYPHENRANGE"),S[E.HYPHENRANGE]="^\\s*("+S[E.XRANGEPLAIN]+")\\s+-\\s+("+S[E.XRANGEPLAIN]+")\\s*$",P("HYPHENRANGELOOSE"),S[E.HYPHENRANGELOOSE]="^\\s*("+S[E.XRANGEPLAINLOOSE]+")\\s+-\\s+("+S[E.XRANGEPLAINLOOSE]+")\\s*$",P("STAR"),S[E.STAR]="(<|>)?=?\\s*\\*";for(var re=0;re<K;re++)z(re,S[re]),k[re]||(k[re]=new RegExp(S[re]),C[re]=new RegExp(pe(S[re])));f.parse=ue;function ue(e,s){if((!s||typeof s!="object")&&(s={loose:!!s,includePrerelease:!1}),e instanceof D)return e;if(typeof e!="string"||e.length>w)return null;var c=s.loose?C[E.LOOSE]:C[E.FULL];if(!c.test(e))return null;try{return new D(e,s)}catch{return null}}f.valid=ve;function ve(e,s){var c=ue(e,s);return c?c.version:null}f.clean=J;function J(e,s){var c=ue(e.trim().replace(/^[=v]+/,""),s);return c?c.version:null}f.SemVer=D;function D(e,s){if((!s||typeof s!="object")&&(s={loose:!!s,includePrerelease:!1}),e instanceof D){if(e.loose===s.loose)return e;e=e.version}else if(typeof e!="string")throw new TypeError("Invalid Version: "+e);if(e.length>w)throw new TypeError("version is longer than "+w+" characters");if(!(this instanceof D))return new D(e,s);z("SemVer",e,s),this.options=s,this.loose=!!s.loose;var c=e.trim().match(s.loose?C[E.LOOSE]:C[E.FULL]);if(!c)throw new TypeError("Invalid Version: "+e);if(this.raw=e,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.major>R||this.major<0)throw new TypeError("Invalid major version");if(this.minor>R||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>R||this.patch<0)throw new TypeError("Invalid patch version");c[4]?this.prerelease=c[4].split(".").map(function(I){if(/^[0-9]+$/.test(I)){var N=+I;if(N>=0&&N<R)return N}return I}):this.prerelease=[],this.build=c[5]?c[5].split("."):[],this.format()}D.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},D.prototype.toString=function(){return this.version},D.prototype.compare=function(e){return z("SemVer.compare",this.version,this.options,e),e instanceof D||(e=new D(e,this.options)),this.compareMain(e)||this.comparePre(e)},D.prototype.compareMain=function(e){return e instanceof D||(e=new D(e,this.options)),d(this.major,e.major)||d(this.minor,e.minor)||d(this.patch,e.patch)},D.prototype.comparePre=function(e){if(e instanceof D||(e=new D(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;var s=0;do{var c=this.prerelease[s],I=e.prerelease[s];if(z("prerelease compare",s,c,I),c===void 0&&I===void 0)return 0;if(I===void 0)return 1;if(c===void 0)return-1;if(c===I)continue;return d(c,I)}while(++s)},D.prototype.compareBuild=function(e){e instanceof D||(e=new D(e,this.options));var s=0;do{var c=this.build[s],I=e.build[s];if(z("prerelease compare",s,c,I),c===void 0&&I===void 0)return 0;if(I===void 0)return 1;if(c===void 0)return-1;if(c===I)continue;return d(c,I)}while(++s)},D.prototype.inc=function(e,s){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",s);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",s);break;case"prepatch":this.prerelease.length=0,this.inc("patch",s),this.inc("pre",s);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",s),this.inc("pre",s);break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{for(var c=this.prerelease.length;--c>=0;)typeof this.prerelease[c]=="number"&&(this.prerelease[c]++,c=-2);c===-1&&this.prerelease.push(0)}s&&(this.prerelease[0]===s?isNaN(this.prerelease[1])&&(this.prerelease=[s,0]):this.prerelease=[s,0]);break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this.raw=this.version,this},f.inc=r;function r(e,s,c,I){typeof c=="string"&&(I=c,c=void 0);try{return new D(e,c).inc(s,I).version}catch{return null}}f.diff=n;function n(e,s){if(V(e,s))return null;var c=ue(e),I=ue(s),N="";if(c.prerelease.length||I.prerelease.length){N="pre";var T="prerelease"}for(var v in c)if((v==="major"||v==="minor"||v==="patch")&&c[v]!==I[v])return N+v;return T}f.compareIdentifiers=d;var a=/^[0-9]+$/;function d(e,s){var c=a.test(e),I=a.test(s);return c&&I&&(e=+e,s=+s),e===s?0:c&&!I?-1:I&&!c?1:e<s?-1:1}f.rcompareIdentifiers=l;function l(e,s){return d(s,e)}f.major=h;function h(e,s){return new D(e,s).major}f.minor=g;function g(e,s){return new D(e,s).minor}f.patch=o;function o(e,s){return new D(e,s).patch}f.compare=u;function u(e,s,c){return new D(e,c).compare(new D(s,c))}f.compareLoose=p;function p(e,s){return u(e,s,!0)}f.compareBuild=m;function m(e,s,c){var I=new D(e,c),N=new D(s,c);return I.compare(N)||I.compareBuild(N)}f.rcompare=A;function A(e,s,c){return u(s,e,c)}f.sort=L;function L(e,s){return e.sort(function(c,I){return f.compareBuild(c,I,s)})}f.rsort=y;function y(e,s){return e.sort(function(c,I){return f.compareBuild(I,c,s)})}f.gt=j;function j(e,s,c){return u(e,s,c)>0}f.lt=X;function X(e,s,c){return u(e,s,c)<0}f.eq=V;function V(e,s,c){return u(e,s,c)===0}f.neq=F;function F(e,s,c){return u(e,s,c)!==0}f.gte=$;function $(e,s,c){return u(e,s,c)>=0}f.lte=H;function H(e,s,c){return u(e,s,c)<=0}f.cmp=Se;function Se(e,s,c,I){switch(s){case"===":return typeof e=="object"&&(e=e.version),typeof c=="object"&&(c=c.version),e===c;case"!==":return typeof e=="object"&&(e=e.version),typeof c=="object"&&(c=c.version),e!==c;case"":case"=":case"==":return V(e,c,I);case"!=":return F(e,c,I);case">":return j(e,c,I);case">=":return $(e,c,I);case"<":return X(e,c,I);case"<=":return H(e,c,I);default:throw new TypeError("Invalid operator: "+s)}}f.Comparator=Y;function Y(e,s){if((!s||typeof s!="object")&&(s={loose:!!s,includePrerelease:!1}),e instanceof Y){if(e.loose===!!s.loose)return e;e=e.value}if(!(this instanceof Y))return new Y(e,s);e=e.trim().split(/\s+/).join(" "),z("comparator",e,s),this.options=s,this.loose=!!s.loose,this.parse(e),this.semver===fe?this.value="":this.value=this.operator+this.semver.version,z("comp",this)}var fe={};Y.prototype.parse=function(e){var s=this.options.loose?C[E.COMPARATORLOOSE]:C[E.COMPARATOR],c=e.match(s);if(!c)throw new TypeError("Invalid comparator: "+e);this.operator=c[1]!==void 0?c[1]:"",this.operator==="="&&(this.operator=""),c[2]?this.semver=new D(c[2],this.options.loose):this.semver=fe},Y.prototype.toString=function(){return this.value},Y.prototype.test=function(e){if(z("Comparator.test",e,this.options.loose),this.semver===fe||e===fe)return!0;if(typeof e=="string")try{e=new D(e,this.options)}catch{return!1}return Se(e,this.operator,this.semver,this.options)},Y.prototype.intersects=function(e,s){if(!(e instanceof Y))throw new TypeError("a Comparator is required");(!s||typeof s!="object")&&(s={loose:!!s,includePrerelease:!1});var c;if(this.operator==="")return this.value===""?!0:(c=new M(e.value,s),ke(this.value,c,s));if(e.operator==="")return e.value===""?!0:(c=new M(this.value,s),ke(e.semver,c,s));var I=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">"),N=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<"),T=this.semver.version===e.semver.version,v=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<="),G=Se(this.semver,"<",e.semver,s)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<"),_=Se(this.semver,">",e.semver,s)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return I||N||T&&v||G||_},f.Range=M;function M(e,s){if((!s||typeof s!="object")&&(s={loose:!!s,includePrerelease:!1}),e instanceof M)return e.loose===!!s.loose&&e.includePrerelease===!!s.includePrerelease?e:new M(e.raw,s);if(e instanceof Y)return new M(e.value,s);if(!(this instanceof M))return new M(e,s);if(this.options=s,this.loose=!!s.loose,this.includePrerelease=!!s.includePrerelease,this.raw=e.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map(function(c){return this.parseRange(c.trim())},this).filter(function(c){return c.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+this.raw);this.format()}M.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},M.prototype.toString=function(){return this.range},M.prototype.parseRange=function(e){var s=this.options.loose,c=s?C[E.HYPHENRANGELOOSE]:C[E.HYPHENRANGE];e=e.replace(c,Tt),z("hyphen replace",e),e=e.replace(C[E.COMPARATORTRIM],O),z("comparator trim",e,C[E.COMPARATORTRIM]),e=e.replace(C[E.TILDETRIM],ge),e=e.replace(C[E.CARETTRIM],we),e=e.split(/\s+/).join(" ");var I=s?C[E.COMPARATORLOOSE]:C[E.COMPARATOR],N=e.split(" ").map(function(T){return Z(T,this.options)},this).join(" ").split(/\s+/);return this.options.loose&&(N=N.filter(function(T){return!!T.match(I)})),N=N.map(function(T){return new Y(T,this.options)},this),N},M.prototype.intersects=function(e,s){if(!(e instanceof M))throw new TypeError("a Range is required");return this.set.some(function(c){return Re(c,s)&&e.set.some(function(I){return Re(I,s)&&c.every(function(N){return I.every(function(T){return N.intersects(T,s)})})})})};function Re(e,s){for(var c=!0,I=e.slice(),N=I.pop();c&&I.length;)c=I.every(function(T){return N.intersects(T,s)}),N=I.pop();return c}f.toComparators=Q;function Q(e,s){return new M(e,s).set.map(function(c){return c.map(function(I){return I.value}).join(" ").trim().split(" ")})}function Z(e,s){return z("comp",e,s),e=Rt(e,s),z("caret",e),e=St(e,s),z("tildes",e),e=zt(e,s),z("xrange",e),e=Ot(e,s),z("stars",e),e}function B(e){return!e||e.toLowerCase()==="x"||e==="*"}function St(e,s){return e.trim().split(/\s+/).map(function(c){return It(c,s)}).join(" ")}function It(e,s){var c=s.loose?C[E.TILDELOOSE]:C[E.TILDE];return e.replace(c,function(I,N,T,v,G){z("tilde",e,I,N,T,v,G);var _;return B(N)?_="":B(T)?_=">="+N+".0.0 <"+(+N+1)+".0.0":B(v)?_=">="+N+"."+T+".0 <"+N+"."+(+T+1)+".0":G?(z("replaceTilde pr",G),_=">="+N+"."+T+"."+v+"-"+G+" <"+N+"."+(+T+1)+".0"):_=">="+N+"."+T+"."+v+" <"+N+"."+(+T+1)+".0",z("tilde return",_),_})}function Rt(e,s){return e.trim().split(/\s+/).map(function(c){return At(c,s)}).join(" ")}function At(e,s){z("caret",e,s);var c=s.loose?C[E.CARETLOOSE]:C[E.CARET];return e.replace(c,function(I,N,T,v,G){z("caret",e,I,N,T,v,G);var _;return B(N)?_="":B(T)?_=">="+N+".0.0 <"+(+N+1)+".0.0":B(v)?N==="0"?_=">="+N+"."+T+".0 <"+N+"."+(+T+1)+".0":_=">="+N+"."+T+".0 <"+(+N+1)+".0.0":G?(z("replaceCaret pr",G),N==="0"?T==="0"?_=">="+N+"."+T+"."+v+"-"+G+" <"+N+"."+T+"."+(+v+1):_=">="+N+"."+T+"."+v+"-"+G+" <"+N+"."+(+T+1)+".0":_=">="+N+"."+T+"."+v+"-"+G+" <"+(+N+1)+".0.0"):(z("no pr"),N==="0"?T==="0"?_=">="+N+"."+T+"."+v+" <"+N+"."+T+"."+(+v+1):_=">="+N+"."+T+"."+v+" <"+N+"."+(+T+1)+".0":_=">="+N+"."+T+"."+v+" <"+(+N+1)+".0.0"),z("caret return",_),_})}function zt(e,s){return z("replaceXRanges",e,s),e.split(/\s+/).map(function(c){return Nt(c,s)}).join(" ")}function Nt(e,s){e=e.trim();var c=s.loose?C[E.XRANGELOOSE]:C[E.XRANGE];return e.replace(c,function(I,N,T,v,G,_){z("xRange",e,I,N,T,v,G,_);var he=B(T),de=he||B(v),ie=de||B(G),te=ie;return N==="="&&te&&(N=""),_=s.includePrerelease?"-0":"",he?N===">"||N==="<"?I="<0.0.0-0":I="*":N&&te?(de&&(v=0),G=0,N===">"?(N=">=",de?(T=+T+1,v=0,G=0):(v=+v+1,G=0)):N==="<="&&(N="<",de?T=+T+1:v=+v+1),I=N+T+"."+v+"."+G+_):de?I=">="+T+".0.0"+_+" <"+(+T+1)+".0.0"+_:ie&&(I=">="+T+"."+v+".0"+_+" <"+T+"."+(+v+1)+".0"+_),z("xRange return",I),I})}function Ot(e,s){return z("replaceStars",e,s),e.trim().replace(C[E.STAR],"")}function Tt(e,s,c,I,N,T,v,G,_,he,de,ie,te){return B(c)?s="":B(I)?s=">="+c+".0.0":B(N)?s=">="+c+"."+I+".0":s=">="+s,B(_)?G="":B(he)?G="<"+(+_+1)+".0.0":B(de)?G="<"+_+"."+(+he+1)+".0":ie?G="<="+_+"."+he+"."+de+"-"+ie:G="<="+G,(s+" "+G).trim()}M.prototype.test=function(e){if(!e)return!1;if(typeof e=="string")try{e=new D(e,this.options)}catch{return!1}for(var s=0;s<this.set.length;s++)if(wt(this.set[s],e,this.options))return!0;return!1};function wt(e,s,c){for(var I=0;I<e.length;I++)if(!e[I].test(s))return!1;if(s.prerelease.length&&!c.includePrerelease){for(I=0;I<e.length;I++)if(z(e[I].semver),e[I].semver!==fe&&e[I].semver.prerelease.length>0){var N=e[I].semver;if(N.major===s.major&&N.minor===s.minor&&N.patch===s.patch)return!0}return!1}return!0}f.satisfies=ke;function ke(e,s,c){try{s=new M(s,c)}catch{return!1}return s.test(e)}f.maxSatisfying=vt;function vt(e,s,c){var I=null,N=null;try{var T=new M(s,c)}catch{return null}return e.forEach(function(v){T.test(v)&&(!I||N.compare(v)===-1)&&(I=v,N=new D(I,c))}),I}f.minSatisfying=Lt;function Lt(e,s,c){var I=null,N=null;try{var T=new M(s,c)}catch{return null}return e.forEach(function(v){T.test(v)&&(!I||N.compare(v)===1)&&(I=v,N=new D(I,c))}),I}f.minVersion=yt;function yt(e,s){e=new M(e,s);var c=new D("0.0.0");if(e.test(c)||(c=new D("0.0.0-0"),e.test(c)))return c;c=null;for(var I=0;I<e.set.length;++I){var N=e.set[I];N.forEach(function(T){var v=new D(T.semver.version);switch(T.operator){case">":v.prerelease.length===0?v.patch++:v.prerelease.push(0),v.raw=v.format();case"":case">=":(!c||j(c,v))&&(c=v);break;case"<":case"<=":break;default:throw new Error("Unexpected operation: "+T.operator)}})}return c&&e.test(c)?c:null}f.validRange=Ct;function Ct(e,s){try{return new M(e,s).range||"*"}catch{return null}}f.ltr=Dt;function Dt(e,s,c){return Ye(e,s,"<",c)}f.gtr=Pt;function Pt(e,s,c){return Ye(e,s,">",c)}f.outside=Ye;function Ye(e,s,c,I){e=new D(e,I),s=new M(s,I);var N,T,v,G,_;switch(c){case">":N=j,T=H,v=X,G=">",_=">=";break;case"<":N=X,T=$,v=j,G="<",_="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(ke(e,s,I))return!1;for(var he=0;he<s.set.length;++he){var de=s.set[he],ie=null,te=null;if(de.forEach(function(Ae){Ae.semver===fe&&(Ae=new Y(">=0.0.0")),ie=ie||Ae,te=te||Ae,N(Ae.semver,ie.semver,I)?ie=Ae:v(Ae.semver,te.semver,I)&&(te=Ae)}),ie.operator===G||ie.operator===_||(!te.operator||te.operator===G)&&T(e,te.semver))return!1;if(te.operator===_&&v(e,te.semver))return!1}return!0}f.prerelease=bt;function bt(e,s){var c=ue(e,s);return c&&c.prerelease.length?c.prerelease:null}f.intersects=_t;function _t(e,s,c){return e=new M(e,c),s=new M(s,c),e.intersects(s)}f.coerce=kt;function kt(e,s){if(e instanceof D)return e;if(typeof e=="number"&&(e=String(e)),typeof e!="string")return null;s=s||{};var c=null;if(!s.rtl)c=e.match(C[E.COERCE]);else{for(var I;(I=C[E.COERCERTL].exec(e))&&(!c||c.index+c[0].length!==e.length);)(!c||I.index+I[0].length!==c.index+c[0].length)&&(c=I),C[E.COERCERTL].lastIndex=I.index+I[1].length+I[2].length;C[E.COERCERTL].lastIndex=-1}return c===null?null:ue(c[2]+"."+(c[3]||"0")+"."+(c[4]||"0"),s)}})(ir,ir.exports);var Rn=ir.exports;const An=Hr(Rn),zn=i=>i==null?[]:Array.isArray(i)?i:[i],Nn=t.z.any().refine(i=>typeof i=="bigint",{message:"Value must be a BigInt"}).transform(i=>BigInt(i));var On=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ke=Math.ceil,se=Math.floor,ee="[BigNumber Error] ",Nr=ee+"Number primitive has more than 15 significant digits: ",le=1e14,b=14,Je=9007199254740991,Qe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],ze=1e7,W=1e9;function Wr(i){var f,z,w,R=O.prototype={constructor:O,toString:null,valueOf:null},x=new O(1),U=20,k=4,C=-7,S=21,E=-1e7,K=1e7,P=!1,Ee=1,ne=0,pe={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},ge="0123456789abcdefghijklmnopqrstuvwxyz",we=!0;function O(r,n){var a,d,l,h,g,o,u,p,m=this;if(!(m instanceof O))return new O(r,n);if(n==null){if(r&&r._isBigNumber===!0){m.s=r.s,!r.c||r.e>K?m.c=m.e=null:r.e<E?m.c=[m.e=0]:(m.e=r.e,m.c=r.c.slice());return}if((o=typeof r=="number")&&r*0==0){if(m.s=1/r<0?(r=-r,-1):1,r===~~r){for(h=0,g=r;g>=10;g/=10,h++);h>K?m.c=m.e=null:(m.e=h,m.c=[r]);return}p=String(r)}else{if(!On.test(p=String(r)))return w(m,p,o);m.s=p.charCodeAt(0)==45?(p=p.slice(1),-1):1}(h=p.indexOf("."))>-1&&(p=p.replace(".","")),(g=p.search(/e/i))>0?(h<0&&(h=g),h+=+p.slice(g+1),p=p.substring(0,g)):h<0&&(h=p.length)}else{if(q(n,2,ge.length,"Base"),n==10&&we)return m=new O(r),J(m,U+m.e+1,k);if(p=String(r),o=typeof r=="number"){if(r*0!=0)return w(m,p,o,n);if(m.s=1/r<0?(p=p.slice(1),-1):1,O.DEBUG&&p.replace(/^0\.0*|\./,"").length>15)throw Error(Nr+r)}else m.s=p.charCodeAt(0)===45?(p=p.slice(1),-1):1;for(a=ge.slice(0,n),h=g=0,u=p.length;g<u;g++)if(a.indexOf(d=p.charAt(g))<0){if(d=="."){if(g>h){h=u;continue}}else if(!l&&(p==p.toUpperCase()&&(p=p.toLowerCase())||p==p.toLowerCase()&&(p=p.toUpperCase()))){l=!0,g=-1,h=0;continue}return w(m,String(r),o,n)}o=!1,p=z(p,n,10,m.s),(h=p.indexOf("."))>-1?p=p.replace(".",""):h=p.length}for(g=0;p.charCodeAt(g)===48;g++);for(u=p.length;p.charCodeAt(--u)===48;);if(p=p.slice(g,++u)){if(u-=g,o&&O.DEBUG&&u>15&&(r>Je||r!==se(r)))throw Error(Nr+m.s*r);if((h=h-g-1)>K)m.c=m.e=null;else if(h<E)m.c=[m.e=0];else{if(m.e=h,m.c=[],g=(h+1)%b,h<0&&(g+=b),g<u){for(g&&m.c.push(+p.slice(0,g)),u-=b;g<u;)m.c.push(+p.slice(g,g+=b));g=b-(p=p.slice(g)).length}else g-=u;for(;g--;p+="0");m.c.push(+p)}}else m.c=[m.e=0]}O.clone=Wr,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(r){var n,a;if(r!=null)if(typeof r=="object"){if(r.hasOwnProperty(n="DECIMAL_PLACES")&&(a=r[n],q(a,0,W,n),U=a),r.hasOwnProperty(n="ROUNDING_MODE")&&(a=r[n],q(a,0,8,n),k=a),r.hasOwnProperty(n="EXPONENTIAL_AT")&&(a=r[n],a&&a.pop?(q(a[0],-W,0,n),q(a[1],0,W,n),C=a[0],S=a[1]):(q(a,-W,W,n),C=-(S=a<0?-a:a))),r.hasOwnProperty(n="RANGE"))if(a=r[n],a&&a.pop)q(a[0],-W,-1,n),q(a[1],1,W,n),E=a[0],K=a[1];else if(q(a,-W,W,n),a)E=-(K=a<0?-a:a);else throw Error(ee+n+" cannot be zero: "+a);if(r.hasOwnProperty(n="CRYPTO"))if(a=r[n],a===!!a)if(a)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))P=a;else throw P=!a,Error(ee+"crypto unavailable");else P=a;else throw Error(ee+n+" not true or false: "+a);if(r.hasOwnProperty(n="MODULO_MODE")&&(a=r[n],q(a,0,9,n),Ee=a),r.hasOwnProperty(n="POW_PRECISION")&&(a=r[n],q(a,0,W,n),ne=a),r.hasOwnProperty(n="FORMAT"))if(a=r[n],typeof a=="object")pe=a;else throw Error(ee+n+" not an object: "+a);if(r.hasOwnProperty(n="ALPHABET"))if(a=r[n],typeof a=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(a))we=a.slice(0,10)=="0123456789",ge=a;else throw Error(ee+n+" invalid: "+a)}else throw Error(ee+"Object expected: "+r);return{DECIMAL_PLACES:U,ROUNDING_MODE:k,EXPONENTIAL_AT:[C,S],RANGE:[E,K],CRYPTO:P,MODULO_MODE:Ee,POW_PRECISION:ne,FORMAT:pe,ALPHABET:ge}},O.isBigNumber=function(r){if(!r||r._isBigNumber!==!0)return!1;if(!O.DEBUG)return!0;var n,a,d=r.c,l=r.e,h=r.s;e:if({}.toString.call(d)=="[object Array]"){if((h===1||h===-1)&&l>=-W&&l<=W&&l===se(l)){if(d[0]===0){if(l===0&&d.length===1)return!0;break e}if(n=(l+1)%b,n<1&&(n+=b),String(d[0]).length==n){for(n=0;n<d.length;n++)if(a=d[n],a<0||a>=le||a!==se(a))break e;if(a!==0)return!0}}}else if(d===null&&l===null&&(h===null||h===1||h===-1))return!0;throw Error(ee+"Invalid BigNumber: "+r)},O.maximum=O.max=function(){return ue(arguments,-1)},O.minimum=O.min=function(){return ue(arguments,1)},O.random=function(){var r=9007199254740992,n=Math.random()*r&2097151?function(){return se(Math.random()*r)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(a){var d,l,h,g,o,u=0,p=[],m=new O(x);if(a==null?a=U:q(a,0,W),g=Ke(a/b),P)if(crypto.getRandomValues){for(d=crypto.getRandomValues(new Uint32Array(g*=2));u<g;)o=d[u]*131072+(d[u+1]>>>11),o>=9e15?(l=crypto.getRandomValues(new Uint32Array(2)),d[u]=l[0],d[u+1]=l[1]):(p.push(o%1e14),u+=2);u=g/2}else if(crypto.randomBytes){for(d=crypto.randomBytes(g*=7);u<g;)o=(d[u]&31)*281474976710656+d[u+1]*1099511627776+d[u+2]*4294967296+d[u+3]*16777216+(d[u+4]<<16)+(d[u+5]<<8)+d[u+6],o>=9e15?crypto.randomBytes(7).copy(d,u):(p.push(o%1e14),u+=7);u=g/7}else throw P=!1,Error(ee+"crypto unavailable");if(!P)for(;u<g;)o=n(),o<9e15&&(p[u++]=o%1e14);for(g=p[--u],a%=b,g&&a&&(o=Qe[b-a],p[u]=se(g/o)*o);p[u]===0;p.pop(),u--);if(u<0)p=[h=0];else{for(h=-1;p[0]===0;p.splice(0,1),h-=b);for(u=1,o=p[0];o>=10;o/=10,u++);u<b&&(h-=b-u)}return m.e=h,m.c=p,m}}(),O.sum=function(){for(var r=1,n=arguments,a=new O(n[0]);r<n.length;)a=a.plus(n[r++]);return a},z=function(){var r="0123456789";function n(a,d,l,h){for(var g,o=[0],u,p=0,m=a.length;p<m;){for(u=o.length;u--;o[u]*=d);for(o[0]+=h.indexOf(a.charAt(p++)),g=0;g<o.length;g++)o[g]>l-1&&(o[g+1]==null&&(o[g+1]=0),o[g+1]+=o[g]/l|0,o[g]%=l)}return o.reverse()}return function(a,d,l,h,g){var o,u,p,m,A,L,y,j,X=a.indexOf("."),V=U,F=k;for(X>=0&&(m=ne,ne=0,a=a.replace(".",""),j=new O(d),L=j.pow(a.length-X),ne=m,j.c=n(Ie(ae(L.c),L.e,"0"),10,l,r),j.e=j.c.length),y=n(a,d,l,g?(o=ge,r):(o=r,ge)),p=m=y.length;y[--m]==0;y.pop());if(!y[0])return o.charAt(0);if(X<0?--p:(L.c=y,L.e=p,L.s=h,L=f(L,j,V,F,l),y=L.c,A=L.r,p=L.e),u=p+V+1,X=y[u],m=l/2,A=A||u<0||y[u+1]!=null,A=F<4?(X!=null||A)&&(F==0||F==(L.s<0?3:2)):X>m||X==m&&(F==4||A||F==6&&y[u-1]&1||F==(L.s<0?8:7)),u<1||!y[0])a=A?Ie(o.charAt(1),-V,o.charAt(0)):o.charAt(0);else{if(y.length=u,A)for(--l;++y[--u]>l;)y[u]=0,u||(++p,y=[1].concat(y));for(m=y.length;!y[--m];);for(X=0,a="";X<=m;a+=o.charAt(y[X++]));a=Ie(a,p,o.charAt(0))}return a}}(),f=function(){function r(d,l,h){var g,o,u,p,m=0,A=d.length,L=l%ze,y=l/ze|0;for(d=d.slice();A--;)u=d[A]%ze,p=d[A]/ze|0,g=y*u+p*L,o=L*u+g%ze*ze+m,m=(o/h|0)+(g/ze|0)+y*p,d[A]=o%h;return m&&(d=[m].concat(d)),d}function n(d,l,h,g){var o,u;if(h!=g)u=h>g?1:-1;else for(o=u=0;o<h;o++)if(d[o]!=l[o]){u=d[o]>l[o]?1:-1;break}return u}function a(d,l,h,g){for(var o=0;h--;)d[h]-=o,o=d[h]<l[h]?1:0,d[h]=o*g+d[h]-l[h];for(;!d[0]&&d.length>1;d.splice(0,1));}return function(d,l,h,g,o){var u,p,m,A,L,y,j,X,V,F,$,H,Se,Y,fe,M,Re,Q=d.s==l.s?1:-1,Z=d.c,B=l.c;if(!Z||!Z[0]||!B||!B[0])return new O(!d.s||!l.s||(Z?B&&Z[0]==B[0]:!B)?NaN:Z&&Z[0]==0||!B?Q*0:Q/0);for(X=new O(Q),V=X.c=[],p=d.e-l.e,Q=h+p+1,o||(o=le,p=oe(d.e/b)-oe(l.e/b),Q=Q/b|0),m=0;B[m]==(Z[m]||0);m++);if(B[m]>(Z[m]||0)&&p--,Q<0)V.push(1),A=!0;else{for(Y=Z.length,M=B.length,m=0,Q+=2,L=se(o/(B[0]+1)),L>1&&(B=r(B,L,o),Z=r(Z,L,o),M=B.length,Y=Z.length),Se=M,F=Z.slice(0,M),$=F.length;$<M;F[$++]=0);Re=B.slice(),Re=[0].concat(Re),fe=B[0],B[1]>=o/2&&fe++;do{if(L=0,u=n(B,F,M,$),u<0){if(H=F[0],M!=$&&(H=H*o+(F[1]||0)),L=se(H/fe),L>1)for(L>=o&&(L=o-1),y=r(B,L,o),j=y.length,$=F.length;n(y,F,j,$)==1;)L--,a(y,M<j?Re:B,j,o),j=y.length,u=1;else L==0&&(u=L=1),y=B.slice(),j=y.length;if(j<$&&(y=[0].concat(y)),a(F,y,$,o),$=F.length,u==-1)for(;n(B,F,M,$)<1;)L++,a(F,M<$?Re:B,$,o),$=F.length}else u===0&&(L++,F=[0]);V[m++]=L,F[0]?F[$++]=Z[Se]||0:(F=[Z[Se]],$=1)}while((Se++<Y||F[0]!=null)&&Q--);A=F[0]!=null,V[0]||V.splice(0,1)}if(o==le){for(m=1,Q=V[0];Q>=10;Q/=10,m++);J(X,h+(X.e=m+p*b-1)+1,g,A)}else X.e=p,X.r=+A;return X}}();function re(r,n,a,d){var l,h,g,o,u;if(a==null?a=k:q(a,0,8),!r.c)return r.toString();if(l=r.c[0],g=r.e,n==null)u=ae(r.c),u=d==1||d==2&&(g<=C||g>=S)?Be(u,g):Ie(u,g,"0");else if(r=J(new O(r),n,a),h=r.e,u=ae(r.c),o=u.length,d==1||d==2&&(n<=h||h<=C)){for(;o<n;u+="0",o++);u=Be(u,h)}else if(n-=g,u=Ie(u,h,"0"),h+1>o){if(--n>0)for(u+=".";n--;u+="0");}else if(n+=h-o,n>0)for(h+1==o&&(u+=".");n--;u+="0");return r.s<0&&l?"-"+u:u}function ue(r,n){for(var a,d,l=1,h=new O(r[0]);l<r.length;l++)d=new O(r[l]),(!d.s||(a=Oe(h,d))===n||a===0&&h.s===n)&&(h=d);return h}function ve(r,n,a){for(var d=1,l=n.length;!n[--l];n.pop());for(l=n[0];l>=10;l/=10,d++);return(a=d+a*b-1)>K?r.c=r.e=null:a<E?r.c=[r.e=0]:(r.e=a,r.c=n),r}w=function(){var r=/^(-?)0([xbo])(?=\w[\w.]*$)/i,n=/^([^.]+)\.$/,a=/^\.([^.]+)$/,d=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(h,g,o,u){var p,m=o?g:g.replace(l,"");if(d.test(m))h.s=isNaN(m)?null:m<0?-1:1;else{if(!o&&(m=m.replace(r,function(A,L,y){return p=(y=y.toLowerCase())=="x"?16:y=="b"?2:8,!u||u==p?L:A}),u&&(p=u,m=m.replace(n,"$1").replace(a,"0.$1")),g!=m))return new O(m,p);if(O.DEBUG)throw Error(ee+"Not a"+(u?" base "+u:"")+" number: "+g);h.s=null}h.c=h.e=null}}();function J(r,n,a,d){var l,h,g,o,u,p,m,A=r.c,L=Qe;if(A){e:{for(l=1,o=A[0];o>=10;o/=10,l++);if(h=n-l,h<0)h+=b,g=n,u=A[p=0],m=se(u/L[l-g-1]%10);else if(p=Ke((h+1)/b),p>=A.length)if(d){for(;A.length<=p;A.push(0));u=m=0,l=1,h%=b,g=h-b+1}else break e;else{for(u=o=A[p],l=1;o>=10;o/=10,l++);h%=b,g=h-b+l,m=g<0?0:se(u/L[l-g-1]%10)}if(d=d||n<0||A[p+1]!=null||(g<0?u:u%L[l-g-1]),d=a<4?(m||d)&&(a==0||a==(r.s<0?3:2)):m>5||m==5&&(a==4||d||a==6&&(h>0?g>0?u/L[l-g]:0:A[p-1])%10&1||a==(r.s<0?8:7)),n<1||!A[0])return A.length=0,d?(n-=r.e+1,A[0]=L[(b-n%b)%b],r.e=-n||0):A[0]=r.e=0,r;if(h==0?(A.length=p,o=1,p--):(A.length=p+1,o=L[b-h],A[p]=g>0?se(u/L[l-g]%L[g])*o:0),d)for(;;)if(p==0){for(h=1,g=A[0];g>=10;g/=10,h++);for(g=A[0]+=o,o=1;g>=10;g/=10,o++);h!=o&&(r.e++,A[0]==le&&(A[0]=1));break}else{if(A[p]+=o,A[p]!=le)break;A[p--]=0,o=1}for(h=A.length;A[--h]===0;A.pop());}r.e>K?r.c=r.e=null:r.e<E&&(r.c=[r.e=0])}return r}function D(r){var n,a=r.e;return a===null?r.toString():(n=ae(r.c),n=a<=C||a>=S?Be(n,a):Ie(n,a,"0"),r.s<0?"-"+n:n)}return R.absoluteValue=R.abs=function(){var r=new O(this);return r.s<0&&(r.s=1),r},R.comparedTo=function(r,n){return Oe(this,new O(r,n))},R.decimalPlaces=R.dp=function(r,n){var a,d,l,h=this;if(r!=null)return q(r,0,W),n==null?n=k:q(n,0,8),J(new O(h),r+h.e+1,n);if(!(a=h.c))return null;if(d=((l=a.length-1)-oe(this.e/b))*b,l=a[l])for(;l%10==0;l/=10,d--);return d<0&&(d=0),d},R.dividedBy=R.div=function(r,n){return f(this,new O(r,n),U,k)},R.dividedToIntegerBy=R.idiv=function(r,n){return f(this,new O(r,n),0,1)},R.exponentiatedBy=R.pow=function(r,n){var a,d,l,h,g,o,u,p,m,A=this;if(r=new O(r),r.c&&!r.isInteger())throw Error(ee+"Exponent not an integer: "+D(r));if(n!=null&&(n=new O(n)),o=r.e>14,!A.c||!A.c[0]||A.c[0]==1&&!A.e&&A.c.length==1||!r.c||!r.c[0])return m=new O(Math.pow(+D(A),o?r.s*(2-je(r)):+D(r))),n?m.mod(n):m;if(u=r.s<0,n){if(n.c?!n.c[0]:!n.s)return new O(NaN);d=!u&&A.isInteger()&&n.isInteger(),d&&(A=A.mod(n))}else{if(r.e>9&&(A.e>0||A.e<-1||(A.e==0?A.c[0]>1||o&&A.c[1]>=24e7:A.c[0]<8e13||o&&A.c[0]<=9999975e7)))return h=A.s<0&&je(r)?-0:0,A.e>-1&&(h=1/h),new O(u?1/h:h);ne&&(h=Ke(ne/b+2))}for(o?(a=new O(.5),u&&(r.s=1),p=je(r)):(l=Math.abs(+D(r)),p=l%2),m=new O(x);;){if(p){if(m=m.times(A),!m.c)break;h?m.c.length>h&&(m.c.length=h):d&&(m=m.mod(n))}if(l){if(l=se(l/2),l===0)break;p=l%2}else if(r=r.times(a),J(r,r.e+1,1),r.e>14)p=je(r);else{if(l=+D(r),l===0)break;p=l%2}A=A.times(A),h?A.c&&A.c.length>h&&(A.c.length=h):d&&(A=A.mod(n))}return d?m:(u&&(m=x.div(m)),n?m.mod(n):h?J(m,ne,k,g):m)},R.integerValue=function(r){var n=new O(this);return r==null?r=k:q(r,0,8),J(n,n.e+1,r)},R.isEqualTo=R.eq=function(r,n){return Oe(this,new O(r,n))===0},R.isFinite=function(){return!!this.c},R.isGreaterThan=R.gt=function(r,n){return Oe(this,new O(r,n))>0},R.isGreaterThanOrEqualTo=R.gte=function(r,n){return(n=Oe(this,new O(r,n)))===1||n===0},R.isInteger=function(){return!!this.c&&oe(this.e/b)>this.c.length-2},R.isLessThan=R.lt=function(r,n){return Oe(this,new O(r,n))<0},R.isLessThanOrEqualTo=R.lte=function(r,n){return(n=Oe(this,new O(r,n)))===-1||n===0},R.isNaN=function(){return!this.s},R.isNegative=function(){return this.s<0},R.isPositive=function(){return this.s>0},R.isZero=function(){return!!this.c&&this.c[0]==0},R.minus=function(r,n){var a,d,l,h,g=this,o=g.s;if(r=new O(r,n),n=r.s,!o||!n)return new O(NaN);if(o!=n)return r.s=-n,g.plus(r);var u=g.e/b,p=r.e/b,m=g.c,A=r.c;if(!u||!p){if(!m||!A)return m?(r.s=-n,r):new O(A?g:NaN);if(!m[0]||!A[0])return A[0]?(r.s=-n,r):new O(m[0]?g:k==3?-0:0)}if(u=oe(u),p=oe(p),m=m.slice(),o=u-p){for((h=o<0)?(o=-o,l=m):(p=u,l=A),l.reverse(),n=o;n--;l.push(0));l.reverse()}else for(d=(h=(o=m.length)<(n=A.length))?o:n,o=n=0;n<d;n++)if(m[n]!=A[n]){h=m[n]<A[n];break}if(h&&(l=m,m=A,A=l,r.s=-r.s),n=(d=A.length)-(a=m.length),n>0)for(;n--;m[a++]=0);for(n=le-1;d>o;){if(m[--d]<A[d]){for(a=d;a&&!m[--a];m[a]=n);--m[a],m[d]+=le}m[d]-=A[d]}for(;m[0]==0;m.splice(0,1),--p);return m[0]?ve(r,m,p):(r.s=k==3?-1:1,r.c=[r.e=0],r)},R.modulo=R.mod=function(r,n){var a,d,l=this;return r=new O(r,n),!l.c||!r.s||r.c&&!r.c[0]?new O(NaN):!r.c||l.c&&!l.c[0]?new O(l):(Ee==9?(d=r.s,r.s=1,a=f(l,r,0,3),r.s=d,a.s*=d):a=f(l,r,0,Ee),r=l.minus(a.times(r)),!r.c[0]&&Ee==1&&(r.s=l.s),r)},R.multipliedBy=R.times=function(r,n){var a,d,l,h,g,o,u,p,m,A,L,y,j,X,V,F=this,$=F.c,H=(r=new O(r,n)).c;if(!$||!H||!$[0]||!H[0])return!F.s||!r.s||$&&!$[0]&&!H||H&&!H[0]&&!$?r.c=r.e=r.s=null:(r.s*=F.s,!$||!H?r.c=r.e=null:(r.c=[0],r.e=0)),r;for(d=oe(F.e/b)+oe(r.e/b),r.s*=F.s,u=$.length,A=H.length,u<A&&(j=$,$=H,H=j,l=u,u=A,A=l),l=u+A,j=[];l--;j.push(0));for(X=le,V=ze,l=A;--l>=0;){for(a=0,L=H[l]%V,y=H[l]/V|0,g=u,h=l+g;h>l;)p=$[--g]%V,m=$[g]/V|0,o=y*p+m*L,p=L*p+o%V*V+j[h]+a,a=(p/X|0)+(o/V|0)+y*m,j[h--]=p%X;j[h]=a}return a?++d:j.splice(0,1),ve(r,j,d)},R.negated=function(){var r=new O(this);return r.s=-r.s||null,r},R.plus=function(r,n){var a,d=this,l=d.s;if(r=new O(r,n),n=r.s,!l||!n)return new O(NaN);if(l!=n)return r.s=-n,d.minus(r);var h=d.e/b,g=r.e/b,o=d.c,u=r.c;if(!h||!g){if(!o||!u)return new O(l/0);if(!o[0]||!u[0])return u[0]?r:new O(o[0]?d:l*0)}if(h=oe(h),g=oe(g),o=o.slice(),l=h-g){for(l>0?(g=h,a=u):(l=-l,a=o),a.reverse();l--;a.push(0));a.reverse()}for(l=o.length,n=u.length,l-n<0&&(a=u,u=o,o=a,n=l),l=0;n;)l=(o[--n]=o[n]+u[n]+l)/le|0,o[n]=le===o[n]?0:o[n]%le;return l&&(o=[l].concat(o),++g),ve(r,o,g)},R.precision=R.sd=function(r,n){var a,d,l,h=this;if(r!=null&&r!==!!r)return q(r,1,W),n==null?n=k:q(n,0,8),J(new O(h),r,n);if(!(a=h.c))return null;if(l=a.length-1,d=l*b+1,l=a[l]){for(;l%10==0;l/=10,d--);for(l=a[0];l>=10;l/=10,d++);}return r&&h.e+1>d&&(d=h.e+1),d},R.shiftedBy=function(r){return q(r,-Je,Je),this.times("1e"+r)},R.squareRoot=R.sqrt=function(){var r,n,a,d,l,h=this,g=h.c,o=h.s,u=h.e,p=U+4,m=new O("0.5");if(o!==1||!g||!g[0])return new O(!o||o<0&&(!g||g[0])?NaN:g?h:1/0);if(o=Math.sqrt(+D(h)),o==0||o==1/0?(n=ae(g),(n.length+u)%2==0&&(n+="0"),o=Math.sqrt(+n),u=oe((u+1)/2)-(u<0||u%2),o==1/0?n="5e"+u:(n=o.toExponential(),n=n.slice(0,n.indexOf("e")+1)+u),a=new O(n)):a=new O(o+""),a.c[0]){for(u=a.e,o=u+p,o<3&&(o=0);;)if(l=a,a=m.times(l.plus(f(h,l,p,1))),ae(l.c).slice(0,o)===(n=ae(a.c)).slice(0,o))if(a.e<u&&--o,n=n.slice(o-3,o+1),n=="9999"||!d&&n=="4999"){if(!d&&(J(l,l.e+U+2,0),l.times(l).eq(h))){a=l;break}p+=4,o+=4,d=1}else{(!+n||!+n.slice(1)&&n.charAt(0)=="5")&&(J(a,a.e+U+2,1),r=!a.times(a).eq(h));break}}return J(a,a.e+U+1,k,r)},R.toExponential=function(r,n){return r!=null&&(q(r,0,W),r++),re(this,r,n,1)},R.toFixed=function(r,n){return r!=null&&(q(r,0,W),r=r+this.e+1),re(this,r,n)},R.toFormat=function(r,n,a){var d,l=this;if(a==null)r!=null&&n&&typeof n=="object"?(a=n,n=null):r&&typeof r=="object"?(a=r,r=n=null):a=pe;else if(typeof a!="object")throw Error(ee+"Argument not an object: "+a);if(d=l.toFixed(r,n),l.c){var h,g=d.split("."),o=+a.groupSize,u=+a.secondaryGroupSize,p=a.groupSeparator||"",m=g[0],A=g[1],L=l.s<0,y=L?m.slice(1):m,j=y.length;if(u&&(h=o,o=u,u=h,j-=h),o>0&&j>0){for(h=j%o||o,m=y.substr(0,h);h<j;h+=o)m+=p+y.substr(h,o);u>0&&(m+=p+y.slice(h)),L&&(m="-"+m)}d=A?m+(a.decimalSeparator||"")+((u=+a.fractionGroupSize)?A.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(a.fractionGroupSeparator||"")):A):m}return(a.prefix||"")+d+(a.suffix||"")},R.toFraction=function(r){var n,a,d,l,h,g,o,u,p,m,A,L,y=this,j=y.c;if(r!=null&&(o=new O(r),!o.isInteger()&&(o.c||o.s!==1)||o.lt(x)))throw Error(ee+"Argument "+(o.isInteger()?"out of range: ":"not an integer: ")+D(o));if(!j)return new O(y);for(n=new O(x),p=a=new O(x),d=u=new O(x),L=ae(j),h=n.e=L.length-y.e-1,n.c[0]=Qe[(g=h%b)<0?b+g:g],r=!r||o.comparedTo(n)>0?h>0?n:p:o,g=K,K=1/0,o=new O(L),u.c[0]=0;m=f(o,n,0,1),l=a.plus(m.times(d)),l.comparedTo(r)!=1;)a=d,d=l,p=u.plus(m.times(l=p)),u=l,n=o.minus(m.times(l=n)),o=l;return l=f(r.minus(a),d,0,1),u=u.plus(l.times(p)),a=a.plus(l.times(d)),u.s=p.s=y.s,h=h*2,A=f(p,d,h,k).minus(y).abs().comparedTo(f(u,a,h,k).minus(y).abs())<1?[p,d]:[u,a],K=g,A},R.toNumber=function(){return+D(this)},R.toPrecision=function(r,n){return r!=null&&q(r,1,W),re(this,r,n,2)},R.toString=function(r){var n,a=this,d=a.s,l=a.e;return l===null?d?(n="Infinity",d<0&&(n="-"+n)):n="NaN":(r==null?n=l<=C||l>=S?Be(ae(a.c),l):Ie(ae(a.c),l,"0"):r===10&&we?(a=J(new O(a),U+l+1,k),n=Ie(ae(a.c),a.e,"0")):(q(r,2,ge.length,"Base"),n=z(Ie(ae(a.c),l,"0"),10,r,d,!0)),d<0&&a.c[0]&&(n="-"+n)),n},R.valueOf=R.toJSON=function(){return D(this)},R._isBigNumber=!0,R[Symbol.toStringTag]="BigNumber",R[Symbol.for("nodejs.util.inspect.custom")]=R.valueOf,i!=null&&O.set(i),O}function oe(i){var f=i|0;return i>0||i===f?f:f-1}function ae(i){for(var f,z,w=1,R=i.length,x=i[0]+"";w<R;){for(f=i[w++]+"",z=b-f.length;z--;f="0"+f);x+=f}for(R=x.length;x.charCodeAt(--R)===48;);return x.slice(0,R+1||1)}function Oe(i,f){var z,w,R=i.c,x=f.c,U=i.s,k=f.s,C=i.e,S=f.e;if(!U||!k)return null;if(z=R&&!R[0],w=x&&!x[0],z||w)return z?w?0:-k:U;if(U!=k)return U;if(z=U<0,w=C==S,!R||!x)return w?0:!R^z?1:-1;if(!w)return C>S^z?1:-1;for(k=(C=R.length)<(S=x.length)?C:S,U=0;U<k;U++)if(R[U]!=x[U])return R[U]>x[U]^z?1:-1;return C==S?0:C>S^z?1:-1}function q(i,f,z,w){if(i<f||i>z||i!==se(i))throw Error(ee+(w||"Argument")+(typeof i=="number"?i<f||i>z?" out of range: ":" not an integer: ":" not a primitive number: ")+String(i))}function je(i){var f=i.c.length-1;return oe(i.e/b)==f&&i.c[f]%2!=0}function Be(i,f){return(i.length>1?i.charAt(0)+"."+i.slice(1):i)+(f<0?"e":"e+")+f}function Ie(i,f,z){var w,R;if(f<0){for(R=z+".";++f;R+=z);i=R+i}else if(w=i.length,++f>w){for(R=z,f-=w;--f;R+=z);i+=R}else f<w&&(i=i.slice(0,f)+"."+i.slice(f));return i}var Tn=Wr();const wn=t.z.boolean().transform(i=>String(i)),vn=t.z.string().transform(i=>i==="true");function Or(i){return t.z.object(i).passthrough().superRefine(f=>{const z=Object.keys(i),w=Object.keys(f).filter(R=>!z.includes(R));w.length>0&&`${w.join(", ")}`})}function Zr(i){const f=Or(i);return Object.assign(f,{extend:z=>Or({...i,...z})})}const Ln=(i,f)=>{try{return{success:!0,data:i.parse(f)}}catch(z){if(z instanceof t.z.ZodError)return console.error("Validation warnings:",z.errors),{success:!1,error:z};throw z}};var ar;(function(i){i[i.function=0]="function",i[i.l1_handler=1]="l1_handler",i[i.constructor=2]="constructor"})(ar||(ar={}));const fr=t.z.array(t.z.string()),Fe=t.z.object({selector:t.z.string(),offset:t.z.string(),builtins:fr.optional()}),hr=t.z.object({CONSTRUCTOR:t.z.array(Fe),EXTERNAL:t.z.array(Fe),L1_HANDLER:t.z.array(Fe)}),yn=t.z.string(),Yr=t.z.object({builtins:fr,data:t.z.array(t.z.string())}),Ge=t.z.object({name:t.z.string(),type:t.z.union([t.z.literal("felt"),t.z.literal("felt*"),t.z.string()])}),Kr=t.z.nativeEnum(ar),Jr=t.z.object({inputs:t.z.array(Ge),name:t.z.string(),outputs:t.z.array(Ge),stateMutability:t.z.literal("view").optional(),state_mutability:t.z.string().optional(),type:Kr}),$e=t.z.object({name:t.z.string(),type:t.z.union([t.z.literal("felt"),t.z.literal("felt*"),t.z.string()]),kind:t.z.union([t.z.literal("key"),t.z.literal("data")])}),Qr=t.z.object({name:t.z.string(),type:t.z.literal("event"),data:t.z.array($e),keys:t.z.array($e)}),et=t.z.object({name:t.z.string(),members:t.z.array($e),kind:t.z.literal("struct"),type:t.z.literal("event")}),rt=t.z.object({members:t.z.array(Ge.and(t.z.object({offset:t.z.number()}))),name:t.z.string(),size:t.z.number(),type:t.z.literal("struct")}),tt=t.z.union([et,Qr]),dr=t.z.array(t.z.union([Jr,tt,rt,t.z.any()])),nt=t.z.object({program:Yr,entry_points_by_type:hr,abi:dr}),mr=t.z.array(t.z.string()),it=t.z.object({type_names:t.z.array(t.z.tuple([t.z.number(),t.z.string()])),libfunc_names:t.z.array(t.z.tuple([t.z.number(),t.z.string()])),user_func_names:t.z.array(t.z.tuple([t.z.number(),t.z.string()]))}),Ue=t.z.object({selector:t.z.string(),function_idx:t.z.number()}),at=t.z.object({CONSTRUCTOR:t.z.array(Ue),EXTERNAL:t.z.array(Ue),L1_HANDLER:t.z.array(Ue)}),st=t.z.object({sierra_program:mr,sierra_program_debug_info:it.optional(),contract_class_version:t.z.string(),entry_points_by_type:at,abi:dr}),ot=t.z.array(t.z.tuple([t.z.number(),t.z.array(t.z.string())])),ct=t.z.object({prime:t.z.string(),compiler_version:t.z.string(),bytecode:mr,hints:t.z.array(t.z.any()),pythonic_hints:ot,entry_points_by_type:hr}),Cn=ct,Dn=t.z.union([nt,st]),lt=cr.createContext(null),Er=()=>cr.useContext(lt),Pn=()=>{var i;return!!((i=Er())!=null&&i.emitter)},bn=({emitter:i,children:f})=>jt.jsx(lt.Provider,{value:{emitter:i},children:f});let Tr=!1;const pr=()=>{var z;const i=(z=Er())==null?void 0:z.emitter;if(!i&&!Tr){Tr=!0;return}return i},_n=()=>{const i=pr();return i?i.emit.bind(i):or.noop},kn=()=>{const i=pr();return(z,w)=>{cr.useEffect(()=>i?i.on(z,w):void 0,[z,w])}},ut=t.z.union([t.z.literal("concentratedLiquidityPosition"),t.z.literal("collateralizedDebtPosition"),t.z.literal("staking")]),jn=t.z.object({status:t.z.literal("initialising")}).or(t.z.object({status:t.z.literal("initialised"),balances:t.z.array(t.z.object({tokenAddress:Xe,tokenBalance:t.z.string()}))})),Ze=t.z.object({id:t.z.number(),address:me,brandColor:t.z.string().optional(),name:t.z.string(),symbol:t.z.string(),decimals:t.z.number(),iconUrl:t.z.string().optional(),sendable:t.z.boolean(),popular:t.z.boolean(),refundable:t.z.boolean(),listed:t.z.boolean(),tradable:t.z.boolean(),category:t.z.union([t.z.literal("tokens"),t.z.literal("currencies"),t.z.literal("savings")]),pricingId:t.z.number().optional(),dappId:t.z.string().optional(),marketData:t.z.object({marketCap:t.z.number(),marketCap24hChange:t.z.number(),dailyVolume:t.z.number(),rank:t.z.number()}).optional(),tags:t.z.array(t.z.string()).optional()}),Bn=t.z.object({tokens:t.z.array(Ze)}),Fn=Ze,gr=t.z.object({pricingId:t.z.number(),ethValue:t.z.string(),ccyValue:t.z.string(),ethDayChange:t.z.string(),ccyDayChange:t.z.string()}),Un=t.z.object({prices:t.z.array(gr)}),sr=t.z.object({tokenAddress:Xe,principal:t.z.string(),accruedFees:t.z.string(),minPrice:t.z.string(),maxPrice:t.z.string(),currentPrice:t.z.string()}),Sr=t.z.object({tokenAddress:me.optional(),totalBalances:t.z.record(t.z.string())}),Ir=Sr.extend({tokenId:t.z.string(),data:t.z.object({poolFeePercentage:t.z.string(),tickSpacingPercentage:t.z.string().optional(),token0:sr,token1:sr})}),xn=t.z.array(Ir),Rr=Sr.extend({data:t.z.object({apy:t.z.string()}),investmentId:t.z.string().optional()}),Mn=t.z.array(Rr),Ar=Sr.extend({data:t.z.object({apy:t.z.string().optional(),group:t.z.number().optional(),collateral:t.z.boolean(),debt:t.z.boolean(),lending:t.z.boolean()})}),Gn=t.z.array(Ar),ft=t.z.array(Ir.or(Ar).or(Rr)),ht=Zr({name:t.z.string(),manageUrl:t.z.string(),type:ut,groups:t.z.record(t.z.object({name:t.z.string().optional(),healthRatio:t.z.string().optional()})).optional(),positions:ft}),dt=t.z.object({dappId:t.z.string(),products:t.z.array(ht)}),$n=t.z.object({dapps:t.z.array(dt)}),mt=t.z.object({name:t.z.string().optional(),tokenAddress:me,amount:t.z.string().optional(),claimUrl:t.z.string().optional(),claimStart:t.z.number(),claimEnd:t.z.number().optional()}),Xn=t.z.object({accountAddress:me,chain:t.z.string(),airdrops:t.z.array(mt)}),_e=t.z.object({address:me,networkId:t.z.string({required_error:"Network is required"})},{required_error:"Token is required"}),Vn=_e.required().extend({balance:t.z.string()}),zr=_e.required().extend({id:t.z.number().optional(),name:t.z.string().optional(),symbol:t.z.string().optional(),decimals:t.z.coerce.number().optional(),iconUrl:t.z.string().url("").optional().or(t.z.literal("")),pricingId:t.z.number().optional(),category:t.z.string().optional(),dappId:t.z.string().optional(),brandColor:t.z.string().optional()}),Et=zr.extend({balance:t.z.string()}),pt=zr.extend({currencyValue:t.z.string(),currencySymbol:t.z.string().optional(),ccyDayChange:t.z.string().optional(),ethDayChange:t.z.string().optional(),unitCurrencyValue:t.z.string().optional()}),gt=pt.extend({...Et.shape}),qn=t.z.array(gt),Hn=_e.extend({...gr.shape}),Wn=_e.extend({...Ze.shape});exports.AccountError=In;exports.AddressError=Le;exports.BaseError=be;exports.BigNumber=Tn;exports.CallError=en;exports.EventEmitterProvider=bn;exports.HttpError=He;exports.NetworkError=rn;exports.abiEntrySchema=Ge;exports.abiSchema=dr;exports.addOwnersCalldataSchema=sn;exports.addPluginCalldataSchema=un;exports.addressInputCharactersAndLengthSchema=Vt;exports.addressInputSchema=br;exports.addressOrDomainInputSchema=Ht;exports.addressOrDomainSchema=qt;exports.addressOrEmptyUndefinedSchema=Ft;exports.addressSchema=me;exports.addressSchemaArgentBackend=Xe;exports.addressSchemaBase=Ce;exports.addressSchemaLooseLength=vr;exports.addressSchemaStrictLength=Lr;exports.apiAccountTokenBalancesSchema=jn;exports.apiAirdropSchema=mt;exports.apiCollateralizedDebtPositionSchema=Ar;exports.apiCollateralizedDebtPositionsSchema=Gn;exports.apiConcentratedLiquidityPositionSchema=Ir;exports.apiConcentratedLiquidityPositionsSchema=xn;exports.apiDefiDecompositionProduct=ht;exports.apiDefiDecompositionProducts=ft;exports.apiDefiDecompositionSchema=dt;exports.apiDefiDecompositionToken=sr;exports.apiDefiPositionsSchema=$n;exports.apiPriceDataResponseSchema=Un;exports.apiPriceDetailsSchema=gr;exports.apiStakingPositionSchema=Rr;exports.apiStakingPositionsSchema=Mn;exports.apiTokenInfoResponseSchema=Fn;exports.apiTokenInfoSchema=Ze;exports.apiTokensInfoResponseSchema=Bn;exports.apiUnclaimedRewardsSchema=Xn;exports.apiWalletResponseSchema=Jt;exports.argentNameSchema=Pe;exports.bigNumberSchema=Nn;exports.bigNumberishSchema=Te;exports.booleanToStringSchema=wn;exports.builtinsSchema=fr;exports.byteCodeSchema=mr;exports.cairo1EventSchema=et;exports.cairoAssemblySchema=ct;exports.cairoVersionSchema=Fr;exports.callDetailsSchema=Vr;exports.callSchema=tn;exports.calldataSchema=Mr;exports.changeGuardianCalldataSchema=nn;exports.changeThresholdCalldataSchema=ln;exports.compiledContractClassSchema=Dn;exports.compiledSierraCasmSchema=Cn;exports.compiledSierraSchema=st;exports.compressedProgramSchema=yn;exports.constructorCallDataSchemaC0=pn;exports.constructorCallDataSchemaC1V1=gn;exports.contractEntryPointFieldsSchema=Fe;exports.createSchemaWithWarnings=Zr;exports.defiPositionTypeSchema=ut;exports.ensureArray=zn;exports.entryPointsByTypeSchema=hr;exports.escapeGuardianCalldataSchema=an;exports.eventAbiSchema=tt;exports.eventEntrySchema=$e;exports.executeOnPluginCalldataSchema=hn;exports.feltSchema=ce;exports.formatFullAddress=xt;exports.formatTruncatedAddress=Ut;exports.formatTruncatedSignerKey=$t;exports.formatTruncatedString=Xt;exports.functionAbiSchema=Jr;exports.functionAbiTypeSchema=Kr;exports.getAddressFromArgentName=Qt;exports.getDefaultExportFromCjs=Hr;exports.getSignerForMultiSigner=Sn;exports.hexSchema=ur;exports.hexSchemaBase=qr;exports.implementationSchema=mn;exports.includesAddress=Gt;exports.isAddress=yr;exports.isArgentName=_r;exports.isEqualAddress=Dr;exports.isEqualArgentName=kr;exports.isEqualStarknetDomainName=Zt;exports.isEqualStarknetId=Br;exports.isStarknetDomainName=Wt;exports.isStarknetId=jr;exports.isValidAddress=Cr;exports.isZeroAddress=Pr;exports.legacyContractClassSchema=nt;exports.legacyEventSchema=Qr;exports.looseCalldataSchema=Xr;exports.multiTypeSchema=ye;exports.normalizeAddress=De;exports.normalizeAddressOrDomain=Yt;exports.normalizeArgentName=xe;exports.normalizeStarknetId=Me;exports.parseUnits=Bt;exports.programSchema=Yr;exports.pythonicHintsSchema=ot;exports.rawArgsArraySchema=Gr;exports.rawArgsObjectSchema=$r;exports.rawArgsSchema=We;exports.removeOwnersCalldataSchema=on;exports.removePluginCalldataSchema=fn;exports.replaceSignerCalldataSchema=cn;exports.safeParseAndWarn=Ln;exports.semver=An;exports.sierraContractEntryPointFieldsSchema=Ue;exports.sierraEntryPointsByTypeSchema=at;exports.sierraProgramDebugInfoSchema=it;exports.starknetDomainNameSchema=qe;exports.starknetIdSchema=Ve;exports.stringToBooleanSchema=vn;exports.structAbiSchema=rt;exports.transferCalldataSchema=dn;exports.uint256Schema=xr;exports.urlJoin=Ur;exports.useEmitEvent=_n;exports.useEventEmitter=pr;exports.useEventEmitterContext=Er;exports.useEventListener=kn;exports.useIsEventEmitterEnabled=Pn;exports.validChecksumAddressSchema=lr;exports.validateAddressRangeSchema=wr;exports.webBaseTokenSchema=_e;exports.webBaseTokenWithBalanceSchema=Vn;exports.webTokenInfoDetailsSchema=Wn;exports.webTokenPriceDetailsSchema=Hn;exports.webTokenSchema=zr;exports.webTokenWithBalanceAndPriceSchema=gt;exports.webTokenWithBalanceSchema=Et;exports.webTokenWithPriceSchema=pt;exports.webTokensWithBalanceAndPriceSchema=qn;
|