@argent/x-shared 1.36.0 → 1.38.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/.eslintrc.d.cts +45 -0
- package/dist/_virtual/_commonjsHelpers.cjs +1 -0
- package/dist/_virtual/_commonjsHelpers.js +6 -0
- package/dist/_virtual/semver.cjs +1 -0
- package/dist/_virtual/semver.js +4 -0
- package/dist/commitlint.config.d.cts +2 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +2 -19
- package/dist/index.js +420 -4
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js +14 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js +88 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.js +203 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.js +68 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.js +166 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.js +581 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.js +48 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.js +4 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js +42 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js +47 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.js +31 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js +61 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.js +21 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.js +114 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.js +107 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js +38 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_assert.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_assert.js +32 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_u64.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/_u64.js +21 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha3.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/sha3.js +107 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/utils.cjs +1 -0
- package/dist/node_modules/.pnpm/@noble_hashes@1.5.0/node_modules/@noble/hashes/esm/utils.js +44 -0
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +1 -0
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +622 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js +20 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js +20 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js +20 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js +13 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js +10 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +10 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js +16 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js +33 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js +5 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +15 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js +13 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js +11 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js +12 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js +13 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js +8 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js +5 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +5 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js +9 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js +17 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js +6 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js +12 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +7 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js +5 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.cjs +1 -0
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.js +7 -0
- package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.cjs +1 -0
- package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.js +134 -0
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.cjs +1 -0
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js +629 -0
- package/dist/simulation.cjs +1 -0
- package/dist/simulation.d.ts +1 -1
- package/dist/simulation.js +69 -1
- package/dist/src/account/account.model.cjs +1 -0
- package/dist/src/account/account.model.js +45 -0
- package/dist/src/account/accountv4.cjs +1 -0
- package/dist/src/account/accountv4.js +14 -0
- package/dist/src/account/preferences.model.cjs +1 -0
- package/dist/src/account/preferences.model.js +11 -0
- package/dist/src/assets/tokens.json.cjs +1 -0
- package/dist/src/assets/tokens.json.js +181 -0
- package/dist/src/backend/schema.cjs +1 -0
- package/dist/src/backend/schema.js +14 -0
- package/dist/src/bigdecimal/constants.cjs +1 -0
- package/dist/src/bigdecimal/constants.js +4 -0
- package/dist/src/bigdecimal/createUnitsSchema.cjs +1 -0
- package/dist/src/bigdecimal/createUnitsSchema.js +8 -0
- package/dist/src/bigdecimal/formatUnits.cjs +1 -0
- package/dist/src/bigdecimal/formatUnits.js +11 -0
- package/dist/src/bigdecimal/index.cjs +1 -0
- package/dist/src/bigdecimal/index.js +33 -0
- package/dist/src/bigdecimal/lib.cjs +1 -0
- package/dist/src/bigdecimal/lib.js +53 -0
- package/dist/src/bigdecimal/parseUnits.cjs +1 -0
- package/dist/src/bigdecimal/parseUnits.js +11 -0
- package/dist/src/bigdecimal/utils.cjs +1 -0
- package/dist/src/bigdecimal/utils.js +37 -0
- package/dist/src/cache/CacheService.cjs +1 -0
- package/dist/src/cache/CacheService.js +37 -0
- package/dist/src/chains/starknet/address.cjs +1 -0
- package/dist/src/chains/starknet/address.js +64 -0
- package/dist/src/chains/starknet/addressDomain.cjs +1 -0
- package/dist/src/chains/starknet/addressDomain.js +29 -0
- package/dist/src/chains/starknet/addressInput.cjs +1 -0
- package/dist/src/chains/starknet/addressInput.js +7 -0
- package/dist/src/chains/starknet/argentName.cjs +1 -0
- package/dist/src/chains/starknet/argentName.js +14 -0
- package/dist/src/chains/starknet/cairoVersionSchema.cjs +1 -0
- package/dist/src/chains/starknet/cairoVersionSchema.js +5 -0
- package/dist/src/chains/starknet/constants.cjs +1 -0
- package/dist/src/chains/starknet/constants.js +10 -0
- package/dist/src/chains/starknet/getAddressFromArgentName.cjs +1 -0
- package/dist/src/chains/starknet/getAddressFromArgentName.js +48 -0
- package/dist/src/chains/starknet/getAddressFromStarkName.cjs +1 -0
- package/dist/src/chains/starknet/getAddressFromStarkName.js +70 -0
- package/dist/src/chains/starknet/network.cjs +1 -0
- package/dist/src/chains/starknet/network.js +20 -0
- package/dist/src/chains/starknet/services/address/StarknetAddressService.cjs +1 -0
- package/dist/src/chains/starknet/services/address/StarknetAddressService.js +38 -0
- package/dist/src/chains/starknet/services/deploymentData/constants.cjs +1 -0
- package/dist/src/chains/starknet/services/deploymentData/constants.js +22 -0
- package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.cjs +1 -0
- package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.js +19 -0
- package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.cjs +1 -0
- package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.js +69 -0
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.cjs +1 -0
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.js +59 -0
- package/dist/src/chains/starknet/starknetId.cjs +1 -0
- package/dist/src/chains/starknet/starknetId.js +14 -0
- package/dist/src/errors/account.cjs +1 -0
- package/dist/src/errors/account.js +14 -0
- package/dist/src/errors/address.cjs +1 -0
- package/dist/src/errors/address.js +14 -0
- package/dist/src/errors/baseErrors.cjs +1 -0
- package/dist/src/errors/baseErrors.js +15 -0
- package/dist/src/errors/call.cjs +1 -0
- package/dist/src/errors/call.js +14 -0
- package/dist/src/errors/network.cjs +1 -0
- package/dist/src/errors/network.js +14 -0
- package/dist/src/errors/review.cjs +1 -0
- package/dist/src/errors/review.js +14 -0
- package/dist/src/errors/swap.cjs +1 -0
- package/dist/src/errors/swap.js +14 -0
- package/dist/src/features/simulation/activity/normalize.cjs +1 -0
- package/dist/src/features/simulation/activity/normalize.js +40 -0
- package/dist/src/features/simulation/activity/schema.cjs +1 -0
- package/dist/src/features/simulation/activity/schema.js +236 -0
- package/dist/src/features/simulation/activity/utils/createNativeActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/createNativeActivity.js +31 -0
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.js +24 -0
- package/dist/src/features/simulation/activity/utils/getOverallLastModified.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/getOverallLastModified.js +6 -0
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.js +10 -0
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js +11 -0
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.js +26 -0
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.js +22 -0
- package/dist/src/features/simulation/activity/utils/parseAccountActivities.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/parseAccountActivities.js +13 -0
- package/dist/src/features/simulation/activity/utils/parseFinanceActivities.cjs +1 -0
- package/dist/src/features/simulation/activity/utils/parseFinanceActivities.js +33 -0
- package/dist/src/features/simulation/fees/schema.cjs +1 -0
- package/dist/src/features/simulation/fees/schema.js +20 -0
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -0
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +18 -0
- package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.cjs +1 -0
- package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.js +6 -0
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -0
- package/dist/src/features/simulation/transactionReview/schema.js +215 -0
- package/dist/src/features/simulation/warning/helper.cjs +1 -0
- package/dist/src/features/simulation/warning/helper.js +12 -0
- package/dist/src/features/simulation/warning/schema.cjs +1 -0
- package/dist/src/features/simulation/warning/schema.js +11 -0
- package/dist/src/features/swap/models/order.model.cjs +1 -0
- package/dist/src/features/swap/models/order.model.js +20 -0
- package/dist/src/features/swap/models/quote.model.cjs +1 -0
- package/dist/src/features/swap/models/quote.model.js +36 -0
- package/dist/src/features/swap/models/trade.model.cjs +1 -0
- package/dist/src/features/swap/models/trade.model.js +28 -0
- package/dist/src/features/swap/services/implementation.cjs +1 -0
- package/dist/src/features/swap/services/implementation.js +76 -0
- package/dist/src/features/swap/utils/slippage.cjs +1 -0
- package/dist/src/features/swap/utils/slippage.js +28 -0
- package/dist/src/features/swap/utils/totalFee.cjs +1 -0
- package/dist/src/features/swap/utils/totalFee.js +13 -0
- package/dist/src/http/DateService.cjs +1 -0
- package/dist/src/http/DateService.js +17 -0
- package/dist/src/http/HttpError.cjs +1 -0
- package/dist/src/http/HttpError.js +8 -0
- package/dist/src/http/HttpService.cjs +1 -0
- package/dist/src/http/HttpService.js +90 -0
- package/dist/src/http/IHttpService.cjs +1 -0
- package/dist/src/http/IHttpService.js +7 -0
- package/dist/src/http/SWRService.cjs +1 -0
- package/dist/src/http/SWRService.js +60 -0
- package/dist/src/http/fetcher.cjs +1 -0
- package/dist/src/http/fetcher.js +36 -0
- package/dist/{http → src/http}/index.d.ts +0 -1
- package/dist/src/http/time.cjs +1 -0
- package/dist/src/http/time.js +19 -0
- package/dist/src/index.d.ts +17 -0
- package/dist/src/knownDapps/KnownDappsBackendService.cjs +1 -0
- package/dist/src/knownDapps/KnownDappsBackendService.js +16 -0
- package/dist/src/knownDapps/schema.cjs +1 -0
- package/dist/src/knownDapps/schema.js +44 -0
- package/dist/src/knownDapps/utils/getDapplandUrl.cjs +1 -0
- package/dist/src/knownDapps/utils/getDapplandUrl.js +12 -0
- package/dist/src/nameResolution/ResolveNameService.cjs +1 -0
- package/dist/src/nameResolution/ResolveNameService.js +42 -0
- package/dist/src/nameResolution/schema.cjs +1 -0
- package/dist/src/nameResolution/schema.js +25 -0
- package/dist/src/nfts/BackendNftService.cjs +1 -0
- package/dist/src/nfts/BackendNftService.js +119 -0
- package/dist/src/nfts/BackendPaginationError.cjs +1 -0
- package/dist/src/nfts/BackendPaginationError.js +13 -0
- package/dist/{nfts → src/nfts}/index.d.ts +0 -1
- package/dist/src/nfts/utils.cjs +1 -0
- package/dist/src/nfts/utils.js +14 -0
- package/dist/src/onchainRecovery/OnchainRecoveryService.cjs +1 -0
- package/dist/src/onchainRecovery/OnchainRecoveryService.js +69 -0
- package/dist/src/onchainRecovery/schema.cjs +1 -0
- package/dist/src/onchainRecovery/schema.js +49 -0
- package/dist/src/platform/isBraveBrowser.cjs +1 -0
- package/dist/src/platform/isBraveBrowser.js +11 -0
- package/dist/src/platform/isBrowser.cjs +1 -0
- package/dist/src/platform/isBrowser.js +28 -0
- package/dist/src/signer/multisigner.cjs +1 -0
- package/dist/src/signer/multisigner.js +19 -0
- package/dist/src/signer/seedphrase.cjs +1 -0
- package/dist/src/signer/seedphrase.js +7 -0
- package/dist/src/tokens/balances.cjs +1 -0
- package/dist/src/tokens/balances.js +38 -0
- package/dist/src/tokens/constants.cjs +1 -0
- package/dist/src/tokens/constants.js +4 -0
- package/dist/src/tokens/convertTokenAmountToCurrencyValue.cjs +1 -0
- package/dist/src/tokens/convertTokenAmountToCurrencyValue.js +16 -0
- package/dist/src/tokens/convertTokenUnitAmountWithDecimals.cjs +1 -0
- package/dist/src/tokens/convertTokenUnitAmountWithDecimals.js +11 -0
- package/dist/src/tokens/ensureDecimals.cjs +1 -0
- package/dist/src/tokens/ensureDecimals.js +5 -0
- package/dist/src/tokens/getCurrencySymbol.cjs +1 -0
- package/dist/src/tokens/getCurrencySymbol.js +15 -0
- package/dist/src/tokens/isUnlimitedAmount.cjs +1 -0
- package/dist/src/tokens/isUnlimitedAmount.js +5 -0
- package/dist/src/tokens/prettifyCurrencyValue.cjs +1 -0
- package/dist/src/tokens/prettifyCurrencyValue.js +11 -0
- package/dist/src/tokens/prettifyTokenAmount.cjs +1 -0
- package/dist/src/tokens/prettifyTokenAmount.js +23 -0
- package/dist/src/tokens/service/implementation.cjs +1 -0
- package/dist/src/tokens/service/implementation.d.ts +256 -0
- package/dist/src/tokens/service/implementation.js +64 -0
- package/dist/src/tokens/service/tokenError.cjs +1 -0
- package/dist/src/tokens/service/tokenError.js +14 -0
- package/dist/src/tokens/service/types/backend.model.cjs +1 -0
- package/dist/src/tokens/service/types/backend.model.d.ts +9185 -0
- package/dist/src/tokens/service/types/backend.model.js +127 -0
- package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -0
- package/dist/{tokens → src/tokens}/service/types/defiPosition.model.d.ts +11 -11
- package/dist/src/tokens/service/types/defiPosition.model.js +68 -0
- package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -0
- package/dist/{tokens → src/tokens}/service/types/defiPositionType.model.d.ts +1 -1
- package/dist/src/tokens/service/types/defiPositionType.model.js +9 -0
- package/dist/src/tokens/service/types/unclaimedRewards.model.cjs +1 -0
- package/dist/src/tokens/service/types/unclaimedRewards.model.js +16 -0
- package/dist/src/tokens/service/types/webToken.model.cjs +1 -0
- package/dist/src/tokens/service/types/webToken.model.js +45 -0
- package/dist/src/transactions/amount.cjs +1 -0
- package/dist/src/transactions/amount.js +24 -0
- package/dist/src/transactions/buildTransactions.cjs +1 -0
- package/dist/src/transactions/buildTransactions.js +34 -0
- package/dist/src/transactions/errors.cjs +1 -0
- package/dist/src/transactions/errors.js +19 -0
- package/dist/src/transactions/estimate/argentMaxFee.cjs +1 -0
- package/dist/src/transactions/estimate/argentMaxFee.js +13 -0
- package/dist/src/transactions/estimate/error.cjs +1 -0
- package/dist/src/transactions/estimate/error.js +14 -0
- package/dist/src/transactions/estimate/model.cjs +1 -0
- package/dist/src/transactions/estimate/model.js +14 -0
- package/dist/src/transactions/estimate/utils.cjs +1 -0
- package/dist/src/transactions/estimate/utils.js +232 -0
- package/dist/src/transactions/findTransfersAndApprovals.cjs +1 -0
- package/dist/src/transactions/findTransfersAndApprovals.js +31 -0
- package/dist/src/transactions/getPrettyRcpError.cjs +1 -0
- package/dist/src/transactions/getPrettyRcpError.js +11 -0
- package/dist/src/transactions/getTransactionVersion.cjs +1 -0
- package/dist/src/transactions/getTransactionVersion.js +18 -0
- package/dist/{transactions → src/transactions}/index.d.ts +0 -6
- package/dist/src/transactions/service/implementation.cjs +1 -0
- package/dist/src/transactions/service/implementation.js +182 -0
- package/dist/src/transactions/service/types.cjs +1 -0
- package/dist/src/transactions/service/types.js +10 -0
- package/dist/src/transactions/transactionReviewTypes.cjs +1 -0
- package/dist/src/transactions/transactionReviewTypes.js +10 -0
- package/dist/src/transactions/transactionVersion.cjs +1 -0
- package/dist/src/transactions/transactionVersion.js +14 -0
- package/dist/src/transactions/txv3.cjs +1 -0
- package/dist/src/transactions/txv3.js +14 -0
- package/dist/src/utils/address.cjs +1 -0
- package/dist/src/utils/address.js +4 -0
- package/dist/src/utils/arrays.cjs +1 -0
- package/dist/src/utils/arrays.js +4 -0
- package/dist/src/utils/avatarImage.cjs +4 -0
- package/dist/src/utils/avatarImage.js +42 -0
- package/dist/src/utils/base58.cjs +1 -0
- package/dist/src/utils/base58.js +15 -0
- package/dist/src/utils/bigNumber.cjs +1 -0
- package/dist/src/utils/bigNumber.js +7 -0
- package/dist/src/utils/bips.cjs +1 -0
- package/dist/src/utils/bips.js +11 -0
- package/dist/src/utils/daysBetween.cjs +1 -0
- package/dist/src/utils/daysBetween.js +7 -0
- package/dist/src/utils/env.cjs +1 -0
- package/dist/src/utils/env.js +4 -0
- package/dist/src/utils/hex.cjs +1 -0
- package/dist/src/utils/hex.js +9 -0
- package/dist/src/utils/id.cjs +1 -0
- package/dist/src/utils/id.js +8 -0
- package/dist/{utils → src/utils}/index.d.ts +0 -1
- package/dist/src/utils/initials.cjs +1 -0
- package/dist/src/utils/initials.js +16 -0
- package/dist/src/utils/isContractDeployed.cjs +1 -0
- package/dist/src/utils/isContractDeployed.js +10 -0
- package/dist/src/utils/nonNullable.cjs +1 -0
- package/dist/src/utils/nonNullable.js +7 -0
- package/dist/src/utils/number/isAllowedAddressHexInputValue.cjs +1 -0
- package/dist/src/utils/number/isAllowedAddressHexInputValue.js +7 -0
- package/dist/src/utils/number/isAllowedNumericInputValue.cjs +1 -0
- package/dist/src/utils/number/isAllowedNumericInputValue.js +8 -0
- package/dist/src/utils/number/isNumeric.cjs +1 -0
- package/dist/src/utils/number/isNumeric.js +4 -0
- package/dist/src/utils/number/prettifyNumber.cjs +1 -0
- package/dist/src/utils/number/prettifyNumber.js +47 -0
- package/dist/src/utils/parseAmount.cjs +1 -0
- package/dist/src/utils/parseAmount.js +14 -0
- package/dist/src/utils/pluralise.cjs +1 -0
- package/dist/src/utils/pluralise.js +4 -0
- package/dist/src/utils/readFileAsString.cjs +1 -0
- package/dist/src/utils/readFileAsString.js +10 -0
- package/dist/src/utils/schemas.cjs +1 -0
- package/dist/src/utils/schemas.d.ts +11 -0
- package/dist/src/utils/schemas.js +29 -0
- package/dist/src/utils/starknet/starknet.cjs +1 -0
- package/dist/src/utils/starknet/starknet.js +57 -0
- package/dist/src/utils/starknet/starknetLibTypes.cjs +1 -0
- package/dist/src/utils/starknet/starknetLibTypes.js +7 -0
- package/dist/src/utils/starknet/starknetSchemas.cjs +1 -0
- package/dist/src/utils/starknet/starknetSchemas.js +102 -0
- package/dist/src/utils/transactions.cjs +1 -0
- package/dist/src/utils/transactions.js +11 -0
- package/dist/src/utils/url/urlWithQuery.cjs +1 -0
- package/dist/src/utils/url/urlWithQuery.js +9 -0
- package/dist/src/utils/voidify.cjs +1 -0
- package/dist/src/utils/voidify.js +8 -0
- package/dist/swap.cjs +1 -0
- package/dist/swap.d.ts +1 -1
- package/dist/swap.js +20 -1
- package/package.json +14 -28
- package/dist/bips-CP71ZN9a.js +0 -1
- package/dist/bips-zBtnMbia.mjs +0 -114
- package/dist/hooks/index.d.ts +0 -2
- package/dist/hooks/useDebounce.d.ts +0 -1
- package/dist/hooks/useDebouncedValue.d.ts +0 -1
- package/dist/http/swr.d.ts +0 -21
- package/dist/index.mjs +0 -4464
- package/dist/nfts/useNfts.d.ts +0 -23
- package/dist/providers/WebAmplitude/WebAmplitudeProvider.d.ts +0 -7
- package/dist/providers/WebAmplitude/index.d.ts +0 -2
- package/dist/providers/WebAmplitude/service.d.ts +0 -7
- package/dist/providers/WebAmplitude/types.d.ts +0 -6
- package/dist/providers/WebAmplitude/utils.d.ts +0 -2
- package/dist/providers/index.d.ts +0 -1
- package/dist/simulation.mjs +0 -255
- package/dist/swap.mjs +0 -183
- package/dist/tokens/service/implementation.d.ts +0 -76
- package/dist/tokens/service/types/backend.model.d.ts +0 -2178
- package/dist/transactionVersion-CACUj2ch.mjs +0 -793
- package/dist/transactionVersion-CaRQ5Df4.js +0 -1
- package/dist/transactions/useBalanceChange.d.ts +0 -5
- package/dist/transactions/useErc20Transactions.d.ts +0 -6
- package/dist/transactions/useErc721Transactions.d.ts +0 -5
- package/dist/transactions/useErc721Transfers.d.ts +0 -5
- package/dist/transactions/useMaxAmountTransaction.d.ts +0 -7
- package/dist/transactions/useTransactionReview.d.ts +0 -15
- package/dist/transactions/useTransactionReviewV2web.d.ts +0 -1004
- package/dist/utils/schemas.d.ts +0 -3
- package/dist/utils/useEventEmitter.d.ts +0 -67
- package/dist/webToken.model-Cl4dvcmj.mjs +0 -1881
- package/dist/webToken.model-Dsd8Rd3e.js +0 -1
- package/dist/{account → src/account}/account.model.d.ts +0 -0
- package/dist/{account → src/account}/accountv4.d.ts +0 -0
- package/dist/{account → src/account}/index.d.ts +0 -0
- package/dist/{account → src/account}/preferences.model.d.ts +0 -0
- package/dist/{backend → src/backend}/index.d.ts +0 -0
- package/dist/{backend → src/backend}/schema.d.ts +0 -0
- package/dist/{backend → src/backend}/types.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/constants.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/createUnitsSchema.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/formatUnits.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/index.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/lib.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/parseUnits.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/type.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/types.d.ts +0 -0
- package/dist/{bigdecimal → src/bigdecimal}/utils.d.ts +0 -0
- package/dist/{cache → src/cache}/CacheService.d.ts +0 -0
- package/dist/{cache → src/cache}/ICacheService.d.ts +0 -0
- package/dist/{cache → src/cache}/index.d.ts +0 -0
- package/dist/{chains → src/chains}/index.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/address.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/addressDomain.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/addressInput.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/argentName.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/cairoVersionSchema.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/constants.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/getAddressFromArgentName.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/getAddressFromStarkName.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/index.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/network.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/address/IStarknetAddressService.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/address/StarknetAddressService.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/address/index.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/deploymentData/constants.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/deploymentData/deploymentData.schema.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/deploymentData/findImplementationForAccount.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/deploymentData/getAccountClassHash.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/deploymentData/index.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/services/index.d.ts +0 -0
- package/dist/{chains → src/chains}/starknet/starknetId.d.ts +0 -0
- package/dist/{errors → src/errors}/account.d.ts +0 -0
- package/dist/{errors → src/errors}/address.d.ts +0 -0
- package/dist/{errors → src/errors}/baseErrors.d.ts +0 -0
- package/dist/{errors → src/errors}/call.d.ts +0 -0
- package/dist/{errors → src/errors}/network.d.ts +0 -0
- package/dist/{errors → src/errors}/review.d.ts +0 -0
- package/dist/{errors → src/errors}/swap.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/normalize.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/schema.d.ts +200 -200
- package/dist/{features → src/features}/simulation/activity/utils/createNativeActivity.d.ts +6 -6
- package/dist/{features → src/features}/simulation/activity/utils/getAnyActivityTitle.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/getOverallLastModified.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/hasDelegationActivity.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/isMulticallWithDeploymentActivity.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/isRejectOnChainActivity.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/isUpgradeActivity.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/parseAccountActivities.d.ts +0 -0
- package/dist/{features → src/features}/simulation/activity/utils/parseFinanceActivities.d.ts +0 -0
- package/dist/{features → src/features}/simulation/fees/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/fees/schema.d.ts +0 -0
- package/dist/{features → src/features}/simulation/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.d.ts +0 -0
- package/dist/{features → src/features}/simulation/transactionReview/getMessageFromSimulationError.d.ts +0 -0
- package/dist/{features → src/features}/simulation/transactionReview/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/transactionReview/schema.d.ts +1324 -1324
- package/dist/{features → src/features}/simulation/warning/helper.d.ts +0 -0
- package/dist/{features → src/features}/simulation/warning/index.d.ts +0 -0
- package/dist/{features → src/features}/simulation/warning/schema.d.ts +0 -0
- package/dist/{features → src/features}/swap/index.d.ts +0 -0
- package/dist/{features → src/features}/swap/models/index.d.ts +0 -0
- package/dist/{features → src/features}/swap/models/order.model.d.ts +0 -0
- package/dist/{features → src/features}/swap/models/quote.model.d.ts +0 -0
- package/dist/{features → src/features}/swap/models/trade.model.d.ts +0 -0
- package/dist/{features → src/features}/swap/services/implementation.d.ts +0 -0
- package/dist/{features → src/features}/swap/services/index.d.ts +0 -0
- package/dist/{features → src/features}/swap/services/interface.d.ts +0 -0
- package/dist/{features → src/features}/swap/services/order.mock.d.ts +0 -0
- package/dist/{features → src/features}/swap/services/quote.mock.d.ts +0 -0
- package/dist/{features → src/features}/swap/tests/token.mock.d.ts +0 -0
- package/dist/{features → src/features}/swap/tests/trade.mock.d.ts +0 -0
- package/dist/{features → src/features}/swap/tests/walletAccount.mock.d.ts +0 -0
- package/dist/{features → src/features}/swap/utils/index.d.ts +0 -0
- package/dist/{features → src/features}/swap/utils/slippage.d.ts +0 -0
- package/dist/{features → src/features}/swap/utils/totalFee.d.ts +0 -0
- package/dist/{http → src/http}/DateService.d.ts +0 -0
- package/dist/{http → src/http}/HttpError.d.ts +0 -0
- package/dist/{http → src/http}/HttpService.d.ts +0 -0
- package/dist/{http → src/http}/IDateService.d.ts +0 -0
- package/dist/{http → src/http}/IHttpService.d.ts +0 -0
- package/dist/{http → src/http}/SWRService.d.ts +0 -0
- package/dist/{http → src/http}/apiData.d.ts +0 -0
- package/dist/{http → src/http}/fetcher.d.ts +0 -0
- package/dist/{http → src/http}/time.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/IKnownDappsBackendService.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/KnownDappsBackendService.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/index.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/schema.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/utils/getDapplandUrl.d.ts +0 -0
- package/dist/{knownDapps → src/knownDapps}/utils/index.d.ts +0 -0
- package/dist/{nameResolution → src/nameResolution}/IResolveNameService.d.ts +0 -0
- package/dist/{nameResolution → src/nameResolution}/ResolveNameService.d.ts +0 -0
- package/dist/{nameResolution → src/nameResolution}/index.d.ts +0 -0
- package/dist/{nameResolution → src/nameResolution}/schema.d.ts +0 -0
- package/dist/{nfts → src/nfts}/BackendNftService.d.ts +0 -0
- package/dist/{nfts → src/nfts}/BackendPaginationError.d.ts +0 -0
- package/dist/{nfts → src/nfts}/INFTService.d.ts +0 -0
- package/dist/{nfts → src/nfts}/utils.d.ts +0 -0
- package/dist/{onchainRecovery → src/onchainRecovery}/IOnchainRecoveryService.d.ts +0 -0
- package/dist/{onchainRecovery → src/onchainRecovery}/OnchainRecoveryService.d.ts +0 -0
- package/dist/{onchainRecovery → src/onchainRecovery}/index.d.ts +0 -0
- package/dist/{onchainRecovery → src/onchainRecovery}/schema.d.ts +0 -0
- package/dist/{platform → src/platform}/index.d.ts +0 -0
- package/dist/{platform → src/platform}/isBraveBrowser.d.ts +0 -0
- package/dist/{platform → src/platform}/isBrowser.d.ts +0 -0
- package/dist/{signer → src/signer}/index.d.ts +0 -0
- package/dist/{signer → src/signer}/multisigner.d.ts +0 -0
- package/dist/{signer → src/signer}/seedphrase.d.ts +0 -0
- package/dist/{tokens → src/tokens}/balances.d.ts +0 -0
- package/dist/{tokens → src/tokens}/constants.d.ts +0 -0
- package/dist/{tokens → src/tokens}/convertTokenAmountToCurrencyValue.d.ts +0 -0
- package/dist/{tokens → src/tokens}/convertTokenUnitAmountWithDecimals.d.ts +0 -0
- package/dist/{tokens → src/tokens}/ensureDecimals.d.ts +0 -0
- package/dist/{tokens → src/tokens}/getCurrencySymbol.d.ts +0 -0
- package/dist/{tokens → src/tokens}/index.d.ts +0 -0
- package/dist/{tokens → src/tokens}/isUnlimitedAmount.d.ts +0 -0
- package/dist/{tokens → src/tokens}/prettifyCurrencyValue.d.ts +0 -0
- package/dist/{tokens → src/tokens}/prettifyTokenAmount.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/index.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/interface.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/tokenError.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/types/index.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/types/unclaimedRewards.model.d.ts +0 -0
- package/dist/{tokens → src/tokens}/service/types/webToken.model.d.ts +0 -0
- package/dist/{tokens → src/tokens}/token.d.ts +0 -0
- package/dist/{transactions → src/transactions}/aggregatedSimDataTypes.d.ts +0 -0
- package/dist/{transactions → src/transactions}/amount.d.ts +0 -0
- package/dist/{transactions → src/transactions}/buildTransactions.d.ts +0 -0
- package/dist/{transactions → src/transactions}/deployAccountTypes.d.ts +0 -0
- package/dist/{transactions → src/transactions}/errors.d.ts +0 -0
- package/dist/{transactions → src/transactions}/estimate/argentMaxFee.d.ts +0 -0
- package/dist/{transactions → src/transactions}/estimate/error.d.ts +0 -0
- package/dist/{transactions → src/transactions}/estimate/index.d.ts +0 -0
- package/dist/{transactions → src/transactions}/estimate/model.d.ts +0 -0
- package/dist/{transactions → src/transactions}/estimate/utils.d.ts +0 -0
- package/dist/{transactions → src/transactions}/findTransfersAndApprovals.d.ts +0 -0
- package/dist/{transactions → src/transactions}/getPrettyRcpError.d.ts +0 -0
- package/dist/{transactions → src/transactions}/getTransactionVersion.d.ts +0 -0
- package/dist/{transactions → src/transactions}/service/implementation.d.ts +0 -0
- package/dist/{transactions → src/transactions}/service/index.d.ts +0 -0
- package/dist/{transactions → src/transactions}/service/interface.d.ts +0 -0
- package/dist/{transactions → src/transactions}/service/types.d.ts +2 -2
- /package/dist/{transactions → src/transactions}/transactionAction.d.ts +0 -0
- /package/dist/{transactions → src/transactions}/transactionReviewTypes.d.ts +0 -0
- /package/dist/{transactions → src/transactions}/transactionSimulationTypes.d.ts +0 -0
- /package/dist/{transactions → src/transactions}/transactionVersion.d.ts +0 -0
- /package/dist/{transactions → src/transactions}/txv3.d.ts +0 -0
- /package/dist/{transactions → src/transactions}/types.d.ts +0 -0
- /package/dist/{utils → src/utils}/address.d.ts +0 -0
- /package/dist/{utils → src/utils}/arrays.d.ts +0 -0
- /package/dist/{utils → src/utils}/avatarImage.d.ts +0 -0
- /package/dist/{utils → src/utils}/base58.d.ts +0 -0
- /package/dist/{utils → src/utils}/bigNumber.d.ts +0 -0
- /package/dist/{utils → src/utils}/bips.d.ts +0 -0
- /package/dist/{utils → src/utils}/daysBetween.d.ts +0 -0
- /package/dist/{utils → src/utils}/env.d.ts +0 -0
- /package/dist/{utils → src/utils}/hex.d.ts +0 -0
- /package/dist/{utils → src/utils}/id.d.ts +0 -0
- /package/dist/{utils → src/utils}/initials.d.ts +0 -0
- /package/dist/{utils → src/utils}/isContractDeployed.d.ts +0 -0
- /package/dist/{utils → src/utils}/nonNullable.d.ts +0 -0
- /package/dist/{utils → src/utils}/number/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/number/isAllowedAddressHexInputValue.d.ts +0 -0
- /package/dist/{utils → src/utils}/number/isAllowedNumericInputValue.d.ts +0 -0
- /package/dist/{utils → src/utils}/number/isNumeric.d.ts +0 -0
- /package/dist/{utils → src/utils}/number/prettifyNumber.d.ts +0 -0
- /package/dist/{utils → src/utils}/parseAmount.d.ts +0 -0
- /package/dist/{utils → src/utils}/pluralise.d.ts +0 -0
- /package/dist/{utils → src/utils}/readFileAsString.d.ts +0 -0
- /package/dist/{utils → src/utils}/starknet/starknet.d.ts +0 -0
- /package/dist/{utils → src/utils}/starknet/starknetLibTypes.d.ts +0 -0
- /package/dist/{utils → src/utils}/starknet/starknetSchemas.d.ts +0 -0
- /package/dist/{utils → src/utils}/transactions.d.ts +0 -0
- /package/dist/{utils → src/utils}/url/index.d.ts +0 -0
- /package/dist/{utils → src/utils}/url/urlWithQuery.d.ts +0 -0
- /package/dist/{utils → src/utils}/voidify.d.ts +0 -0
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { z as a } from "zod";
|
|
2
|
+
import { addressSchemaArgentBackend as n, addressSchema as e } from "../../../chains/starknet/address.js";
|
|
3
|
+
import { defiPositionTypeSchema as p } from "./defiPositionType.model.js";
|
|
4
|
+
import { createSchemaWithWarnings as l } from "../../../utils/schemas.js";
|
|
5
|
+
const j = a.object({
|
|
6
|
+
status: a.literal("initialising")
|
|
7
|
+
}).or(a.object({
|
|
8
|
+
status: a.literal("initialised"),
|
|
9
|
+
balances: a.array(a.object({
|
|
10
|
+
tokenAddress: n,
|
|
11
|
+
tokenBalance: a.string()
|
|
12
|
+
}))
|
|
13
|
+
})), i = a.object({
|
|
14
|
+
id: a.number(),
|
|
15
|
+
address: e,
|
|
16
|
+
brandColor: a.string().optional(),
|
|
17
|
+
name: a.string(),
|
|
18
|
+
symbol: a.string(),
|
|
19
|
+
decimals: a.number(),
|
|
20
|
+
iconUrl: a.string().optional(),
|
|
21
|
+
sendable: a.boolean(),
|
|
22
|
+
popular: a.boolean(),
|
|
23
|
+
refundable: a.boolean(),
|
|
24
|
+
listed: a.boolean(),
|
|
25
|
+
tradable: a.boolean(),
|
|
26
|
+
category: a.union([
|
|
27
|
+
a.literal("tokens"),
|
|
28
|
+
a.literal("currencies"),
|
|
29
|
+
a.literal("savings")
|
|
30
|
+
]),
|
|
31
|
+
pricingId: a.number().optional(),
|
|
32
|
+
dappId: a.string().optional(),
|
|
33
|
+
marketData: a.object({
|
|
34
|
+
marketCap: a.number(),
|
|
35
|
+
marketCap24hChange: a.number(),
|
|
36
|
+
dailyVolume: a.number(),
|
|
37
|
+
rank: a.number()
|
|
38
|
+
}).optional(),
|
|
39
|
+
tags: a.array(a.string()).optional()
|
|
40
|
+
}), P = a.object({
|
|
41
|
+
tokens: a.array(i)
|
|
42
|
+
}), D = i, m = a.object({
|
|
43
|
+
pricingId: a.number(),
|
|
44
|
+
ethValue: a.string(),
|
|
45
|
+
ccyValue: a.string(),
|
|
46
|
+
ethDayChange: a.string(),
|
|
47
|
+
ccyDayChange: a.string()
|
|
48
|
+
}), f = a.object({
|
|
49
|
+
prices: a.array(m)
|
|
50
|
+
}), t = a.object({
|
|
51
|
+
tokenAddress: n,
|
|
52
|
+
principal: a.string(),
|
|
53
|
+
accruedFees: a.string(),
|
|
54
|
+
minPrice: a.string(),
|
|
55
|
+
maxPrice: a.string(),
|
|
56
|
+
currentPrice: a.string()
|
|
57
|
+
}), o = a.object({
|
|
58
|
+
tokenAddress: e.optional(),
|
|
59
|
+
totalBalances: a.record(a.string())
|
|
60
|
+
}), r = o.extend({
|
|
61
|
+
tokenId: a.string(),
|
|
62
|
+
data: a.object({
|
|
63
|
+
poolFeePercentage: a.string(),
|
|
64
|
+
tickSpacingPercentage: a.string().optional(),
|
|
65
|
+
token0: t,
|
|
66
|
+
token1: t
|
|
67
|
+
})
|
|
68
|
+
}), C = a.array(r), s = o.extend({
|
|
69
|
+
data: a.object({
|
|
70
|
+
apy: a.string()
|
|
71
|
+
}),
|
|
72
|
+
investmentId: a.string().optional()
|
|
73
|
+
}), I = a.array(s), c = o.extend({
|
|
74
|
+
data: a.object({
|
|
75
|
+
apy: a.string().optional(),
|
|
76
|
+
group: a.number().optional(),
|
|
77
|
+
collateral: a.boolean(),
|
|
78
|
+
debt: a.boolean(),
|
|
79
|
+
lending: a.boolean()
|
|
80
|
+
})
|
|
81
|
+
}), A = a.array(c), d = a.array(r.or(c).or(s)), g = l({
|
|
82
|
+
name: a.string(),
|
|
83
|
+
manageUrl: a.string(),
|
|
84
|
+
type: p,
|
|
85
|
+
groups: a.record(a.object({
|
|
86
|
+
name: a.string().optional(),
|
|
87
|
+
healthRatio: a.string().optional()
|
|
88
|
+
})).optional(),
|
|
89
|
+
positions: d
|
|
90
|
+
}), b = a.object({
|
|
91
|
+
dappId: a.string(),
|
|
92
|
+
products: a.array(g)
|
|
93
|
+
}), T = a.object({
|
|
94
|
+
dapps: a.array(b)
|
|
95
|
+
}), u = a.object({
|
|
96
|
+
name: a.string().optional(),
|
|
97
|
+
tokenAddress: e,
|
|
98
|
+
amount: a.string().optional(),
|
|
99
|
+
claimUrl: a.string().optional(),
|
|
100
|
+
claimStart: a.number(),
|
|
101
|
+
claimEnd: a.number().optional()
|
|
102
|
+
}), x = a.object({
|
|
103
|
+
accountAddress: e,
|
|
104
|
+
chain: a.string(),
|
|
105
|
+
airdrops: a.array(u)
|
|
106
|
+
});
|
|
107
|
+
export {
|
|
108
|
+
j as apiAccountTokenBalancesSchema,
|
|
109
|
+
u as apiAirdropSchema,
|
|
110
|
+
c as apiCollateralizedDebtPositionSchema,
|
|
111
|
+
A as apiCollateralizedDebtPositionsSchema,
|
|
112
|
+
r as apiConcentratedLiquidityPositionSchema,
|
|
113
|
+
C as apiConcentratedLiquidityPositionsSchema,
|
|
114
|
+
g as apiDefiDecompositionProduct,
|
|
115
|
+
d as apiDefiDecompositionProducts,
|
|
116
|
+
b as apiDefiDecompositionSchema,
|
|
117
|
+
t as apiDefiDecompositionToken,
|
|
118
|
+
T as apiDefiPositionsSchema,
|
|
119
|
+
f as apiPriceDataResponseSchema,
|
|
120
|
+
m as apiPriceDetailsSchema,
|
|
121
|
+
s as apiStakingPositionSchema,
|
|
122
|
+
I as apiStakingPositionsSchema,
|
|
123
|
+
D as apiTokenInfoResponseSchema,
|
|
124
|
+
i as apiTokenInfoSchema,
|
|
125
|
+
P as apiTokensInfoResponseSchema,
|
|
126
|
+
x as apiUnclaimedRewardsSchema
|
|
127
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),o=require("../../../chains/starknet/address.cjs"),p=require("./backend.model.cjs"),u=require("./defiPositionType.model.cjs"),a=require("./webToken.model.cjs"),i=a.webTokenWithBalanceAndPriceSchema.extend({accruedFees:e.z.string(),currentPrice:e.z.string(),maxPrice:e.z.string(),minPrice:e.z.string(),principal:e.z.string()}),r=e.z.object({address:o.addressSchema.optional(),currencyValue:e.z.string().default("0")}),t=r.extend({poolFeePercentage:e.z.string(),tickSpacingPercentage:e.z.string().optional(),tokenId:e.z.string().optional(),unitCurrencyValueToken0:e.z.string().optional(),unitCurrencyValueToken1:e.z.string().optional(),token0:i,token1:i}),z=e.z.array(t),m=e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional(),accountAddress:o.addressSchema.optional()}),n=r.extend({totalBalances:e.z.record(e.z.string()),collateral:e.z.boolean(),debt:e.z.boolean(),lending:e.z.boolean(),apy:e.z.string().optional(),group:e.z.string().optional(),unitCurrencyValue:e.z.string().optional(),positionToken:p.apiTokenInfoSchema.or(e.z.undefined()),token:a.webTokenWithBalanceAndPriceSchema.optional(),accountAddress:o.addressSchema.optional(),accountAddressGroup:e.z.string().optional()}),h=e.z.array(n),c=t.or(n),s=e.z.record(e.z.object({name:e.z.string().optional(),healthRatio:e.z.string().optional(),accountAddress:o.addressSchema.optional()})),d=e.z.object({type:u.defiPositionTypeSchema,manageUrl:e.z.string().url().optional(),name:e.z.string(),positions:e.z.array(c),positionsTotalValue:e.z.string(),brandColor:e.z.string().optional(),groups:s.optional(),accountAddress:o.addressSchema}),l=e.z.array(d),g=e.z.object({dappId:e.z.string(),products:l});exports.collateralizedDebtGroupSchema=m;exports.collateralizedDebtPositionSchema=n;exports.collateralizedDebtPositionsSchema=h;exports.concentratedLiquidityPositionSchema=t;exports.concentratedLiquidityPositionsSchema=z;exports.defiDappsProductsSchema=g;exports.defiPositionSchema=c;exports.defiProductSchema=d;exports.defiProductsSchema=l;exports.productGroupsSchema=s;
|
|
@@ -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;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { z as o } from "zod";
|
|
2
|
+
import { addressSchema as t } from "../../../chains/starknet/address.js";
|
|
3
|
+
import { apiTokenInfoSchema as c } from "./backend.model.js";
|
|
4
|
+
import { defiPositionTypeSchema as s } from "./defiPositionType.model.js";
|
|
5
|
+
import { webTokenWithBalanceAndPriceSchema as e } from "./webToken.model.js";
|
|
6
|
+
const n = e.extend({
|
|
7
|
+
accruedFees: o.string(),
|
|
8
|
+
currentPrice: o.string(),
|
|
9
|
+
maxPrice: o.string(),
|
|
10
|
+
minPrice: o.string(),
|
|
11
|
+
principal: o.string()
|
|
12
|
+
}), i = o.object({
|
|
13
|
+
address: t.optional(),
|
|
14
|
+
currencyValue: o.string().default("0")
|
|
15
|
+
}), a = i.extend({
|
|
16
|
+
poolFeePercentage: o.string(),
|
|
17
|
+
tickSpacingPercentage: o.string().optional(),
|
|
18
|
+
tokenId: o.string().optional(),
|
|
19
|
+
unitCurrencyValueToken0: o.string().optional(),
|
|
20
|
+
unitCurrencyValueToken1: o.string().optional(),
|
|
21
|
+
token0: n,
|
|
22
|
+
token1: n
|
|
23
|
+
}), b = o.array(a), f = o.object({
|
|
24
|
+
name: o.string().optional(),
|
|
25
|
+
healthRatio: o.string().optional(),
|
|
26
|
+
accountAddress: t.optional()
|
|
27
|
+
}), r = i.extend({
|
|
28
|
+
totalBalances: o.record(o.string()),
|
|
29
|
+
collateral: o.boolean(),
|
|
30
|
+
debt: o.boolean(),
|
|
31
|
+
lending: o.boolean(),
|
|
32
|
+
apy: o.string().optional(),
|
|
33
|
+
group: o.string().optional(),
|
|
34
|
+
unitCurrencyValue: o.string().optional(),
|
|
35
|
+
positionToken: c.or(o.undefined()),
|
|
36
|
+
token: e.optional(),
|
|
37
|
+
accountAddress: t.optional(),
|
|
38
|
+
accountAddressGroup: o.string().optional()
|
|
39
|
+
}), y = o.array(r), l = a.or(r), p = o.record(o.object({
|
|
40
|
+
name: o.string().optional(),
|
|
41
|
+
healthRatio: o.string().optional(),
|
|
42
|
+
accountAddress: t.optional()
|
|
43
|
+
})), d = o.object({
|
|
44
|
+
type: s,
|
|
45
|
+
manageUrl: o.string().url().optional(),
|
|
46
|
+
name: o.string(),
|
|
47
|
+
positions: o.array(l),
|
|
48
|
+
// other types will be added when available from be
|
|
49
|
+
positionsTotalValue: o.string(),
|
|
50
|
+
brandColor: o.string().optional(),
|
|
51
|
+
groups: p.optional(),
|
|
52
|
+
accountAddress: t
|
|
53
|
+
}), u = o.array(d), k = o.object({
|
|
54
|
+
dappId: o.string(),
|
|
55
|
+
products: u
|
|
56
|
+
});
|
|
57
|
+
export {
|
|
58
|
+
f as collateralizedDebtGroupSchema,
|
|
59
|
+
r as collateralizedDebtPositionSchema,
|
|
60
|
+
y as collateralizedDebtPositionsSchema,
|
|
61
|
+
a as concentratedLiquidityPositionSchema,
|
|
62
|
+
b as concentratedLiquidityPositionsSchema,
|
|
63
|
+
k as defiDappsProductsSchema,
|
|
64
|
+
l as defiPositionSchema,
|
|
65
|
+
d as defiProductSchema,
|
|
66
|
+
u as defiProductsSchema,
|
|
67
|
+
p as productGroupsSchema
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),i=e.z.union([e.z.literal("concentratedLiquidityPosition"),e.z.literal("collateralizedDebtPosition"),e.z.literal("staking")]);exports.defiPositionTypeSchema=i;
|
|
@@ -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>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),o=require("../../../chains/starknet/address.cjs"),r=require("./backend.model.cjs"),a=e.z.object({name:e.z.string().optional(),tokenAddress:o.addressSchema,token:r.apiTokenInfoSchema.optional(),amount:e.z.string().optional(),claimUrl:e.z.string().optional(),claimStart:e.z.number(),claimEnd:e.z.number().optional()}),n=e.z.array(a);exports.airdropSchema=a;exports.unclaimedRewardsSchema=n;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { z as o } from "zod";
|
|
2
|
+
import { addressSchema as a } from "../../../chains/starknet/address.js";
|
|
3
|
+
import { apiTokenInfoSchema as r } from "./backend.model.js";
|
|
4
|
+
const n = o.object({
|
|
5
|
+
name: o.string().optional(),
|
|
6
|
+
tokenAddress: a,
|
|
7
|
+
token: r.optional(),
|
|
8
|
+
amount: o.string().optional(),
|
|
9
|
+
claimUrl: o.string().optional(),
|
|
10
|
+
claimStart: o.number(),
|
|
11
|
+
claimEnd: o.number().optional()
|
|
12
|
+
}), e = o.array(n);
|
|
13
|
+
export {
|
|
14
|
+
n as airdropSchema,
|
|
15
|
+
e as unclaimedRewardsSchema
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("zod"),c=require("../../../chains/starknet/address.cjs"),o=require("./backend.model.cjs"),n=e.z.object({address:c.addressSchema,networkId:e.z.string({required_error:"Network is required"})},{required_error:"Token is required"}),s=n.required().extend({balance:e.z.string()}),a=n.required().extend({id:e.z.number().optional(),name:e.z.string().optional(),symbol:e.z.string().optional(),decimals:e.z.coerce.number().optional(),iconUrl:e.z.string().url("").optional().or(e.z.literal("")),pricingId:e.z.number().optional(),category:e.z.string().optional(),dappId:e.z.string().optional(),brandColor:e.z.string().optional()}),r=a.extend({balance:e.z.string()}),i=a.extend({currencyValue:e.z.string(),currencySymbol:e.z.string().optional(),ccyDayChange:e.z.string().optional(),ethDayChange:e.z.string().optional(),unitCurrencyValue:e.z.string().optional()}),t=i.extend({...r.shape}),l=e.z.array(t),h=n.extend({...o.apiPriceDetailsSchema.shape}),d=n.extend({...o.apiTokenInfoSchema.shape});exports.webBaseTokenSchema=n;exports.webBaseTokenWithBalanceSchema=s;exports.webTokenInfoDetailsSchema=d;exports.webTokenPriceDetailsSchema=h;exports.webTokenSchema=a;exports.webTokenWithBalanceAndPriceSchema=t;exports.webTokenWithBalanceSchema=r;exports.webTokenWithPriceSchema=i;exports.webTokensWithBalanceAndPriceSchema=l;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
import { addressSchema as r } from "../../../chains/starknet/address.js";
|
|
3
|
+
import { apiPriceDetailsSchema as a, apiTokenInfoSchema as t } from "./backend.model.js";
|
|
4
|
+
const n = e.object({
|
|
5
|
+
address: r,
|
|
6
|
+
networkId: e.string({ required_error: "Network is required" })
|
|
7
|
+
}, { required_error: "Token is required" }), p = n.required().extend({
|
|
8
|
+
balance: e.string()
|
|
9
|
+
}), o = n.required().extend({
|
|
10
|
+
id: e.number().optional(),
|
|
11
|
+
name: e.string().optional(),
|
|
12
|
+
symbol: e.string().optional(),
|
|
13
|
+
decimals: e.coerce.number().optional(),
|
|
14
|
+
iconUrl: e.string().url("").optional().or(e.literal("")),
|
|
15
|
+
// fallback since some iconUrls are empty, causing validation to fail
|
|
16
|
+
pricingId: e.number().optional(),
|
|
17
|
+
category: e.string().optional(),
|
|
18
|
+
dappId: e.string().optional(),
|
|
19
|
+
brandColor: e.string().optional()
|
|
20
|
+
}), i = o.extend({
|
|
21
|
+
balance: e.string()
|
|
22
|
+
}), c = o.extend({
|
|
23
|
+
currencyValue: e.string(),
|
|
24
|
+
currencySymbol: e.string().optional(),
|
|
25
|
+
ccyDayChange: e.string().optional(),
|
|
26
|
+
ethDayChange: e.string().optional(),
|
|
27
|
+
unitCurrencyValue: e.string().optional()
|
|
28
|
+
}), s = c.extend({
|
|
29
|
+
...i.shape
|
|
30
|
+
}), h = e.array(s), b = n.extend({
|
|
31
|
+
...a.shape
|
|
32
|
+
}), g = n.extend({
|
|
33
|
+
...t.shape
|
|
34
|
+
});
|
|
35
|
+
export {
|
|
36
|
+
n as webBaseTokenSchema,
|
|
37
|
+
p as webBaseTokenWithBalanceSchema,
|
|
38
|
+
g as webTokenInfoDetailsSchema,
|
|
39
|
+
b as webTokenPriceDetailsSchema,
|
|
40
|
+
o as webTokenSchema,
|
|
41
|
+
s as webTokenWithBalanceAndPriceSchema,
|
|
42
|
+
i as webTokenWithBalanceSchema,
|
|
43
|
+
c as webTokenWithPriceSchema,
|
|
44
|
+
h as webTokensWithBalanceAndPriceSchema
|
|
45
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("starknet"),u=require("zod"),i=require("../bigdecimal/parseUnits.cjs"),r=(e,t=18)=>i.parseUnits(e.replace(",","."),Number(t)),n=u.z.string().trim().refine(e=>e!=="",{message:"Amount is required"}).refine(e=>{try{const t=r(e).value;if(t<0n)throw new Error("Amount must be positive");if(t===0n)throw new Error("Amount can not be zero");if(t>o.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"}),s=e=>!!n.parse(e);exports.inputAmountSchema=n;exports.isValidInputAmount=s;exports.parseAmount=r;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { uint256 as t } from "starknet";
|
|
2
|
+
import { z as n } from "zod";
|
|
3
|
+
import { parseUnits as e } from "../bigdecimal/parseUnits.js";
|
|
4
|
+
const i = (r, o = 18) => e(r.replace(",", "."), Number(o)), m = n.string().trim().refine((r) => r !== "", {
|
|
5
|
+
message: "Amount is required"
|
|
6
|
+
}).refine((r) => {
|
|
7
|
+
try {
|
|
8
|
+
const o = i(r).value;
|
|
9
|
+
if (o < 0n)
|
|
10
|
+
throw new Error("Amount must be positive");
|
|
11
|
+
if (o === 0n)
|
|
12
|
+
throw new Error("Amount can not be zero");
|
|
13
|
+
if (o > t.UINT_256_MAX)
|
|
14
|
+
throw new Error("Amount is too big");
|
|
15
|
+
} catch {
|
|
16
|
+
throw new Error("Amount should be a number");
|
|
17
|
+
}
|
|
18
|
+
return !0;
|
|
19
|
+
}, { message: "Invalid amount" }), p = (r) => !!m.parse(r);
|
|
20
|
+
export {
|
|
21
|
+
m as inputAmountSchema,
|
|
22
|
+
p as isValidInputAmount,
|
|
23
|
+
i as parseAmount
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("starknet"),n=require("../utils/parseAmount.cjs"),l=(a,r,t,e)=>({contractAddress:a,entrypoint:"transfer",calldata:o.CallData.compile({recipient:r,amount:n.getUint256CalldataFromBN(n.parseAmountValue(t,e))})}),s=(a,r,t,e)=>({contractAddress:a,entrypoint:"transferFrom",calldata:o.CallData.compile({from_:r,to:t,tokenId:n.getUint256CalldataFromBN(e)})}),c=(a,r,t,e)=>({contractAddress:a,entrypoint:"safeTransferFrom",calldata:o.CallData.compile({from_:r,to:t,tokenId:n.getUint256CalldataFromBN(e),amount:n.getUint256CalldataFromBN(1),data_len:"0"})});exports.erc20TransferTransaction=l;exports.erc721SafeTransferFromTransaction=c;exports.erc721TransferFromTransaction=s;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { CallData as e } from "starknet";
|
|
2
|
+
import { getUint256CalldataFromBN as n, parseAmountValue as m } from "../utils/parseAmount.js";
|
|
3
|
+
const s = (a, r, t, o) => ({
|
|
4
|
+
contractAddress: a,
|
|
5
|
+
entrypoint: "transfer",
|
|
6
|
+
calldata: e.compile({
|
|
7
|
+
recipient: r,
|
|
8
|
+
amount: n(m(t, o))
|
|
9
|
+
})
|
|
10
|
+
}), f = (a, r, t, o) => ({
|
|
11
|
+
contractAddress: a,
|
|
12
|
+
entrypoint: "transferFrom",
|
|
13
|
+
calldata: e.compile({
|
|
14
|
+
from_: r,
|
|
15
|
+
to: t,
|
|
16
|
+
tokenId: n(o)
|
|
17
|
+
// OZ specs need a uint256 as tokenId
|
|
18
|
+
})
|
|
19
|
+
}), i = (a, r, t, o) => ({
|
|
20
|
+
contractAddress: a,
|
|
21
|
+
entrypoint: "safeTransferFrom",
|
|
22
|
+
calldata: e.compile({
|
|
23
|
+
from_: r,
|
|
24
|
+
to: t,
|
|
25
|
+
tokenId: n(o),
|
|
26
|
+
amount: n(1),
|
|
27
|
+
data_len: "0"
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
s as erc20TransferTransaction,
|
|
32
|
+
i as erc721SafeTransferFromTransaction,
|
|
33
|
+
f as erc721TransferFromTransaction
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("zod"),t=r.z.object({data:r.z.object({code:r.z.string().optional(),name:r.z.string().optional(),message:r.z.string()})}),s=o=>{const e=t.safeParse(o);if(e.success)return e.data.data.message};exports.getMessageFromTrpcError=s;exports.trpcErrorSchema=t;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { z as r } from "zod";
|
|
2
|
+
const o = r.object({
|
|
3
|
+
data: r.object({
|
|
4
|
+
code: r.string().optional(),
|
|
5
|
+
// "STARKNAME_NOT_FOUND",
|
|
6
|
+
name: r.string().optional(),
|
|
7
|
+
// "AddressError"
|
|
8
|
+
message: r.string()
|
|
9
|
+
// "foo.stark not found"
|
|
10
|
+
})
|
|
11
|
+
}), a = (e) => {
|
|
12
|
+
const t = o.safeParse(e);
|
|
13
|
+
if (t.success)
|
|
14
|
+
return t.data.data.message;
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
a as getMessageFromTrpcError,
|
|
18
|
+
o as trpcErrorSchema
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("starknet"),g=3,o=process.env.FEE_OVERHEAD?parseFloat(process.env.FEE_OVERHEAD):g,F=1.5,e=10,a=({estimatedFee:t,overheadMultiplier:n=o})=>{const i=s.num.toBigInt(t)*BigInt(n*e)/BigInt(e);return s.num.toHex(i)},c=({suggestedMaxFee:t,overheadMultiplier:n=o,starknetJsOverheadMultiplier:E=F})=>{const r=s.num.toBigInt(t)*BigInt(e)/BigInt(E*e);return a({estimatedFee:r,overheadMultiplier:n})};exports.FEE_OVERHEAD=o;exports.argentMaxFee=a;exports.modifySnjsFeeOverhead=c;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { num as s } from "starknet";
|
|
2
|
+
const F = 3, i = process.env.FEE_OVERHEAD ? parseFloat(process.env.FEE_OVERHEAD) : F, a = 1.5, e = 10, c = ({ estimatedFee: t, overheadMultiplier: n = i }) => {
|
|
3
|
+
const E = s.toBigInt(t) * BigInt(n * e) / BigInt(e);
|
|
4
|
+
return s.toHex(E);
|
|
5
|
+
}, I = ({ suggestedMaxFee: t, overheadMultiplier: n = i, starknetJsOverheadMultiplier: o = a }) => {
|
|
6
|
+
const g = s.toBigInt(t) * BigInt(e) / BigInt(o * e);
|
|
7
|
+
return c({ estimatedFee: g, overheadMultiplier: n });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as FEE_OVERHEAD,
|
|
11
|
+
c as argentMaxFee,
|
|
12
|
+
I as modifySnjsFeeOverhead
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../errors/baseErrors.cjs");exports.ESTIMATE_ERROR_MESSAGES=void 0;(function(E){E.SIMULATE_AND_REVIEW_FAILED="Missing simulation"})(exports.ESTIMATE_ERROR_MESSAGES||(exports.ESTIMATE_ERROR_MESSAGES={}));class S extends t.BaseError{constructor(r){super(r,exports.ESTIMATE_ERROR_MESSAGES),this.name="EstimateError"}}exports.EstimateError=S;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseError as t } from "../../errors/baseErrors.js";
|
|
2
|
+
var r;
|
|
3
|
+
(function(E) {
|
|
4
|
+
E.SIMULATE_AND_REVIEW_FAILED = "Missing simulation";
|
|
5
|
+
})(r || (r = {}));
|
|
6
|
+
class i extends t {
|
|
7
|
+
constructor(s) {
|
|
8
|
+
super(s, r), this.name = "EstimateError";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
r as ESTIMATE_ERROR_MESSAGES,
|
|
13
|
+
i as EstimateError
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("zod"),e=require("../../utils/starknet/starknet.cjs"),t=require("../../utils/hex.cjs"),r=a.z.object({type:a.z.enum(["DECLARE","DEPLOY","DEPLOY_ACCOUNT","INVOKE"]).default("INVOKE"),calls:a.z.array(e.callSchema).or(e.callSchema).optional(),calldata:a.z.array(a.z.string()).optional(),classHash:t.hexSchema.optional(),salt:t.hexSchema.optional(),signature:a.z.array(a.z.string()).optional()});exports.transactionReviewTransactionsSchema=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { z as a } from "zod";
|
|
2
|
+
import { callSchema as o } from "../../utils/starknet/starknet.js";
|
|
3
|
+
import { hexSchema as t } from "../../utils/hex.js";
|
|
4
|
+
const n = a.object({
|
|
5
|
+
type: a.enum(["DECLARE", "DEPLOY", "DEPLOY_ACCOUNT", "INVOKE"]).default("INVOKE"),
|
|
6
|
+
calls: a.array(o).or(o).optional(),
|
|
7
|
+
calldata: a.array(a.string()).optional(),
|
|
8
|
+
classHash: t.optional(),
|
|
9
|
+
salt: t.optional(),
|
|
10
|
+
signature: a.array(a.string()).optional()
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
n as transactionReviewTransactionsSchema
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("lodash-es"),r=require("starknet"),E=require("../../chains/starknet/address.cjs"),x=require("../../chains/starknet/constants.cjs"),h=require("./argentMaxFee.cjs"),M=require("./error.cjs"),S=require("../../utils/starknet/starknet.cjs"),F=require("../../features/simulation/transactionReview/schema.cjs"),k=require("../../utils/arrays.cjs");function P(e){return y.upperCase(e.unit)==="WEI"}function A(e){return y.upperCase(e.unit)==="FRI"}function c(e,n){return P(e)?{...e,maxFee:n(e.maxFee),overallFee:n(e.overallFee),gasPrice:n(e.gasPrice),gasUsage:n(e.gasUsage)}:{...e,overallFee:n(e.overallFee),gasPrice:n(e.gasPrice),gasUsage:n(e.gasUsage),maxAmount:n(e.maxAmount),maxPricePerUnit:n(e.maxPricePerUnit)}}function d(e){return P(e)?{maxFee:e.maxFee}:{amount:e.maxAmount,pricePerUnit:e.maxPricePerUnit}}function p(e){return A({unit:e})?x.STRK_TOKEN_ADDRESS:x.ETH_TOKEN_ADDRESS}function _(e,n,t=2){const a=BigInt(10**t),s=BigInt(Math.round(n*10**t));return e*s/a}const N=[x.STRK_TOKEN_ADDRESS],G=(e,n=C)=>{if(e.max&&"amount"in e.max)return{...e,...e.max};const t=10000n,{amount:a,pricePerUnit:s,dataGasConsumed:o=0n,dataGasPrice:m=0n}=e,u=a*s+o*m;if(u<0)throw Error("Cannot calculate max fee for negative fee");const i=r.num.toBigInt(h.argentMaxFee({estimatedFee:u})),f=Number(i)/Number(u),U=n(f),g=BigInt(Math.trunc(U*Number(t)));return{...e,amount:a*g/t,pricePerUnit:s*g/t,dataGasConsumed:o*g/t,dataGasPrice:m*g/t}},l=e=>{const{amount:n,pricePerUnit:t,dataGasConsumed:a=0n,dataGasPrice:s=0n}=e;return n*t+a*s},I=e=>{if(e.max)return"maxFee"in e.max?e.max.maxFee:l(e.max)},T=e=>{const n=I(e);return n||l(G(e))},R=e=>{if(e.deployment&&!E.isEqualAddress(e.deployment.feeTokenAddress,e.transactions.feeTokenAddress))throw Error("Cannot calculate estimated fees for different tokens");const n=l(e.transactions),t=e.deployment?l(e.deployment):0n;return n+t},q=e=>{if(e.deployment&&!E.isEqualAddress(e.deployment.feeTokenAddress,e.transactions.feeTokenAddress))throw Error("Cannot calculate estimated fees for different tokens");const n=e.deployment?T(e.deployment):0n,t=T(e.transactions);return n+t},D=(e,n)=>[{contractAddress:e,entrypoint:"transfer",calldata:r.CallData.compile(S.transferCalldataSchema.parse({recipient:n,amount:r.uint256.bnToUint256(BigInt(1))}))}],B=(e,n)=>{if(!e)return{transactions:{feeTokenAddress:n??x.ETH_TOKEN_ADDRESS,amount:0n,pricePerUnit:0n,dataGasConsumed:0n,dataGasPrice:0n}};if(!Array.isArray(e))throw Error(`Unexpected simulation response. Expected array. Got ${typeof e}`);if(e.length===1){const t=F.feeEstimationSchema.parse(e[0].feeEstimation);return{transactions:{feeTokenAddress:p(t.unit),amount:r.num.toBigInt(t.gasUsage),pricePerUnit:r.num.toBigInt(t.gasPrice),max:d(c(t,r.num.toBigInt)),dataGasConsumed:t.dataGasConsumed?r.num.toBigInt(t.dataGasConsumed):0n,dataGasPrice:t.dataGasPrice?r.num.toBigInt(t.dataGasPrice):0n}}}if(e.length===2){const t=F.feeEstimationSchema.parse(e[0].feeEstimation),a=F.feeEstimationSchema.parse(e[1].feeEstimation);return{deployment:{feeTokenAddress:p(t.unit),amount:r.num.toBigInt(t.gasUsage),pricePerUnit:r.num.toBigInt(t.gasPrice),max:d(c(t,r.num.toBigInt)),dataGasConsumed:t.dataGasConsumed?r.num.toBigInt(t.dataGasConsumed):0n,dataGasPrice:t.dataGasPrice?r.num.toBigInt(t.dataGasPrice):0n},transactions:{feeTokenAddress:p(a.unit),amount:r.num.toBigInt(a.gasUsage),pricePerUnit:r.num.toBigInt(a.gasPrice),max:d(c(a,r.num.toBigInt)),dataGasConsumed:a.dataGasConsumed?r.num.toBigInt(a.dataGasConsumed):0n,dataGasPrice:a.dataGasPrice?r.num.toBigInt(a.dataGasPrice):0n}}}throw Error("Unexpected simulation response length")},b=({transaction:e,nonce:n,chainId:t,version:a,isDeploymentTransaction:s,cairoVersion:o,address:m,appDomain:u})=>{let i=n;s&&e.type!=="DEPLOY_ACCOUNT"&&(i=r.num.toHex(1));const f=k.ensureArray(e.calls);return{type:e.type,chainId:t,cairoVersion:o,nonce:i,version:a,account:m,calls:f,calldata:e.calldata,salt:e.salt,signature:e.signature,classHash:e.classHash,appDomain:u}},j=(e,n)=>{const{transactions:t}=e,a=t.map(i=>{if(!i.simulation)throw new M.EstimateError({code:"SIMULATE_AND_REVIEW_FAILED"});return i}),s=a.map(i=>({...i.simulation,feeEstimation:c(i.simulation.feeEstimation,Number)})),o=B(s,n),[m,u]=a.length===1?[a[0],void 0]:[a[1],a[0]];return{...o,transactions:{...o.transactions,dataGasConsumed:o.transactions.dataGasConsumed??0n,dataGasPrice:o.transactions.dataGasPrice??0n,max:d(c(m.simulation.feeEstimation,r.num.toBigInt))},deployment:o.deployment&&u?{...o.deployment,dataGasConsumed:o.deployment.dataGasConsumed??0n,dataGasPrice:o.deployment.dataGasPrice??0n,max:d(c(u.simulation.feeEstimation,r.num.toBigInt))}:void 0}},w=e=>{const n=G(e),t=T(e);return{maxFee:t,resourceBounds:{l1_gas:{max_amount:r.num.toHex(t/e.pricePerUnit),max_price_per_unit:r.num.toHex(n.pricePerUnit)},l2_gas:{max_amount:"0x0",max_price_per_unit:"0x0"}}}},O=e=>{const n=Math.sqrt(e);return isNaN(n)?Math.sqrt(2):n},C=e=>{const n=Math.cbrt(e);return isNaN(n)?Math.cbrt(2):n},W=e=>e<1||isNaN(e)?1.1:Math.log(e+1)+1;exports.buildDummyTx=D;exports.calculateCubeRootAdjustment=C;exports.calculateNonLinearAdjustment=W;exports.calculateSqrtAdjustment=O;exports.castFeeEstimation=c;exports.estimatedFeeToMaxFeeTotal=T;exports.estimatedFeeToMaxResourceBounds=w;exports.estimatedFeeToTotal=l;exports.estimatedFeesToMaxFeeTotal=q;exports.estimatedFeesToTotal=R;exports.getEstimatedFeeFromBulkSimulation=B;exports.getEstimatedFeeFromSimulationAndRespectWatermarkFee=j;exports.getPayloadFromTransaction=b;exports.getWatermarkedMaxFeeTotal=I;exports.isFRI=A;exports.isWEI=P;exports.multiplyBigIntByFloat=_;exports.toMax=d;exports.tokensRequireTxV3Support=N;exports.unitToFeeTokenAddress=p;
|