@argent/x-shared 1.43.1 → 1.44.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./src/bigdecimal/index.cjs"),J=require("./src/errors/baseErrors.cjs"),f=require("./src/account/account.model.cjs"),R=require("./src/account/accountv4.cjs"),_=require("./src/account/preferences.model.cjs"),A=require("./src/backend/schema.cjs"),ee=require("./src/cache/CacheService.cjs"),n=require("./src/chains/starknet/address.cjs"),d=require("./src/chains/starknet/addressDomain.cjs"),O=require("./src/chains/starknet/addressInput.cjs"),g=require("./src/chains/starknet/argentName.cjs"),ae=require("./src/chains/starknet/cairoVersionSchema.cjs"),S=require("./src/chains/starknet/constants.cjs"),H=require("./src/chains/starknet/getAddressFromArgentName.cjs"),T=require("./src/chains/starknet/getAddressFromStarkName.cjs"),te=require("./src/chains/starknet/network.cjs"),re=require("./src/chains/starknet/services/address/StarknetAddressService.cjs"),P=require("./src/chains/starknet/services/deploymentData/constants.cjs"),b=require("./src/chains/starknet/services/deploymentData/deploymentData.schema.cjs"),h=require("./src/chains/starknet/services/deploymentData/findImplementationForAccount.cjs"),m=require("./src/chains/starknet/services/deploymentData/getAccountClassHash.cjs"),k=require("./src/chains/starknet/starknetId.cjs"),ne=require("./src/http/DateService.cjs"),ie=require("./src/http/HttpError.cjs"),se=require("./src/http/HttpService.cjs"),oe=require("./src/http/IHttpService.cjs"),ce=require("./src/http/SWRService.cjs"),N=require("./src/http/fetcher.cjs"),L=require("./src/http/time.cjs"),me=require("./src/knownDapps/KnownDappsBackendService.cjs"),C=require("./src/knownDapps/schema.cjs"),V=require("./src/knownDapps/utils/getDapplandUrl.cjs"),Se=require("./src/nameResolution/ResolveNameService.cjs"),l=require("./src/nameResolution/schema.cjs"),de=require("./src/nfts/BackendNftService.cjs"),x=require("./src/nfts/utils.cjs"),le=require("./src/onchainRecovery/OnchainRecoveryService.cjs"),s=require("./src/onchainRecovery/schema.cjs"),ue=require("./src/platform/isBraveBrowser.cjs"),u=require("./src/platform/isBrowser.cjs"),he=require("./src/signer/seedphrase.cjs"),M=require("./src/signer/multisigner.cjs"),pe=require("./src/signer/mergeOwnerGuardianSignatures.cjs"),o=require("./src/staking/schema.cjs"),y=require("./src/tokens/balances.cjs"),Ae=require("./src/tokens/constants.cjs"),ge=require("./src/tokens/convertTokenAmountToCurrencyValue.cjs"),Te=require("./src/tokens/convertTokenUnitAmountWithDecimals.cjs"),ke=require("./src/tokens/ensureDecimals.cjs"),Ce=require("./src/tokens/isUnlimitedAmount.cjs"),ye=require("./src/tokens/prettifyCurrencyValue.cjs"),W=require("./src/tokens/prettifyTokenAmount.cjs"),De=require("./src/tokens/getCurrencySymbol.cjs"),Ee=require("./src/tokens/service/implementation.cjs"),U=require("./src/tokens/service/tokenError.cjs"),e=require("./src/tokens/service/types/backend.model.cjs"),i=require("./src/tokens/service/types/defiPosition.model.cjs"),qe=require("./src/tokens/service/types/defiPositionType.model.cjs"),G=require("./src/tokens/service/types/unclaimedRewards.model.cjs"),c=require("./src/tokens/service/types/webToken.model.cjs"),p=require("./src/tokens/utils.cjs"),F=require("./src/transactions/amount.cjs"),I=require("./src/transactions/buildTransactions.cjs"),z=require("./src/transactions/errors.cjs"),w=require("./src/transactions/estimate/argentMaxFee.cjs"),j=require("./src/transactions/estimate/error.cjs"),ve=require("./src/transactions/estimate/model.cjs"),r=require("./src/transactions/estimate/utils.cjs"),K=require("./src/transactions/findTransfersAndApprovals.cjs"),fe=require("./src/transactions/getPrettyRcpError.cjs"),B=require("./src/transactions/getTransactionVersion.cjs"),Re=require("./src/transactions/service/implementation.cjs"),Pe=require("./src/transactions/service/types.cjs"),be=require("./src/transactions/transactionReviewTypes.cjs"),X=require("./src/transactions/transactionVersion.cjs"),$=require("./src/transactions/txv3.cjs"),Ne=require("./src/utils/address.cjs"),Fe=require("./src/utils/arrays.cjs"),D=require("./src/utils/avatarImage.cjs"),E=require("./src/utils/base58.cjs"),Ie=require("./src/utils/bigNumber.cjs"),we=require("./src/utils/daysBetween.cjs"),Be=require("./src/utils/env.cjs"),Y=require("./src/utils/hex.cjs"),_e=require("./src/utils/id.cjs"),Oe=require("./src/utils/initials.cjs"),He=require("./src/utils/isContractDeployed.cjs"),Le=require("./src/utils/nonNullable.cjs"),Ve=require("./src/utils/number/isAllowedAddressHexInputValue.cjs"),xe=require("./src/utils/number/isAllowedNumericInputValue.cjs"),Me=require("./src/utils/number/isNumeric.cjs"),q=require("./src/utils/number/prettifyNumber.cjs"),Z=require("./src/utils/parseAmount.cjs"),We=require("./src/utils/pluralise.cjs"),Ue=require("./src/utils/readFileAsString.cjs"),v=require("./src/utils/schemas.cjs"),t=require("./src/utils/starknet/starknet.cjs"),a=require("./src/utils/starknet/starknetSchemas.cjs"),Ge=require("./src/utils/transactions.cjs"),ze=require("./src/utils/url/urlWithQuery.cjs"),je=require("./src/utils/voidify.cjs"),Ke=require("./src/utils/bips.cjs");exports.bigDecimal=Q;exports.BaseError=J.BaseError;exports.AddSmartAccountResponseSchema=f.AddSmartAccountResponseSchema;exports.AddSmartAcountRequestSchema=f.AddSmartAcountRequestSchema;exports.BackendAccountSchema=f.BackendAccountSchema;exports.isAccountV4=R.isAccountV4;exports.isAccountV5=R.isAccountV5;exports.isAccountV6=R.isAccountV6;exports.preferencesEndpointPayload=_.preferencesEndpointPayload;exports.preferencesSchema=_.preferencesSchema;exports.argentBackendNetworkIdSchema=A.argentBackendNetworkIdSchema;exports.argentNetworkIdSchema=A.argentNetworkIdSchema;exports.isArgentBackendNetworkId=A.isArgentBackendNetworkId;exports.isArgentNetworkId=A.isArgentNetworkId;exports.CacheService=ee.CacheService;exports.addressOrEmptyUndefinedSchema=n.addressOrEmptyUndefinedSchema;exports.addressSchema=n.addressSchema;exports.addressSchemaArgentBackend=n.addressSchemaArgentBackend;exports.addressSchemaBase=n.addressSchemaBase;exports.addressSchemaLooseLength=n.addressSchemaLooseLength;exports.addressSchemaStrictLength=n.addressSchemaStrictLength;exports.formatFullAddress=n.formatFullAddress;exports.formatTruncatedAddress=n.formatTruncatedAddress;exports.formatTruncatedSignerKey=n.formatTruncatedSignerKey;exports.formatTruncatedString=n.formatTruncatedString;exports.includesAddress=n.includesAddress;exports.isAddress=n.isAddress;exports.isEqualAddress=n.isEqualAddress;exports.isValidAddress=n.isValidAddress;exports.isZeroAddress=n.isZeroAddress;exports.normalizeAddress=n.normalizeAddress;exports.validChecksumAddressSchema=n.validChecksumAddressSchema;exports.validateAddressRangeSchema=n.validateAddressRangeSchema;exports.addressOrDomainInputSchema=d.addressOrDomainInputSchema;exports.addressOrDomainSchema=d.addressOrDomainSchema;exports.isEqualStarknetDomainName=d.isEqualStarknetDomainName;exports.isStarknetDomainName=d.isStarknetDomainName;exports.normalizeAddressOrDomain=d.normalizeAddressOrDomain;exports.starknetDomainNameSchema=d.starknetDomainNameSchema;exports.addressInputCharactersAndLengthSchema=O.addressInputCharactersAndLengthSchema;exports.addressInputSchema=O.addressInputSchema;exports.argentNameSchema=g.argentNameSchema;exports.isArgentName=g.isArgentName;exports.isEqualArgentName=g.isEqualArgentName;exports.normalizeArgentName=g.normalizeArgentName;exports.cairoVersionSchema=ae.cairoVersionSchema;exports.ETH_TOKEN_ADDRESS=S.ETH_TOKEN_ADDRESS;exports.STANDARD_DEVNET_ACCOUNT_CLASS_HASH=S.STANDARD_DEVNET_ACCOUNT_CLASS_HASH;exports.STRK_TOKEN_ADDRESS=S.STRK_TOKEN_ADDRESS;exports.TXV1_ACCOUNT_CLASS_HASH=S.TXV1_ACCOUNT_CLASS_HASH;exports.TXV1_MULTISIG_CLASS_HASH=S.TXV1_MULTISIG_CLASS_HASH;exports.TXV3_ACCOUNT_CLASS_HASH=S.TXV3_ACCOUNT_CLASS_HASH;exports.TXV3_MULTISIG_CLASS_HASH=S.TXV3_MULTISIG_CLASS_HASH;exports.apiWalletResponseSchema=H.apiWalletResponseSchema;exports.getAddressFromArgentName=H.getAddressFromArgentName;exports.getAddressFromStarkName=T.getAddressFromStarkName;exports.getCallFromStarkName=T.getCallFromStarkName;exports.getStarknetIdContractAddressFromNetworkId=T.getStarknetIdContractAddressFromNetworkId;exports.starkNameToCallDataDomain=T.starkNameToCallDataDomain;exports.getChainIdFromNetworkId=te.getChainIdFromNetworkId;exports.StarknetAddressService=re.StarknetAddressService;exports.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES=P.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES;exports.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES=P.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES;exports.C0_PROXY_CONTRACT_CLASS_HASHES=P.C0_PROXY_CONTRACT_CLASS_HASHES;exports.constructorCallDataSchemaC0=b.constructorCallDataSchemaC0;exports.constructorCallDataSchemaC1V1=b.constructorCallDataSchemaC1V1;exports.implementationSchema=b.implementationSchema;exports.buildConstructorCalldata=h.buildConstructorCalldata;exports.findImplementationForAccount=h.findImplementationForAccount;exports.getAccountContractAddress=h.getAccountContractAddress;exports.getAccountDeploymentPayload=h.getAccountDeploymentPayload;exports.isEqualImplementation=h.isEqualImplementation;exports.getArgentAccountClassHashes=m.getArgentAccountClassHashes;exports.getArgentAccountClassHashesWithTxV3Support=m.getArgentAccountClassHashesWithTxV3Support;exports.getArgentAccountWithMultiSignerClassHashes=m.getArgentAccountWithMultiSignerClassHashes;exports.getLastCairo0ArgentAccountClassHash=m.getLastCairo0ArgentAccountClassHash;exports.getLatestArgentAccountClassHash=m.getLatestArgentAccountClassHash;exports.getLatestArgentMultisigClassHash=m.getLatestArgentMultisigClassHash;exports.getLatestLedgerAccountClassHash=m.getLatestLedgerAccountClassHash;exports.getLedgerAccountClassHashes=m.getLedgerAccountClassHashes;exports.isEqualStarknetId=k.isEqualStarknetId;exports.isStarknetId=k.isStarknetId;exports.normalizeStarknetId=k.normalizeStarknetId;exports.starknetIdSchema=k.starknetIdSchema;exports.DateService=ne.DateService;exports.HttpError=ie.HttpError;exports.HTTPService=se.HTTPService;Object.defineProperty(exports,"HTTP_ERROR_MESSAGE",{enumerable:!0,get:()=>oe.HTTP_ERROR_MESSAGE});exports.SWRService=ce.SWRService;exports.fetchData=N.fetchData;exports.fetcherError=N.fetcherError;exports.postData=N.postData;exports.getBackendTimeNowSeconds=L.getBackendTimeNowSeconds;exports.getBackendTimeSeconds=L.getBackendTimeSeconds;exports.KnownDappsBackendService=me.KnownDappsBackendService;exports.dappContractSchema=C.dappContractSchema;exports.dappLinkSchema=C.dappLinkSchema;exports.knownDappSchema=C.knownDappSchema;exports.knownDappsSchema=C.knownDappsSchema;exports.getDapplandLinkForDapp=V.getDapplandLinkForDapp;exports.getDapplandUrlForDapp=V.getDapplandUrlForDapp;exports.ResolveNameService=Se.ResolveNameService;exports.nameProviderResolutionSchema=l.nameProviderResolutionSchema;exports.nameResolutionAddressSchema=l.nameResolutionAddressSchema;exports.nameResolutionAddressesSchema=l.nameResolutionAddressesSchema;exports.nameResolutionStarknetIdSchema=l.nameResolutionStarknetIdSchema;exports.nameResolutionStarknetIdsSchema=l.nameResolutionStarknetIdsSchema;exports.providersNamesSchema=l.providersNamesSchema;exports.BackendNftService=de.BackendNftService;exports.equalNft=x.equalNft;exports.getNftPicture=x.getNftPicture;exports.OnchainRecoveryService=le.OnchainRecoveryService;Object.defineProperty(exports,"RecoveryStatusEnum",{enumerable:!0,get:()=>s.RecoveryStatusEnum});Object.defineProperty(exports,"StartOnchainRecoveryErrorStatusEnum",{enumerable:!0,get:()=>s.StartOnchainRecoveryErrorStatusEnum});exports.activeOnchainRecoverySchema=s.activeOnchainRecoverySchema;exports.onchainRecoverySchema=s.onchainRecoverySchema;exports.recoveryBaseSchema=s.recoveryBaseSchema;exports.recoveryBodySchema=s.recoveryBodySchema;exports.recoveryStatusSchema=s.recoveryStatusSchema;exports.startOnchainRecoveryErrorSchema=s.startOnchainRecoveryErrorSchema;exports.startOnchainRecoveryErrorStatusSchema=s.startOnchainRecoveryErrorStatusSchema;exports.startOnchainRecoverySchema=s.startOnchainRecoverySchema;exports.isBraveBrowser=ue.isBraveBrowser;exports.getUAParserResult=u.getUAParserResult;exports.isBrowser=u.isBrowser;exports.isChromeBrowser=u.isChromeBrowser;exports.isEdgeBrowser=u.isEdgeBrowser;exports.isFirefoxBrowser=u.isFirefoxBrowser;exports.isSafariBrowser=u.isSafariBrowser;exports.seedphraseSchema=he.seedphraseSchema;Object.defineProperty(exports,"MultiSigner",{enumerable:!0,get:()=>M.MultiSigner});exports.getSignerForMultiSigner=M.getSignerForMultiSigner;exports.mergeOwnerGuardianSignatures=pe.mergeOwnerGuardianSignatures;exports.investmentMetaSchema=o.investmentMetaSchema;exports.investmentSchema=o.investmentSchema;exports.investmentsResponseSchema=o.investmentsResponseSchema;exports.lendingInvestmentSchema=o.lendingInvestmentSchema;exports.stakerInfoSchema=o.stakerInfoSchema;exports.stakingActionSchema=o.stakingActionSchema;exports.stakingInvestmentSchema=o.stakingInvestmentSchema;exports.strkDelegatedStakingInvestmentSchema=o.strkDelegatedStakingInvestmentSchema;exports.strkStakingCalldataResponseSchema=o.strkStakingCalldataResponseSchema;exports.strkStakingCalldataSchema=o.strkStakingCalldataSchema;exports.getTokenBalance=y.getTokenBalance;exports.getTokens=y.getTokens;exports.getTokensBalances=y.getTokensBalances;exports.useToken=y.useToken;exports.DEFAULT_TOKEN_DECIMALS=Ae.DEFAULT_TOKEN_DECIMALS;exports.convertTokenAmountToCurrencyValue=ge.convertTokenAmountToCurrencyValue;exports.convertTokenUnitAmountWithDecimals=Te.convertTokenUnitAmountWithDecimals;exports.ensureDecimals=ke.ensureDecimals;exports.isUnlimitedAmount=Ce.isUnlimitedAmount;exports.prettifyCurrencyValue=ye.prettifyCurrencyValue;exports.PRETTY_UNLIMITED=W.PRETTY_UNLIMITED;exports.prettifyTokenAmount=W.prettifyTokenAmount;exports.getCurrencySymbol=De.getCurrencySymbol;exports.TokenServiceWeb=Ee.TokenServiceWeb;Object.defineProperty(exports,"TOKEN_ERROR_MESSAGES",{enumerable:!0,get:()=>U.TOKEN_ERROR_MESSAGES});exports.TokenError=U.TokenError;exports.apiAccountTokenBalancesSchema=e.apiAccountTokenBalancesSchema;exports.apiAirdropSchema=e.apiAirdropSchema;exports.apiCollateralizedDebtPositionSchema=e.apiCollateralizedDebtPositionSchema;exports.apiCollateralizedDebtPositionsSchema=e.apiCollateralizedDebtPositionsSchema;exports.apiConcentratedLiquidityPositionSchema=e.apiConcentratedLiquidityPositionSchema;exports.apiConcentratedLiquidityPositionsSchema=e.apiConcentratedLiquidityPositionsSchema;exports.apiDefiDecompositionProduct=e.apiDefiDecompositionProduct;exports.apiDefiDecompositionProducts=e.apiDefiDecompositionProducts;exports.apiDefiDecompositionSchema=e.apiDefiDecompositionSchema;exports.apiDefiDecompositionToken=e.apiDefiDecompositionToken;exports.apiDefiPositionSchema=e.apiDefiPositionSchema;exports.apiDefiPositionsSchema=e.apiDefiPositionsSchema;exports.apiDelegatedTokensArraySchema=e.apiDelegatedTokensArraySchema;exports.apiDelegatedTokensSchema=e.apiDelegatedTokensSchema;exports.apiPriceDataResponseSchema=e.apiPriceDataResponseSchema;exports.apiPriceDetailsSchema=e.apiPriceDetailsSchema;exports.apiStakingPositionSchema=e.apiStakingPositionSchema;exports.apiStakingPositionsSchema=e.apiStakingPositionsSchema;exports.apiStrkDelegatedStakingPositionsSchema=e.apiStrkDelegatedStakingPositionsSchema;exports.apiStrkDelegatedStakingSchema=e.apiStrkDelegatedStakingSchema;exports.apiTokenInfoResponseSchema=e.apiTokenInfoResponseSchema;exports.apiTokenInfoSchema=e.apiTokenInfoSchema;exports.apiTokensInfoResponseSchema=e.apiTokensInfoResponseSchema;exports.apiUnclaimedRewardsSchema=e.apiUnclaimedRewardsSchema;exports.collateralizedDebtGroupSchema=i.collateralizedDebtGroupSchema;exports.collateralizedDebtPositionSchema=i.collateralizedDebtPositionSchema;exports.collateralizedDebtPositionsSchema=i.collateralizedDebtPositionsSchema;exports.concentratedLiquidityPositionSchema=i.concentratedLiquidityPositionSchema;exports.concentratedLiquidityPositionsSchema=i.concentratedLiquidityPositionsSchema;exports.defiDappsProductsSchema=i.defiDappsProductsSchema;exports.defiPositionSchema=i.defiPositionSchema;exports.defiProductSchema=i.defiProductSchema;exports.defiProductsSchema=i.defiProductsSchema;exports.delegatedTokensArraySchema=i.delegatedTokensArraySchema;exports.delegatedTokensSchema=i.delegatedTokensSchema;exports.productGroupsSchema=i.productGroupsSchema;exports.stakingPositionSchema=i.stakingPositionSchema;exports.stakingPositionsSchema=i.stakingPositionsSchema;exports.defiPositionTypeSchema=qe.defiPositionTypeSchema;exports.airdropSchema=G.airdropSchema;exports.unclaimedRewardsSchema=G.unclaimedRewardsSchema;exports.webBaseTokenSchema=c.webBaseTokenSchema;exports.webBaseTokenWithBalanceSchema=c.webBaseTokenWithBalanceSchema;exports.webTokenInfoDetailsSchema=c.webTokenInfoDetailsSchema;exports.webTokenPriceDetailsSchema=c.webTokenPriceDetailsSchema;exports.webTokenSchema=c.webTokenSchema;exports.webTokenWithBalanceAndPriceSchema=c.webTokenWithBalanceAndPriceSchema;exports.webTokenWithBalanceSchema=c.webTokenWithBalanceSchema;exports.webTokenWithPriceSchema=c.webTokenWithPriceSchema;exports.webTokensWithBalanceAndPriceSchema=c.webTokensWithBalanceAndPriceSchema;exports.isCollateralizedDebtPosition=p.isCollateralizedDebtPosition;exports.isConcentratedLiquidityPosition=p.isConcentratedLiquidityPosition;exports.isDelegatedTokens=p.isDelegatedTokens;exports.isStaking=p.isStaking;exports.isStrkDelegatedStaking=p.isStrkDelegatedStaking;exports.inputAmountSchema=F.inputAmountSchema;exports.isValidInputAmount=F.isValidInputAmount;exports.parseAmount=F.parseAmount;exports.erc20TransferTransaction=I.erc20TransferTransaction;exports.erc721SafeTransferFromTransaction=I.erc721SafeTransferFromTransaction;exports.erc721TransferFromTransaction=I.erc721TransferFromTransaction;exports.getMessageFromTrpcError=z.getMessageFromTrpcError;exports.trpcErrorSchema=z.trpcErrorSchema;exports.FEE_OVERHEAD=w.FEE_OVERHEAD;exports.argentMaxFee=w.argentMaxFee;exports.modifySnjsFeeOverhead=w.modifySnjsFeeOverhead;Object.defineProperty(exports,"ESTIMATE_ERROR_MESSAGES",{enumerable:!0,get:()=>j.ESTIMATE_ERROR_MESSAGES});exports.EstimateError=j.EstimateError;exports.transactionReviewTransactionsSchema=ve.transactionReviewTransactionsSchema;exports.buildDummyTx=r.buildDummyTx;exports.calculateCubeRootAdjustment=r.calculateCubeRootAdjustment;exports.calculateNonLinearAdjustment=r.calculateNonLinearAdjustment;exports.calculateSqrtAdjustment=r.calculateSqrtAdjustment;exports.castFeeEstimation=r.castFeeEstimation;exports.estimatedFeeToMaxFeeTotal=r.estimatedFeeToMaxFeeTotal;exports.estimatedFeeToMaxResourceBounds=r.estimatedFeeToMaxResourceBounds;exports.estimatedFeeToTotal=r.estimatedFeeToTotal;exports.estimatedFeesToMaxFeeTotal=r.estimatedFeesToMaxFeeTotal;exports.estimatedFeesToTotal=r.estimatedFeesToTotal;exports.getEstimatedFeeFromBulkSimulation=r.getEstimatedFeeFromBulkSimulation;exports.getEstimatedFeeFromSimulationAndRespectWatermarkFee=r.getEstimatedFeeFromSimulationAndRespectWatermarkFee;exports.getPayloadFromTransaction=r.getPayloadFromTransaction;exports.getWatermarkedMaxFeeTotal=r.getWatermarkedMaxFeeTotal;exports.isFRI=r.isFRI;exports.isWEI=r.isWEI;exports.multiplyBigIntByFloat=r.multiplyBigIntByFloat;exports.toMax=r.toMax;exports.tokensRequireTxV3Support=r.tokensRequireTxV3Support;exports.unitToFeeTokenAddress=r.unitToFeeTokenAddress;exports.EventsBySelector=K.EventsBySelector;exports.findTransfersAndApprovals=K.findTransfersAndApprovals;exports.getPrettyRpcError=fe.getPrettyRpcError;exports.getSimulationTxVersionFromFeeToken=B.getSimulationTxVersionFromFeeToken;exports.getTxVersionFromFeeToken=B.getTxVersionFromFeeToken;exports.getTxVersionFromFeeTokenForDeclareContract=B.getTxVersionFromFeeTokenForDeclareContract;exports.TransactionReviewServiceWeb=Re.TransactionReviewServiceWeb;exports.transactionReviewWarningSchema=Pe.transactionReviewWarningSchema;exports.apiTransactionReviewActivityType=be.apiTransactionReviewActivityType;exports.denyTxV3=X.denyTxV3;exports.txVersionSchema=X.txVersionSchema;exports.classHashSupportsTxV3=$.classHashSupportsTxV3;exports.feeTokenNeedsTxV3Support=$.feeTokenNeedsTxV3Support;exports.formatAddress=Ne.formatAddress;exports.ensureArray=Fe.ensureArray;exports.generateAvatarImage=D.generateAvatarImage;exports.getColor=D.getColor;exports.getNetworkAccountImageUrl=D.getNetworkAccountImageUrl;exports.stripAddressZeroPadding=D.stripAddressZeroPadding;exports.decodeBase58=E.decodeBase58;exports.decodeBase58Array=E.decodeBase58Array;exports.encodeBase58=E.encodeBase58;exports.encodeBase58Array=E.encodeBase58Array;exports.bigNumberSchema=Ie.bigNumberSchema;exports.daysBetween=we.daysBetween;exports.isFeatureEnabled=Be.isFeatureEnabled;exports.hexSchema=Y.hexSchema;exports.hexSchemaBase=Y.hexSchemaBase;exports.id=_e.id;exports.getInitials=Oe.getInitials;exports.isContractDeployed=He.isContractDeployed;exports.nonNullable=Le.nonNullable;exports.isAllowedAddressHexInputValue=Ve.isAllowedAddressHexInputValue;exports.isAllowedNumericInputValue=xe.isAllowedNumericInputValue;exports.isNumeric=Me.isNumeric;exports.prettifyCurrencyNumber=q.prettifyCurrencyNumber;exports.prettifyNumber=q.prettifyNumber;exports.prettifyNumberConfig=q.prettifyNumberConfig;exports.prettifyTokenNumber=q.prettifyTokenNumber;exports.getUint256CalldataFromBN=Z.getUint256CalldataFromBN;exports.parseAmountValue=Z.parseAmountValue;exports.pluralise=We.pluralise;exports.readFileAsString=Ue.readFileAsString;exports.booleanToStringSchema=v.booleanToStringSchema;exports.createSchemaWithWarnings=v.createSchemaWithWarnings;exports.safeParseAndWarn=v.safeParseAndWarn;exports.stringToBooleanSchema=v.stringToBooleanSchema;exports.addOwnersCalldataSchema=t.addOwnersCalldataSchema;exports.addPluginCalldataSchema=t.addPluginCalldataSchema;exports.bigNumberishSchema=t.bigNumberishSchema;exports.callDetailsSchema=t.callDetailsSchema;exports.callSchema=t.callSchema;exports.calldataSchema=t.calldataSchema;exports.changeGuardianCalldataSchema=t.changeGuardianCalldataSchema;exports.changeThresholdCalldataSchema=t.changeThresholdCalldataSchema;exports.escapeGuardianCalldataSchema=t.escapeGuardianCalldataSchema;exports.executeOnPluginCalldataSchema=t.executeOnPluginCalldataSchema;exports.feltSchema=t.feltSchema;exports.looseCalldataSchema=t.looseCalldataSchema;exports.multiTypeSchema=t.multiTypeSchema;exports.rawArgsArraySchema=t.rawArgsArraySchema;exports.rawArgsObjectSchema=t.rawArgsObjectSchema;exports.rawArgsSchema=t.rawArgsSchema;exports.removeOwnersCalldataSchema=t.removeOwnersCalldataSchema;exports.removePluginCalldataSchema=t.removePluginCalldataSchema;exports.replaceSignerCalldataSchema=t.replaceSignerCalldataSchema;exports.transferCalldataSchema=t.transferCalldataSchema;exports.uint256Schema=t.uint256Schema;exports.abiEntrySchema=a.abiEntrySchema;exports.abiSchema=a.abiSchema;exports.builtinsSchema=a.builtinsSchema;exports.byteCodeSchema=a.byteCodeSchema;exports.cairo1EventSchema=a.cairo1EventSchema;exports.cairoAssemblySchema=a.cairoAssemblySchema;exports.compiledContractClassSchema=a.compiledContractClassSchema;exports.compiledSierraCasmSchema=a.compiledSierraCasmSchema;exports.compiledSierraSchema=a.compiledSierraSchema;exports.compressedProgramSchema=a.compressedProgramSchema;exports.contractEntryPointFieldsSchema=a.contractEntryPointFieldsSchema;exports.entryPointsByTypeSchema=a.entryPointsByTypeSchema;exports.eventAbiSchema=a.eventAbiSchema;exports.eventEntrySchema=a.eventEntrySchema;exports.functionAbiSchema=a.functionAbiSchema;exports.functionAbiTypeSchema=a.functionAbiTypeSchema;exports.legacyContractClassSchema=a.legacyContractClassSchema;exports.legacyEventSchema=a.legacyEventSchema;exports.programSchema=a.programSchema;exports.pythonicHintsSchema=a.pythonicHintsSchema;exports.sierraContractEntryPointFieldsSchema=a.sierraContractEntryPointFieldsSchema;exports.sierraEntryPointsByTypeSchema=a.sierraEntryPointsByTypeSchema;exports.sierraProgramDebugInfoSchema=a.sierraProgramDebugInfoSchema;exports.structAbiSchema=a.structAbiSchema;exports.entryPointToHumanReadable=Ge.entryPointToHumanReadable;exports.urlWithQuery=ze.urlWithQuery;exports.voidify=je.voidify;exports.bipsToPercent=Ke.bipsToPercent;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const Q=require("./src/bigdecimal/index.cjs"),J=require("./src/errors/baseErrors.cjs"),f=require("./src/account/account.model.cjs"),R=require("./src/account/accountv4.cjs"),_=require("./src/account/preferences.model.cjs"),A=require("./src/backend/schema.cjs"),ee=require("./src/cache/CacheService.cjs"),n=require("./src/chains/starknet/address.cjs"),d=require("./src/chains/starknet/addressDomain.cjs"),O=require("./src/chains/starknet/addressInput.cjs"),g=require("./src/chains/starknet/argentName.cjs"),ae=require("./src/chains/starknet/cairoVersionSchema.cjs"),S=require("./src/chains/starknet/constants.cjs"),H=require("./src/chains/starknet/getAddressFromArgentName.cjs"),T=require("./src/chains/starknet/getAddressFromStarkName.cjs"),te=require("./src/chains/starknet/network.cjs"),re=require("./src/chains/starknet/services/address/StarknetAddressService.cjs"),P=require("./src/chains/starknet/services/deploymentData/constants.cjs"),b=require("./src/chains/starknet/services/deploymentData/deploymentData.schema.cjs"),h=require("./src/chains/starknet/services/deploymentData/findImplementationForAccount.cjs"),m=require("./src/chains/starknet/services/deploymentData/getAccountClassHash.cjs"),k=require("./src/chains/starknet/starknetId.cjs"),ne=require("./src/http/DateService.cjs"),ie=require("./src/http/HttpError.cjs"),se=require("./src/http/HttpService.cjs"),oe=require("./src/http/IHttpService.cjs"),ce=require("./src/http/SWRService.cjs"),N=require("./src/http/fetcher.cjs"),L=require("./src/http/time.cjs"),me=require("./src/knownDapps/KnownDappsBackendService.cjs"),C=require("./src/knownDapps/schema.cjs"),V=require("./src/knownDapps/utils/getDapplandUrl.cjs"),Se=require("./src/nameResolution/ResolveNameService.cjs"),l=require("./src/nameResolution/schema.cjs"),de=require("./src/nfts/BackendNftService.cjs"),x=require("./src/nfts/utils.cjs"),le=require("./src/onchainRecovery/OnchainRecoveryService.cjs"),s=require("./src/onchainRecovery/schema.cjs"),ue=require("./src/platform/isBraveBrowser.cjs"),u=require("./src/platform/isBrowser.cjs"),he=require("./src/signer/seedphrase.cjs"),M=require("./src/signer/multisigner.cjs"),pe=require("./src/signer/mergeOwnerGuardianSignatures.cjs"),o=require("./src/staking/schema.cjs"),y=require("./src/tokens/balances.cjs"),Ae=require("./src/tokens/constants.cjs"),ge=require("./src/tokens/convertTokenAmountToCurrencyValue.cjs"),Te=require("./src/tokens/convertTokenUnitAmountWithDecimals.cjs"),ke=require("./src/tokens/ensureDecimals.cjs"),Ce=require("./src/tokens/isUnlimitedAmount.cjs"),ye=require("./src/tokens/prettifyCurrencyValue.cjs"),W=require("./src/tokens/prettifyTokenAmount.cjs"),De=require("./src/tokens/getCurrencySymbol.cjs"),Ee=require("./src/tokens/service/implementation.cjs"),U=require("./src/tokens/service/tokenError.cjs"),e=require("./src/tokens/service/types/backend.model.cjs"),i=require("./src/tokens/service/types/defiPosition.model.cjs"),qe=require("./src/tokens/service/types/defiPositionType.model.cjs"),G=require("./src/tokens/service/types/unclaimedRewards.model.cjs"),c=require("./src/tokens/service/types/webToken.model.cjs"),p=require("./src/tokens/utils.cjs"),I=require("./src/transactions/amount.cjs"),F=require("./src/transactions/buildTransactions.cjs"),z=require("./src/transactions/errors.cjs"),w=require("./src/transactions/estimate/argentMaxFee.cjs"),j=require("./src/transactions/estimate/error.cjs"),ve=require("./src/transactions/estimate/model.cjs"),r=require("./src/transactions/estimate/utils.cjs"),K=require("./src/transactions/findTransfersAndApprovals.cjs"),fe=require("./src/transactions/getPrettyRcpError.cjs"),B=require("./src/transactions/getTransactionVersion.cjs"),Re=require("./src/transactions/service/implementation.cjs"),Pe=require("./src/transactions/service/types.cjs"),be=require("./src/transactions/transactionReviewTypes.cjs"),X=require("./src/transactions/transactionVersion.cjs"),$=require("./src/transactions/txv3.cjs"),Ne=require("./src/utils/address.cjs"),Ie=require("./src/utils/arrays.cjs"),D=require("./src/utils/avatarImage.cjs"),E=require("./src/utils/base58.cjs"),Fe=require("./src/utils/bigNumber.cjs"),we=require("./src/utils/daysBetween.cjs"),Be=require("./src/utils/env.cjs"),Y=require("./src/utils/hex.cjs"),_e=require("./src/utils/id.cjs"),Oe=require("./src/utils/initials.cjs"),He=require("./src/utils/isContractDeployed.cjs"),Le=require("./src/utils/nonNullable.cjs"),Ve=require("./src/utils/number/isAllowedAddressHexInputValue.cjs"),xe=require("./src/utils/number/isAllowedNumericInputValue.cjs"),Me=require("./src/utils/number/isNumeric.cjs"),q=require("./src/utils/number/prettifyNumber.cjs"),Z=require("./src/utils/parseAmount.cjs"),We=require("./src/utils/pluralise.cjs"),Ue=require("./src/utils/readFileAsString.cjs"),v=require("./src/utils/schemas.cjs"),t=require("./src/utils/starknet/starknet.cjs"),a=require("./src/utils/starknet/starknetSchemas.cjs"),Ge=require("./src/utils/transactions.cjs"),ze=require("./src/utils/url/urlWithQuery.cjs"),je=require("./src/utils/voidify.cjs"),Ke=require("./src/utils/bips.cjs"),Xe=require("./src/utils/retryUntilInitialised.cjs");exports.bigDecimal=Q;exports.BaseError=J.BaseError;exports.AddSmartAccountResponseSchema=f.AddSmartAccountResponseSchema;exports.AddSmartAcountRequestSchema=f.AddSmartAcountRequestSchema;exports.BackendAccountSchema=f.BackendAccountSchema;exports.isAccountV4=R.isAccountV4;exports.isAccountV5=R.isAccountV5;exports.isAccountV6=R.isAccountV6;exports.preferencesEndpointPayload=_.preferencesEndpointPayload;exports.preferencesSchema=_.preferencesSchema;exports.argentBackendNetworkIdSchema=A.argentBackendNetworkIdSchema;exports.argentNetworkIdSchema=A.argentNetworkIdSchema;exports.isArgentBackendNetworkId=A.isArgentBackendNetworkId;exports.isArgentNetworkId=A.isArgentNetworkId;exports.CacheService=ee.CacheService;exports.addressOrEmptyUndefinedSchema=n.addressOrEmptyUndefinedSchema;exports.addressSchema=n.addressSchema;exports.addressSchemaArgentBackend=n.addressSchemaArgentBackend;exports.addressSchemaBase=n.addressSchemaBase;exports.addressSchemaLooseLength=n.addressSchemaLooseLength;exports.addressSchemaStrictLength=n.addressSchemaStrictLength;exports.formatFullAddress=n.formatFullAddress;exports.formatTruncatedAddress=n.formatTruncatedAddress;exports.formatTruncatedSignerKey=n.formatTruncatedSignerKey;exports.formatTruncatedString=n.formatTruncatedString;exports.includesAddress=n.includesAddress;exports.isAddress=n.isAddress;exports.isEqualAddress=n.isEqualAddress;exports.isValidAddress=n.isValidAddress;exports.isZeroAddress=n.isZeroAddress;exports.normalizeAddress=n.normalizeAddress;exports.validChecksumAddressSchema=n.validChecksumAddressSchema;exports.validateAddressRangeSchema=n.validateAddressRangeSchema;exports.addressOrDomainInputSchema=d.addressOrDomainInputSchema;exports.addressOrDomainSchema=d.addressOrDomainSchema;exports.isEqualStarknetDomainName=d.isEqualStarknetDomainName;exports.isStarknetDomainName=d.isStarknetDomainName;exports.normalizeAddressOrDomain=d.normalizeAddressOrDomain;exports.starknetDomainNameSchema=d.starknetDomainNameSchema;exports.addressInputCharactersAndLengthSchema=O.addressInputCharactersAndLengthSchema;exports.addressInputSchema=O.addressInputSchema;exports.argentNameSchema=g.argentNameSchema;exports.isArgentName=g.isArgentName;exports.isEqualArgentName=g.isEqualArgentName;exports.normalizeArgentName=g.normalizeArgentName;exports.cairoVersionSchema=ae.cairoVersionSchema;exports.ETH_TOKEN_ADDRESS=S.ETH_TOKEN_ADDRESS;exports.STANDARD_DEVNET_ACCOUNT_CLASS_HASH=S.STANDARD_DEVNET_ACCOUNT_CLASS_HASH;exports.STRK_TOKEN_ADDRESS=S.STRK_TOKEN_ADDRESS;exports.TXV1_ACCOUNT_CLASS_HASH=S.TXV1_ACCOUNT_CLASS_HASH;exports.TXV1_MULTISIG_CLASS_HASH=S.TXV1_MULTISIG_CLASS_HASH;exports.TXV3_ACCOUNT_CLASS_HASH=S.TXV3_ACCOUNT_CLASS_HASH;exports.TXV3_MULTISIG_CLASS_HASH=S.TXV3_MULTISIG_CLASS_HASH;exports.apiWalletResponseSchema=H.apiWalletResponseSchema;exports.getAddressFromArgentName=H.getAddressFromArgentName;exports.getAddressFromStarkName=T.getAddressFromStarkName;exports.getCallFromStarkName=T.getCallFromStarkName;exports.getStarknetIdContractAddressFromNetworkId=T.getStarknetIdContractAddressFromNetworkId;exports.starkNameToCallDataDomain=T.starkNameToCallDataDomain;exports.getChainIdFromNetworkId=te.getChainIdFromNetworkId;exports.StarknetAddressService=re.StarknetAddressService;exports.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES=P.ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES;exports.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES=P.ARGENT_MULTISIG_CONTRACT_CLASS_HASHES;exports.C0_PROXY_CONTRACT_CLASS_HASHES=P.C0_PROXY_CONTRACT_CLASS_HASHES;exports.constructorCallDataSchemaC0=b.constructorCallDataSchemaC0;exports.constructorCallDataSchemaC1V1=b.constructorCallDataSchemaC1V1;exports.implementationSchema=b.implementationSchema;exports.buildConstructorCalldata=h.buildConstructorCalldata;exports.findImplementationForAccount=h.findImplementationForAccount;exports.getAccountContractAddress=h.getAccountContractAddress;exports.getAccountDeploymentPayload=h.getAccountDeploymentPayload;exports.isEqualImplementation=h.isEqualImplementation;exports.getArgentAccountClassHashes=m.getArgentAccountClassHashes;exports.getArgentAccountClassHashesWithTxV3Support=m.getArgentAccountClassHashesWithTxV3Support;exports.getArgentAccountWithMultiSignerClassHashes=m.getArgentAccountWithMultiSignerClassHashes;exports.getLastCairo0ArgentAccountClassHash=m.getLastCairo0ArgentAccountClassHash;exports.getLatestArgentAccountClassHash=m.getLatestArgentAccountClassHash;exports.getLatestArgentMultisigClassHash=m.getLatestArgentMultisigClassHash;exports.getLatestLedgerAccountClassHash=m.getLatestLedgerAccountClassHash;exports.getLedgerAccountClassHashes=m.getLedgerAccountClassHashes;exports.isEqualStarknetId=k.isEqualStarknetId;exports.isStarknetId=k.isStarknetId;exports.normalizeStarknetId=k.normalizeStarknetId;exports.starknetIdSchema=k.starknetIdSchema;exports.DateService=ne.DateService;exports.HttpError=ie.HttpError;exports.HTTPService=se.HTTPService;Object.defineProperty(exports,"HTTP_ERROR_MESSAGE",{enumerable:!0,get:()=>oe.HTTP_ERROR_MESSAGE});exports.SWRService=ce.SWRService;exports.fetchData=N.fetchData;exports.fetcherError=N.fetcherError;exports.postData=N.postData;exports.getBackendTimeNowSeconds=L.getBackendTimeNowSeconds;exports.getBackendTimeSeconds=L.getBackendTimeSeconds;exports.KnownDappsBackendService=me.KnownDappsBackendService;exports.dappContractSchema=C.dappContractSchema;exports.dappLinkSchema=C.dappLinkSchema;exports.knownDappSchema=C.knownDappSchema;exports.knownDappsSchema=C.knownDappsSchema;exports.getDapplandLinkForDapp=V.getDapplandLinkForDapp;exports.getDapplandUrlForDapp=V.getDapplandUrlForDapp;exports.ResolveNameService=Se.ResolveNameService;exports.nameProviderResolutionSchema=l.nameProviderResolutionSchema;exports.nameResolutionAddressSchema=l.nameResolutionAddressSchema;exports.nameResolutionAddressesSchema=l.nameResolutionAddressesSchema;exports.nameResolutionStarknetIdSchema=l.nameResolutionStarknetIdSchema;exports.nameResolutionStarknetIdsSchema=l.nameResolutionStarknetIdsSchema;exports.providersNamesSchema=l.providersNamesSchema;exports.BackendNftService=de.BackendNftService;exports.equalNft=x.equalNft;exports.getNftPicture=x.getNftPicture;exports.OnchainRecoveryService=le.OnchainRecoveryService;Object.defineProperty(exports,"RecoveryStatusEnum",{enumerable:!0,get:()=>s.RecoveryStatusEnum});Object.defineProperty(exports,"StartOnchainRecoveryErrorStatusEnum",{enumerable:!0,get:()=>s.StartOnchainRecoveryErrorStatusEnum});exports.activeOnchainRecoverySchema=s.activeOnchainRecoverySchema;exports.onchainRecoverySchema=s.onchainRecoverySchema;exports.recoveryBaseSchema=s.recoveryBaseSchema;exports.recoveryBodySchema=s.recoveryBodySchema;exports.recoveryStatusSchema=s.recoveryStatusSchema;exports.startOnchainRecoveryErrorSchema=s.startOnchainRecoveryErrorSchema;exports.startOnchainRecoveryErrorStatusSchema=s.startOnchainRecoveryErrorStatusSchema;exports.startOnchainRecoverySchema=s.startOnchainRecoverySchema;exports.isBraveBrowser=ue.isBraveBrowser;exports.getUAParserResult=u.getUAParserResult;exports.isBrowser=u.isBrowser;exports.isChromeBrowser=u.isChromeBrowser;exports.isEdgeBrowser=u.isEdgeBrowser;exports.isFirefoxBrowser=u.isFirefoxBrowser;exports.isSafariBrowser=u.isSafariBrowser;exports.seedphraseSchema=he.seedphraseSchema;Object.defineProperty(exports,"MultiSigner",{enumerable:!0,get:()=>M.MultiSigner});exports.getSignerForMultiSigner=M.getSignerForMultiSigner;exports.mergeOwnerGuardianSignatures=pe.mergeOwnerGuardianSignatures;exports.investmentMetaSchema=o.investmentMetaSchema;exports.investmentSchema=o.investmentSchema;exports.investmentsResponseSchema=o.investmentsResponseSchema;exports.lendingInvestmentSchema=o.lendingInvestmentSchema;exports.stakerInfoSchema=o.stakerInfoSchema;exports.stakingActionSchema=o.stakingActionSchema;exports.stakingInvestmentSchema=o.stakingInvestmentSchema;exports.strkDelegatedStakingInvestmentSchema=o.strkDelegatedStakingInvestmentSchema;exports.strkStakingCalldataResponseSchema=o.strkStakingCalldataResponseSchema;exports.strkStakingCalldataSchema=o.strkStakingCalldataSchema;exports.getTokenBalance=y.getTokenBalance;exports.getTokens=y.getTokens;exports.getTokensBalances=y.getTokensBalances;exports.useToken=y.useToken;exports.DEFAULT_TOKEN_DECIMALS=Ae.DEFAULT_TOKEN_DECIMALS;exports.convertTokenAmountToCurrencyValue=ge.convertTokenAmountToCurrencyValue;exports.convertTokenUnitAmountWithDecimals=Te.convertTokenUnitAmountWithDecimals;exports.ensureDecimals=ke.ensureDecimals;exports.isUnlimitedAmount=Ce.isUnlimitedAmount;exports.prettifyCurrencyValue=ye.prettifyCurrencyValue;exports.PRETTY_UNLIMITED=W.PRETTY_UNLIMITED;exports.prettifyTokenAmount=W.prettifyTokenAmount;exports.getCurrencySymbol=De.getCurrencySymbol;exports.TokenServiceWeb=Ee.TokenServiceWeb;Object.defineProperty(exports,"TOKEN_ERROR_MESSAGES",{enumerable:!0,get:()=>U.TOKEN_ERROR_MESSAGES});exports.TokenError=U.TokenError;exports.apiAccountTokenBalancesSchema=e.apiAccountTokenBalancesSchema;exports.apiAirdropSchema=e.apiAirdropSchema;exports.apiCollateralizedDebtPositionSchema=e.apiCollateralizedDebtPositionSchema;exports.apiCollateralizedDebtPositionsSchema=e.apiCollateralizedDebtPositionsSchema;exports.apiConcentratedLiquidityPositionSchema=e.apiConcentratedLiquidityPositionSchema;exports.apiConcentratedLiquidityPositionsSchema=e.apiConcentratedLiquidityPositionsSchema;exports.apiDefiDecompositionProduct=e.apiDefiDecompositionProduct;exports.apiDefiDecompositionProducts=e.apiDefiDecompositionProducts;exports.apiDefiDecompositionSchema=e.apiDefiDecompositionSchema;exports.apiDefiDecompositionToken=e.apiDefiDecompositionToken;exports.apiDefiPositionSchema=e.apiDefiPositionSchema;exports.apiDefiPositionsSchema=e.apiDefiPositionsSchema;exports.apiDelegatedTokensArraySchema=e.apiDelegatedTokensArraySchema;exports.apiDelegatedTokensSchema=e.apiDelegatedTokensSchema;exports.apiPriceDataResponseSchema=e.apiPriceDataResponseSchema;exports.apiPriceDetailsSchema=e.apiPriceDetailsSchema;exports.apiStakingPositionSchema=e.apiStakingPositionSchema;exports.apiStakingPositionsSchema=e.apiStakingPositionsSchema;exports.apiStrkDelegatedStakingPositionsSchema=e.apiStrkDelegatedStakingPositionsSchema;exports.apiStrkDelegatedStakingSchema=e.apiStrkDelegatedStakingSchema;exports.apiTokenInfoResponseSchema=e.apiTokenInfoResponseSchema;exports.apiTokenInfoSchema=e.apiTokenInfoSchema;exports.apiTokensInfoResponseSchema=e.apiTokensInfoResponseSchema;exports.apiUnclaimedRewardsSchema=e.apiUnclaimedRewardsSchema;exports.collateralizedDebtGroupSchema=i.collateralizedDebtGroupSchema;exports.collateralizedDebtPositionSchema=i.collateralizedDebtPositionSchema;exports.collateralizedDebtPositionsSchema=i.collateralizedDebtPositionsSchema;exports.concentratedLiquidityPositionSchema=i.concentratedLiquidityPositionSchema;exports.concentratedLiquidityPositionsSchema=i.concentratedLiquidityPositionsSchema;exports.defiDappsProductsSchema=i.defiDappsProductsSchema;exports.defiPositionSchema=i.defiPositionSchema;exports.defiProductSchema=i.defiProductSchema;exports.defiProductsSchema=i.defiProductsSchema;exports.delegatedTokensArraySchema=i.delegatedTokensArraySchema;exports.delegatedTokensSchema=i.delegatedTokensSchema;exports.productGroupsSchema=i.productGroupsSchema;exports.stakingPositionSchema=i.stakingPositionSchema;exports.stakingPositionsSchema=i.stakingPositionsSchema;exports.defiPositionTypeSchema=qe.defiPositionTypeSchema;exports.airdropSchema=G.airdropSchema;exports.unclaimedRewardsSchema=G.unclaimedRewardsSchema;exports.webBaseTokenSchema=c.webBaseTokenSchema;exports.webBaseTokenWithBalanceSchema=c.webBaseTokenWithBalanceSchema;exports.webTokenInfoDetailsSchema=c.webTokenInfoDetailsSchema;exports.webTokenPriceDetailsSchema=c.webTokenPriceDetailsSchema;exports.webTokenSchema=c.webTokenSchema;exports.webTokenWithBalanceAndPriceSchema=c.webTokenWithBalanceAndPriceSchema;exports.webTokenWithBalanceSchema=c.webTokenWithBalanceSchema;exports.webTokenWithPriceSchema=c.webTokenWithPriceSchema;exports.webTokensWithBalanceAndPriceSchema=c.webTokensWithBalanceAndPriceSchema;exports.isCollateralizedDebtPosition=p.isCollateralizedDebtPosition;exports.isConcentratedLiquidityPosition=p.isConcentratedLiquidityPosition;exports.isDelegatedTokens=p.isDelegatedTokens;exports.isStaking=p.isStaking;exports.isStrkDelegatedStaking=p.isStrkDelegatedStaking;exports.inputAmountSchema=I.inputAmountSchema;exports.isValidInputAmount=I.isValidInputAmount;exports.parseAmount=I.parseAmount;exports.erc20TransferTransaction=F.erc20TransferTransaction;exports.erc721SafeTransferFromTransaction=F.erc721SafeTransferFromTransaction;exports.erc721TransferFromTransaction=F.erc721TransferFromTransaction;exports.getMessageFromTrpcError=z.getMessageFromTrpcError;exports.trpcErrorSchema=z.trpcErrorSchema;exports.FEE_OVERHEAD=w.FEE_OVERHEAD;exports.argentMaxFee=w.argentMaxFee;exports.modifySnjsFeeOverhead=w.modifySnjsFeeOverhead;Object.defineProperty(exports,"ESTIMATE_ERROR_MESSAGES",{enumerable:!0,get:()=>j.ESTIMATE_ERROR_MESSAGES});exports.EstimateError=j.EstimateError;exports.transactionReviewTransactionsSchema=ve.transactionReviewTransactionsSchema;exports.buildDummyTx=r.buildDummyTx;exports.calculateCubeRootAdjustment=r.calculateCubeRootAdjustment;exports.calculateNonLinearAdjustment=r.calculateNonLinearAdjustment;exports.calculateSqrtAdjustment=r.calculateSqrtAdjustment;exports.castFeeEstimation=r.castFeeEstimation;exports.estimatedFeeToMaxFeeTotal=r.estimatedFeeToMaxFeeTotal;exports.estimatedFeeToMaxResourceBounds=r.estimatedFeeToMaxResourceBounds;exports.estimatedFeeToTotal=r.estimatedFeeToTotal;exports.estimatedFeesToMaxFeeTotal=r.estimatedFeesToMaxFeeTotal;exports.estimatedFeesToTotal=r.estimatedFeesToTotal;exports.getEstimatedFeeFromBulkSimulation=r.getEstimatedFeeFromBulkSimulation;exports.getEstimatedFeeFromSimulationAndRespectWatermarkFee=r.getEstimatedFeeFromSimulationAndRespectWatermarkFee;exports.getPayloadFromTransaction=r.getPayloadFromTransaction;exports.getWatermarkedMaxFeeTotal=r.getWatermarkedMaxFeeTotal;exports.isFRI=r.isFRI;exports.isWEI=r.isWEI;exports.multiplyBigIntByFloat=r.multiplyBigIntByFloat;exports.toMax=r.toMax;exports.tokensRequireTxV3Support=r.tokensRequireTxV3Support;exports.unitToFeeTokenAddress=r.unitToFeeTokenAddress;exports.EventsBySelector=K.EventsBySelector;exports.findTransfersAndApprovals=K.findTransfersAndApprovals;exports.getPrettyRpcError=fe.getPrettyRpcError;exports.getSimulationTxVersionFromFeeToken=B.getSimulationTxVersionFromFeeToken;exports.getTxVersionFromFeeToken=B.getTxVersionFromFeeToken;exports.getTxVersionFromFeeTokenForDeclareContract=B.getTxVersionFromFeeTokenForDeclareContract;exports.TransactionReviewServiceWeb=Re.TransactionReviewServiceWeb;exports.transactionReviewWarningSchema=Pe.transactionReviewWarningSchema;exports.apiTransactionReviewActivityType=be.apiTransactionReviewActivityType;exports.denyTxV3=X.denyTxV3;exports.txVersionSchema=X.txVersionSchema;exports.classHashSupportsTxV3=$.classHashSupportsTxV3;exports.feeTokenNeedsTxV3Support=$.feeTokenNeedsTxV3Support;exports.formatAddress=Ne.formatAddress;exports.ensureArray=Ie.ensureArray;exports.generateAvatarImage=D.generateAvatarImage;exports.getColor=D.getColor;exports.getNetworkAccountImageUrl=D.getNetworkAccountImageUrl;exports.stripAddressZeroPadding=D.stripAddressZeroPadding;exports.decodeBase58=E.decodeBase58;exports.decodeBase58Array=E.decodeBase58Array;exports.encodeBase58=E.encodeBase58;exports.encodeBase58Array=E.encodeBase58Array;exports.bigNumberSchema=Fe.bigNumberSchema;exports.daysBetween=we.daysBetween;exports.isFeatureEnabled=Be.isFeatureEnabled;exports.hexSchema=Y.hexSchema;exports.hexSchemaBase=Y.hexSchemaBase;exports.id=_e.id;exports.getInitials=Oe.getInitials;exports.isContractDeployed=He.isContractDeployed;exports.nonNullable=Le.nonNullable;exports.isAllowedAddressHexInputValue=Ve.isAllowedAddressHexInputValue;exports.isAllowedNumericInputValue=xe.isAllowedNumericInputValue;exports.isNumeric=Me.isNumeric;exports.prettifyCurrencyNumber=q.prettifyCurrencyNumber;exports.prettifyNumber=q.prettifyNumber;exports.prettifyNumberConfig=q.prettifyNumberConfig;exports.prettifyTokenNumber=q.prettifyTokenNumber;exports.getUint256CalldataFromBN=Z.getUint256CalldataFromBN;exports.parseAmountValue=Z.parseAmountValue;exports.pluralise=We.pluralise;exports.readFileAsString=Ue.readFileAsString;exports.booleanToStringSchema=v.booleanToStringSchema;exports.createSchemaWithWarnings=v.createSchemaWithWarnings;exports.safeParseAndWarn=v.safeParseAndWarn;exports.stringToBooleanSchema=v.stringToBooleanSchema;exports.addOwnersCalldataSchema=t.addOwnersCalldataSchema;exports.addPluginCalldataSchema=t.addPluginCalldataSchema;exports.bigNumberishSchema=t.bigNumberishSchema;exports.callDetailsSchema=t.callDetailsSchema;exports.callSchema=t.callSchema;exports.calldataSchema=t.calldataSchema;exports.changeGuardianCalldataSchema=t.changeGuardianCalldataSchema;exports.changeThresholdCalldataSchema=t.changeThresholdCalldataSchema;exports.escapeGuardianCalldataSchema=t.escapeGuardianCalldataSchema;exports.executeOnPluginCalldataSchema=t.executeOnPluginCalldataSchema;exports.feltSchema=t.feltSchema;exports.looseCalldataSchema=t.looseCalldataSchema;exports.multiTypeSchema=t.multiTypeSchema;exports.rawArgsArraySchema=t.rawArgsArraySchema;exports.rawArgsObjectSchema=t.rawArgsObjectSchema;exports.rawArgsSchema=t.rawArgsSchema;exports.removeOwnersCalldataSchema=t.removeOwnersCalldataSchema;exports.removePluginCalldataSchema=t.removePluginCalldataSchema;exports.replaceSignerCalldataSchema=t.replaceSignerCalldataSchema;exports.transferCalldataSchema=t.transferCalldataSchema;exports.uint256Schema=t.uint256Schema;exports.abiEntrySchema=a.abiEntrySchema;exports.abiSchema=a.abiSchema;exports.builtinsSchema=a.builtinsSchema;exports.byteCodeSchema=a.byteCodeSchema;exports.cairo1EventSchema=a.cairo1EventSchema;exports.cairoAssemblySchema=a.cairoAssemblySchema;exports.compiledContractClassSchema=a.compiledContractClassSchema;exports.compiledSierraCasmSchema=a.compiledSierraCasmSchema;exports.compiledSierraSchema=a.compiledSierraSchema;exports.compressedProgramSchema=a.compressedProgramSchema;exports.contractEntryPointFieldsSchema=a.contractEntryPointFieldsSchema;exports.entryPointsByTypeSchema=a.entryPointsByTypeSchema;exports.eventAbiSchema=a.eventAbiSchema;exports.eventEntrySchema=a.eventEntrySchema;exports.functionAbiSchema=a.functionAbiSchema;exports.functionAbiTypeSchema=a.functionAbiTypeSchema;exports.legacyContractClassSchema=a.legacyContractClassSchema;exports.legacyEventSchema=a.legacyEventSchema;exports.programSchema=a.programSchema;exports.pythonicHintsSchema=a.pythonicHintsSchema;exports.sierraContractEntryPointFieldsSchema=a.sierraContractEntryPointFieldsSchema;exports.sierraEntryPointsByTypeSchema=a.sierraEntryPointsByTypeSchema;exports.sierraProgramDebugInfoSchema=a.sierraProgramDebugInfoSchema;exports.structAbiSchema=a.structAbiSchema;exports.entryPointToHumanReadable=Ge.entryPointToHumanReadable;exports.urlWithQuery=ze.urlWithQuery;exports.voidify=je.voidify;exports.bipsToPercent=Ke.bipsToPercent;exports.retryUntilInitialised=Xe.retryUntilInitialised;
package/dist/index.js CHANGED
@@ -100,6 +100,7 @@ import { entryPointToHumanReadable as ci } from "./src/utils/transactions.js";
100
100
  import { urlWithQuery as di } from "./src/utils/url/urlWithQuery.js";
101
101
  import { voidify as li } from "./src/utils/voidify.js";
102
102
  import { bipsToPercent as fi } from "./src/utils/bips.js";
103
+ import { retryUntilInitialised as Ai } from "./src/utils/retryUntilInitialised.js";
103
104
  export {
104
105
  Ee as ARGENT_ACCOUNT_CONTRACT_CLASS_HASHES,
105
106
  Re as ARGENT_MULTISIG_CONTRACT_CLASS_HASHES,
@@ -399,6 +400,7 @@ export {
399
400
  bm as removeOwnersCalldataSchema,
400
401
  Bm as removePluginCalldataSchema,
401
402
  _m as replaceSignerCalldataSchema,
403
+ Ai as retryUntilInitialised,
402
404
  lm as safeParseAndWarn,
403
405
  sr as seedphraseSchema,
404
406
  oi as sierraContractEntryPointFieldsSchema,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("async-retry"),c=require("url-join"),o=require("./types/backend.model.cjs"),d=require("../../utils/schemas.cjs");class u{constructor(s,e){this.apiBase=s,this.httpService=e,this.TOKENS_INFO_URL="/tokens/info"}async fetchTokensInfoFromBackend(s){const e=c(this.apiBase,this.TOKENS_INFO_URL,s??"","?chain=starknet"),t=await this.httpService.get(e),n=o.apiTokensInfoResponseSchema.safeParse(t);if(n.success)return n.data.tokens;const r=o.apiTokenInfoResponseSchema.safeParse(t);if(r.success)return[r.data]}async fetchAddressTokenBalancesFromBackend(s,e,t){const n=c(this.apiBase,"activity","starknet",e,"account",s,"balance");return(await h(async a=>{let p;try{p=await this.httpService.get(n)}catch{return a(new Error("Error fetching")),[]}const i=o.apiAccountTokenBalancesSchema.safeParse(p);if(!i.success)return a(new Error("Error parsing response")),[];if(i.data.status!=="initialised")throw new Error("Not initialised yet");return i.data.balances},{retries:5,minTimeout:5e3,...t})).map(a=>({address:a.tokenAddress,balance:a.tokenBalance,networkId:e}))}async fetchDefiDecomposition(s,e){const t=c(this.apiBase,"tokens/defi",s,"investments","?chain=starknet",`&application=${e}`),n=await this.httpService.get(t);return d.safeParseAndWarn(o.apiDefiPositionsSchema,n).success||console.error("Backend schema has changed. Make the changes to the models to prevent unknown/unhandled errors."),n.dapps}}exports.TokenServiceWeb=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("url-join"),r=require("../../utils/retryUntilInitialised.cjs"),i=require("./types/backend.model.cjs"),h=require("../../utils/schemas.cjs");class d{constructor(n,e){this.apiBase=n,this.httpService=e,this.TOKENS_INFO_URL="/tokens/info"}async fetchTokensInfoFromBackend(n){const e=o(this.apiBase,this.TOKENS_INFO_URL,n??"","?chain=starknet"),a=await this.httpService.get(e),t=i.apiTokensInfoResponseSchema.safeParse(a);if(t.success)return t.data.tokens;const s=i.apiTokenInfoResponseSchema.safeParse(a);if(s.success)return[s.data]}async fetchAddressTokenBalancesFromBackend(n,e,a){const t=o(this.apiBase,"activity","starknet",e,"account",n,"balance"),s=await r.retryUntilInitialised(()=>this.httpService.get(t),i.apiAccountTokenBalancesSchema,a);return((s==null?void 0:s.status)==="initialised"?s.balances:[]).map(c=>({address:c.tokenAddress,balance:c.tokenBalance,networkId:e}))}async fetchDefiDecomposition(n,e){const a=o(this.apiBase,"tokens/defi",n,"investments","?chain=starknet",`&application=${e}`),t=await this.httpService.get(a);return h.safeParseAndWarn(i.apiDefiPositionsSchema,t).success||console.error("Backend schema has changed. Make the changes to the models to prevent unknown/unhandled errors."),t.dapps}}exports.TokenServiceWeb=d;
@@ -1,64 +1,42 @@
1
- import p from "async-retry";
2
- import i from "url-join";
3
- import { apiTokensInfoResponseSchema as h, apiTokenInfoResponseSchema as d, apiAccountTokenBalancesSchema as u, apiDefiPositionsSchema as f } from "./types/backend.model.js";
1
+ import o from "url-join";
2
+ import { retryUntilInitialised as c } from "../../utils/retryUntilInitialised.js";
3
+ import { apiTokensInfoResponseSchema as r, apiTokenInfoResponseSchema as p, apiAccountTokenBalancesSchema as h, apiDefiPositionsSchema as d } from "./types/backend.model.js";
4
4
  import { safeParseAndWarn as k } from "../../utils/schemas.js";
5
- class R {
6
- constructor(s, e) {
7
- this.apiBase = s, this.httpService = e, this.TOKENS_INFO_URL = "/tokens/info";
5
+ class v {
6
+ constructor(t, e) {
7
+ this.apiBase = t, this.httpService = e, this.TOKENS_INFO_URL = "/tokens/info";
8
8
  }
9
9
  /**
10
10
  * Fetch tokens info from backend
11
11
  * @param {Address} tokenAddress - The token address.
12
12
  * @returns {Promise<ApiTokenInfo[]>} - The fetched tokens or undefined if there was an error or not default network
13
13
  */
14
- async fetchTokensInfoFromBackend(s) {
15
- const e = i(this.apiBase, this.TOKENS_INFO_URL, s ?? "", "?chain=starknet"), n = await this.httpService.get(e), t = h.safeParse(n);
16
- if (t.success)
17
- return t.data.tokens;
18
- const r = d.safeParse(n);
19
- if (r.success)
20
- return [r.data];
14
+ async fetchTokensInfoFromBackend(t) {
15
+ const e = o(this.apiBase, this.TOKENS_INFO_URL, t ?? "", "?chain=starknet"), a = await this.httpService.get(e), n = r.safeParse(a);
16
+ if (n.success)
17
+ return n.data.tokens;
18
+ const s = p.safeParse(a);
19
+ if (s.success)
20
+ return [s.data];
21
21
  }
22
22
  /**
23
23
  * Fetch list of tokens and balances for given account from backend
24
24
  * @param {Address} address - The account address.
25
25
  * @returns {Promise<WebBaseTokenWithBalance[]>} - The fetched balances for the account address.
26
26
  */
27
- async fetchAddressTokenBalancesFromBackend(s, e, n) {
28
- const t = i(this.apiBase, "activity", "starknet", e, "account", s, "balance");
29
- return (await p(
30
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
- async (a) => {
32
- let c;
33
- try {
34
- c = await this.httpService.get(t);
35
- } catch {
36
- return a(new Error("Error fetching")), [];
37
- }
38
- const o = u.safeParse(c);
39
- if (!o.success)
40
- return a(new Error("Error parsing response")), [];
41
- if (o.data.status !== "initialised")
42
- throw new Error("Not initialised yet");
43
- return o.data.balances;
44
- },
45
- {
46
- /** seems to take 5-10 sec for initialised state */
47
- retries: 5,
48
- minTimeout: 5e3,
49
- ...n
50
- }
51
- )).map((a) => ({
52
- address: a.tokenAddress,
53
- balance: a.tokenBalance,
27
+ async fetchAddressTokenBalancesFromBackend(t, e, a) {
28
+ const n = o(this.apiBase, "activity", "starknet", e, "account", t, "balance"), s = await c(() => this.httpService.get(n), h, a);
29
+ return ((s == null ? void 0 : s.status) === "initialised" ? s.balances : []).map((i) => ({
30
+ address: i.tokenAddress,
31
+ balance: i.tokenBalance,
54
32
  networkId: e
55
33
  }));
56
34
  }
57
- async fetchDefiDecomposition(s, e) {
58
- const n = i(this.apiBase, "tokens/defi", s, "investments", "?chain=starknet", `&application=${e}`), t = await this.httpService.get(n);
59
- return k(f, t).success || console.error("Backend schema has changed. Make the changes to the models to prevent unknown/unhandled errors."), t.dapps;
35
+ async fetchDefiDecomposition(t, e) {
36
+ const a = o(this.apiBase, "tokens/defi", t, "investments", "?chain=starknet", `&application=${e}`), n = await this.httpService.get(a);
37
+ return k(d, n).success || console.error("Backend schema has changed. Make the changes to the models to prevent unknown/unhandled errors."), n.dapps;
60
38
  }
61
39
  }
62
40
  export {
63
- R as TokenServiceWeb
41
+ v as TokenServiceWeb
64
42
  };
@@ -21,3 +21,4 @@ export * from './transactions';
21
21
  export * from './url';
22
22
  export * from './voidify';
23
23
  export * from './bips';
24
+ export * from './retryUntilInitialised';
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("async-retry"),o=require("./schemas.cjs");async function u(n,i,s={retries:5,minTimeout:5e3}){return a(async e=>{let t=null;try{t=await n()}catch{return e(new Error("Error fetching")),null}const r=o.safeParseAndWarn(i,t);if(!r.success)return e(new Error("Error parsing response")),null;if(r.data.status!=="initialised")throw new Error("Not initialised yet");return r.data},s)}exports.retryUntilInitialised=u;
@@ -0,0 +1,16 @@
1
+ import { default as retry } from 'async-retry';
2
+ import { z } from 'zod';
3
+ type InitialisationStatus = {
4
+ status: "initialising";
5
+ } | {
6
+ status: "initialised";
7
+ };
8
+ /**
9
+ * Retries an async function until the "initialised" status is achieved or the maximum number of retries is reached.
10
+ * @param fn The async function to retry
11
+ * @param validationSchema A Zod schema to validate the response from the async function
12
+ * @param opts Retry options
13
+ * @returns The result of the successful function call, or null if the maximum number of retries is reached or an error occurs
14
+ */
15
+ export declare function retryUntilInitialised<T extends InitialisationStatus>(fn: () => Promise<T>, validationSchema: z.ZodType, opts?: retry.Options): Promise<T | null>;
16
+ export {};
@@ -0,0 +1,21 @@
1
+ import a from "async-retry";
2
+ import { safeParseAndWarn as o } from "./schemas.js";
3
+ async function c(n, i, s = { retries: 5, minTimeout: 5e3 }) {
4
+ return a(async (t) => {
5
+ let e = null;
6
+ try {
7
+ e = await n();
8
+ } catch {
9
+ return t(new Error("Error fetching")), null;
10
+ }
11
+ const r = o(i, e);
12
+ if (!r.success)
13
+ return t(new Error("Error parsing response")), null;
14
+ if (r.data.status !== "initialised")
15
+ throw new Error("Not initialised yet");
16
+ return r.data;
17
+ }, s);
18
+ }
19
+ export {
20
+ c as retryUntilInitialised
21
+ };
@@ -4,8 +4,12 @@ export declare const stringToBooleanSchema: z.ZodEffects<z.ZodString, boolean, s
4
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
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
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;
7
+ type ISafeParseAndWarn<T extends z.ZodType> = {
8
+ success: true;
9
+ data: z.infer<T>;
10
+ } | {
11
+ success: false;
12
+ error: z.ZodError;
11
13
  };
14
+ export declare const safeParseAndWarn: <T extends z.ZodType>(schema: T, data: unknown) => ISafeParseAndWarn<T>;
15
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@argent/x-shared",
3
- "version": "1.43.1",
3
+ "version": "1.44.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/argentlabs/x-shared.git"