@argent/x-shared 1.79.0 → 1.79.2
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/.ts-temp/tsconfig.tsbuildinfo +1 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -0
- package/dist/_virtual/_rolldown/runtime.js +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +112 -488
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js +11 -11
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js +62 -85
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.js +153 -190
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/poseidon.js +56 -65
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/utils.js +125 -151
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/weierstrass.js +470 -575
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/_assert.js +26 -40
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/crypto.js +4 -4
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js +38 -42
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js +28 -42
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_assert.js +17 -26
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_sha2.js +52 -59
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/_u64.js +20 -19
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha256.js +118 -113
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/sha3.js +95 -105
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@1.3.3/node_modules/@noble/hashes/esm/utils.js +26 -32
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_md.js +71 -82
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/_u64.js +20 -20
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha2.js +125 -124
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/sha3.js +102 -116
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.cjs +1 -1
- package/dist/node_modules/.pnpm/@noble_hashes@2.0.0/node_modules/@noble/hashes/utils.js +62 -76
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.cjs +1 -1
- package/dist/node_modules/.pnpm/bignumber.js@9.1.2/node_modules/bignumber.js/bignumber.js +519 -614
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Hash.js +15 -19
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_ListCache.js +15 -19
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Map.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_MapCache.js +15 -19
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Set.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_SetCache.js +10 -12
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_Symbol.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludes.js +6 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_arrayIncludesWith.js +6 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_assocIndexOf.js +7 -9
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseFindIndex.js +6 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseGetTag.js +9 -9
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIndexOf.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNaN.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseIsNative.js +10 -15
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_baseUniq.js +26 -32
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_cacheHas.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_coreJsData.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_createSet.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_freeGlobal.js +4 -4
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getMapData.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getNative.js +8 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getRawTag.js +12 -13
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_getValue.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashClear.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashDelete.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashGet.js +11 -11
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashHas.js +8 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_hashSet.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isKeyable.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_isMasked.js +9 -9
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheClear.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheDelete.js +8 -11
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheGet.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheHas.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_listCacheSet.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheClear.js +11 -11
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheDelete.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheGet.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheHas.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_mapCacheSet.js +7 -7
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_nativeCreate.js +4 -4
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_objectToString.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_root.js +4 -4
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheAdd.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setCacheHas.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_setToArray.js +8 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_strictIndexOf.js +6 -8
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/_toSource.js +14 -16
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/eq.js +5 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isFunction.js +10 -11
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/isObject.js +6 -6
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/noop.js +4 -5
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.cjs +1 -1
- package/dist/node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/uniqWith.js +6 -6
- package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.cjs +1 -1
- package/dist/node_modules/.pnpm/micro-starknet@0.2.3/node_modules/micro-starknet/lib/esm/index.js +121 -118
- package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.cjs +1 -1
- package/dist/node_modules/.pnpm/numeral@2.0.6/node_modules/numeral/numeral.js +377 -417
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.cjs +1 -1
- package/dist/node_modules/.pnpm/semver@6.3.1/node_modules/semver/semver.js +546 -635
- package/dist/paymaster.cjs +1 -1
- package/dist/paymaster.js +2 -11
- package/dist/simulation.cjs +1 -1
- package/dist/simulation.js +22 -90
- package/dist/src/account/account.model.cjs +1 -1
- package/dist/src/account/account.model.js +58 -52
- package/dist/src/account/accountv4.cjs +1 -1
- package/dist/src/account/accountv4.js +9 -11
- package/dist/src/account/preferences.model.cjs +1 -1
- package/dist/src/account/preferences.model.js +12 -10
- package/dist/src/accountNameGenerator/colors.cjs +1 -1
- package/dist/src/accountNameGenerator/colors.js +24 -24
- package/dist/src/accountNameGenerator/index.cjs +1 -1
- package/dist/src/accountNameGenerator/index.js +23 -23
- package/dist/src/accountNameGenerator/x-names.json.cjs +1 -1
- package/dist/src/accountNameGenerator/x-names.json.js +1922 -7
- package/dist/src/assets/tokens.json.cjs +1 -1
- package/dist/src/assets/tokens.json.js +180 -180
- package/dist/src/backend/schema.cjs +1 -1
- package/dist/src/backend/schema.js +9 -12
- package/dist/src/backend/sessionKeys/schema.cjs +1 -1
- package/dist/src/backend/sessionKeys/schema.js +27 -30
- package/dist/src/bigdecimal/constants.cjs +1 -1
- package/dist/src/bigdecimal/constants.js +6 -3
- package/dist/src/bigdecimal/createUnitsSchema.cjs +1 -1
- package/dist/src/bigdecimal/createUnitsSchema.js +7 -7
- package/dist/src/bigdecimal/formatUnits.cjs +1 -1
- package/dist/src/bigdecimal/formatUnits.js +9 -10
- package/dist/src/bigdecimal/index.cjs +1 -1
- package/dist/src/bigdecimal/index.js +45 -41
- package/dist/src/bigdecimal/lib.cjs +1 -1
- package/dist/src/bigdecimal/lib.js +105 -117
- package/dist/src/bigdecimal/parseUnits.cjs +1 -1
- package/dist/src/bigdecimal/parseUnits.js +18 -21
- package/dist/src/bigdecimal/utils.cjs +1 -1
- package/dist/src/bigdecimal/utils.js +33 -30
- package/dist/src/cache/CacheService.cjs +1 -1
- package/dist/src/cache/CacheService.js +32 -36
- package/dist/src/chains/starknet/address.cjs +1 -1
- package/dist/src/chains/starknet/address.js +73 -117
- package/dist/src/chains/starknet/addressDomain.cjs +1 -1
- package/dist/src/chains/starknet/addressDomain.js +14 -29
- package/dist/src/chains/starknet/addressInput.cjs +1 -1
- package/dist/src/chains/starknet/addressInput.js +6 -7
- package/dist/src/chains/starknet/argentName.cjs +1 -1
- package/dist/src/chains/starknet/argentName.js +10 -14
- package/dist/src/chains/starknet/cairoVersionSchema.cjs +1 -1
- package/dist/src/chains/starknet/cairoVersionSchema.js +5 -5
- package/dist/src/chains/starknet/constants.cjs +1 -1
- package/dist/src/chains/starknet/constants.js +4 -10
- package/dist/src/chains/starknet/getAddressFromArgentName.cjs +1 -1
- package/dist/src/chains/starknet/getAddressFromArgentName.js +38 -46
- package/dist/src/chains/starknet/getAddressFromStarkName.cjs +1 -1
- package/dist/src/chains/starknet/getAddressFromStarkName.js +59 -66
- package/dist/src/chains/starknet/network.cjs +1 -1
- package/dist/src/chains/starknet/network.js +20 -26
- package/dist/src/chains/starknet/services/address/StarknetAddressService.cjs +1 -1
- package/dist/src/chains/starknet/services/address/StarknetAddressService.js +31 -36
- package/dist/src/chains/starknet/services/deploymentData/constants.cjs +1 -1
- package/dist/src/chains/starknet/services/deploymentData/constants.js +14 -21
- package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.cjs +1 -1
- package/dist/src/chains/starknet/services/deploymentData/deploymentData.schema.js +15 -17
- package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.cjs +1 -1
- package/dist/src/chains/starknet/services/deploymentData/findImplementationForAccount.js +61 -65
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.cjs +1 -1
- package/dist/src/chains/starknet/services/deploymentData/getAccountClassHash.js +46 -65
- package/dist/src/chains/starknet/starknetId.cjs +1 -1
- package/dist/src/chains/starknet/starknetId.js +10 -14
- package/dist/src/currencyFetchService/CurrencyFetchService.cjs +1 -1
- package/dist/src/currencyFetchService/CurrencyFetchService.js +13 -18
- package/dist/src/currencyFetchService/types.ts.cjs +1 -1
- package/dist/src/currencyFetchService/types.ts.js +9 -12
- package/dist/src/errors/account.cjs +1 -1
- package/dist/src/errors/account.js +12 -13
- package/dist/src/errors/address.cjs +1 -1
- package/dist/src/errors/address.js +11 -12
- package/dist/src/errors/baseErrors.cjs +1 -1
- package/dist/src/errors/baseErrors.js +14 -14
- package/dist/src/errors/call.cjs +1 -1
- package/dist/src/errors/call.js +12 -13
- package/dist/src/errors/network.cjs +1 -1
- package/dist/src/errors/network.js +11 -12
- package/dist/src/errors/review.cjs +1 -1
- package/dist/src/errors/review.js +11 -12
- package/dist/src/errors/swap.cjs +1 -1
- package/dist/src/errors/swap.js +12 -13
- package/dist/src/features/paymaster/PaymasterService.cjs +1 -1
- package/dist/src/features/paymaster/PaymasterService.js +73 -87
- package/dist/src/features/paymaster/types.cjs +1 -1
- package/dist/src/features/paymaster/types.js +41 -51
- package/dist/src/features/simulation/activity/normalize.cjs +1 -1
- package/dist/src/features/simulation/activity/normalize.js +36 -38
- package/dist/src/features/simulation/activity/schema.cjs +1 -1
- package/dist/src/features/simulation/activity/schema.js +224 -250
- package/dist/src/features/simulation/activity/utils/createNativeActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/createNativeActivity.js +23 -27
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/getAnyActivityTitle.js +14 -21
- package/dist/src/features/simulation/activity/utils/getOverallLastModified.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/getOverallLastModified.js +5 -5
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/hasDelegationActivity.js +4 -4
- package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isAddMultisigSignersActivity.js +15 -19
- package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isChangeMultisigThresholdActivity.js +15 -19
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isMulticallWithDeploymentActivity.js +5 -5
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isRejectOnChainActivity.js +19 -21
- package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isRemoveMultisigSignersActivity.js +15 -19
- package/dist/src/features/simulation/activity/utils/isSwapActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isSwapActivity.js +17 -18
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/isUpgradeActivity.js +15 -19
- package/dist/src/features/simulation/activity/utils/parseAccountActivities.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/parseAccountActivities.js +12 -12
- package/dist/src/features/simulation/activity/utils/parseFinanceActivities.cjs +1 -1
- package/dist/src/features/simulation/activity/utils/parseFinanceActivities.js +32 -32
- package/dist/src/features/simulation/fees/schema.cjs +1 -1
- package/dist/src/features/simulation/fees/schema.js +33 -47
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/getErrorMessageAndLabelFromSimulation.js +15 -17
- package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/getMessageFromSimulationError.js +5 -5
- package/dist/src/features/simulation/transactionReview/schema.cjs +1 -1
- package/dist/src/features/simulation/transactionReview/schema.js +221 -242
- package/dist/src/features/simulation/warning/helper.cjs +1 -1
- package/dist/src/features/simulation/warning/helper.js +12 -11
- package/dist/src/features/simulation/warning/schema.cjs +1 -1
- package/dist/src/features/simulation/warning/schema.js +10 -11
- package/dist/src/features/swap/models/order.model.cjs +1 -1
- package/dist/src/features/swap/models/order.model.js +16 -19
- package/dist/src/features/swap/models/quote.model.cjs +1 -1
- package/dist/src/features/swap/models/quote.model.js +31 -35
- package/dist/src/features/swap/models/trade.model.cjs +1 -1
- package/dist/src/features/swap/models/trade.model.js +25 -27
- package/dist/src/features/swap/services/SwapSharedService.cjs +1 -1
- package/dist/src/features/swap/services/SwapSharedService.js +71 -75
- package/dist/src/features/swap/services/SwapTransactionService.cjs +1 -1
- package/dist/src/features/swap/services/SwapTransactionService.js +57 -63
- package/dist/src/features/swap/utils/slippage.cjs +1 -1
- package/dist/src/features/swap/utils/slippage.js +18 -25
- package/dist/src/features/swap/utils/totalFee.cjs +1 -1
- package/dist/src/features/swap/utils/totalFee.js +12 -12
- package/dist/src/http/DateService.cjs +1 -1
- package/dist/src/http/DateService.js +15 -18
- package/dist/src/http/HttpError.cjs +1 -1
- package/dist/src/http/HttpError.js +7 -7
- package/dist/src/http/HttpService.cjs +1 -1
- package/dist/src/http/HttpService.js +117 -134
- package/dist/src/http/IHttpService.cjs +1 -1
- package/dist/src/http/IHttpService.js +6 -6
- package/dist/src/http/SWRService.cjs +1 -1
- package/dist/src/http/SWRService.js +50 -57
- package/dist/src/http/fetcher.cjs +1 -1
- package/dist/src/http/fetcher.js +29 -35
- package/dist/src/http/time.cjs +1 -1
- package/dist/src/http/time.js +15 -18
- package/dist/src/knownDapps/KnownDappsBackendService.cjs +1 -1
- package/dist/src/knownDapps/KnownDappsBackendService.js +13 -14
- package/dist/src/knownDapps/schema.cjs +1 -1
- package/dist/src/knownDapps/schema.js +41 -44
- package/dist/src/knownDapps/utils/getDapplandUrl.cjs +1 -1
- package/dist/src/knownDapps/utils/getDapplandUrl.js +7 -8
- package/dist/src/nameResolution/ResolveNameService.cjs +1 -1
- package/dist/src/nameResolution/ResolveNameService.js +34 -41
- package/dist/src/nameResolution/schema.cjs +1 -1
- package/dist/src/nameResolution/schema.js +20 -25
- package/dist/src/nfts/BackendNftService.cjs +1 -1
- package/dist/src/nfts/BackendNftService.js +103 -116
- package/dist/src/nfts/BackendPaginationError.cjs +1 -1
- package/dist/src/nfts/BackendPaginationError.js +11 -12
- package/dist/src/nfts/utils.cjs +1 -1
- package/dist/src/nfts/utils.js +11 -14
- package/dist/src/onchainRecovery/OnchainRecoveryService.cjs +1 -1
- package/dist/src/onchainRecovery/OnchainRecoveryService.js +38 -68
- package/dist/src/onchainRecovery/schema.cjs +1 -1
- package/dist/src/onchainRecovery/schema.js +35 -49
- package/dist/src/platform/isBraveBrowser.cjs +1 -1
- package/dist/src/platform/isBraveBrowser.js +8 -10
- package/dist/src/platform/isBrowser.cjs +1 -1
- package/dist/src/platform/isBrowser.js +17 -22
- package/dist/src/signer/mergeOwnerGuardianSignatures.cjs +1 -1
- package/dist/src/signer/mergeOwnerGuardianSignatures.js +28 -30
- package/dist/src/signer/multisigner.cjs +1 -1
- package/dist/src/signer/multisigner.js +16 -17
- package/dist/src/signer/seedphrase.cjs +1 -1
- package/dist/src/signer/seedphrase.js +7 -7
- package/dist/src/staking/schema.cjs +1 -1
- package/dist/src/staking/schema.js +146 -162
- package/dist/src/storage/base.cjs +1 -1
- package/dist/src/storage/base.js +33 -34
- package/dist/src/storage/utils.cjs +1 -1
- package/dist/src/storage/utils.js +19 -28
- package/dist/src/tokens/balances.cjs +1 -1
- package/dist/src/tokens/balances.js +34 -38
- package/dist/src/tokens/constants.cjs +1 -1
- package/dist/src/tokens/constants.js +4 -4
- package/dist/src/tokens/convertCurrencyValueToTokenAmount.cjs +1 -1
- package/dist/src/tokens/convertCurrencyValueToTokenAmount.js +8 -9
- package/dist/src/tokens/convertTokenAmountToCurrencyValue.cjs +1 -1
- package/dist/src/tokens/convertTokenAmountToCurrencyValue.js +14 -15
- package/dist/src/tokens/convertTokenUnitAmountWithDecimals.cjs +1 -1
- package/dist/src/tokens/convertTokenUnitAmountWithDecimals.js +8 -9
- package/dist/src/tokens/ensureDecimals.cjs +1 -1
- package/dist/src/tokens/ensureDecimals.js +4 -4
- package/dist/src/tokens/getCurrencySymbol.cjs +1 -1
- package/dist/src/tokens/getCurrencySymbol.js +14 -14
- package/dist/src/tokens/isUnlimitedAmount.cjs +1 -1
- package/dist/src/tokens/isUnlimitedAmount.js +5 -5
- package/dist/src/tokens/prettifyCurrencyValue.cjs +1 -1
- package/dist/src/tokens/prettifyCurrencyValue.js +13 -14
- package/dist/src/tokens/prettifyTokenAmount.cjs +1 -1
- package/dist/src/tokens/prettifyTokenAmount.js +22 -22
- package/dist/src/tokens/service/implementation.cjs +1 -1
- package/dist/src/tokens/service/implementation.js +28 -40
- package/dist/src/tokens/service/tokenError.cjs +1 -1
- package/dist/src/tokens/service/tokenError.js +11 -12
- package/dist/src/tokens/service/types/backend.model.cjs +1 -1
- package/dist/src/tokens/service/types/backend.model.js +128 -163
- package/dist/src/tokens/service/types/defiPosition.model.cjs +1 -1
- package/dist/src/tokens/service/types/defiPosition.model.js +83 -99
- package/dist/src/tokens/service/types/defiPositionType.model.cjs +1 -1
- package/dist/src/tokens/service/types/defiPositionType.model.js +9 -9
- package/dist/src/tokens/service/types/unclaimedRewards.model.cjs +1 -1
- package/dist/src/tokens/service/types/unclaimedRewards.model.js +15 -16
- package/dist/src/tokens/service/types/webToken.model.cjs +1 -1
- package/dist/src/tokens/service/types/webToken.model.js +28 -51
- package/dist/src/tokens/utils.cjs +1 -1
- package/dist/src/tokens/utils.js +5 -9
- package/dist/src/transactions/amount.cjs +1 -1
- package/dist/src/transactions/amount.js +17 -24
- package/dist/src/transactions/buildTransactions.cjs +1 -1
- package/dist/src/transactions/buildTransactions.js +30 -33
- package/dist/src/transactions/errors.cjs +1 -1
- package/dist/src/transactions/errors.js +11 -18
- package/dist/src/transactions/estimate/adjustment.cjs +1 -1
- package/dist/src/transactions/estimate/adjustment.js +6 -6
- package/dist/src/transactions/estimate/argentMaxFee.cjs +1 -1
- package/dist/src/transactions/estimate/argentMaxFee.js +10 -13
- package/dist/src/transactions/estimate/error.cjs +1 -1
- package/dist/src/transactions/estimate/error.js +12 -13
- package/dist/src/transactions/estimate/model.cjs +1 -1
- package/dist/src/transactions/estimate/model.js +18 -13
- package/dist/src/transactions/estimate/utils.cjs +1 -1
- package/dist/src/transactions/estimate/utils.js +139 -172
- package/dist/src/transactions/findTransfersAndApprovals.cjs +1 -1
- package/dist/src/transactions/findTransfersAndApprovals.js +34 -30
- package/dist/src/transactions/getPrettyRcpError.cjs +1 -1
- package/dist/src/transactions/getPrettyRcpError.js +8 -10
- package/dist/src/transactions/service/implementation.cjs +1 -1
- package/dist/src/transactions/service/implementation.js +187 -208
- package/dist/src/transactions/service/types.cjs +1 -1
- package/dist/src/transactions/service/types.js +9 -9
- package/dist/src/transactions/service/utils.cjs +1 -1
- package/dist/src/transactions/service/utils.js +24 -25
- package/dist/src/transactions/transactionExecuteTypes.cjs +1 -1
- package/dist/src/transactions/transactionExecuteTypes.js +8 -9
- package/dist/src/transactions/transactionReviewTypes.cjs +1 -1
- package/dist/src/transactions/transactionReviewTypes.js +9 -9
- package/dist/src/transactions/transactionVersion.cjs +1 -1
- package/dist/src/transactions/transactionVersion.js +8 -13
- package/dist/src/transactions/txv3.cjs +1 -1
- package/dist/src/transactions/txv3.js +10 -11
- package/dist/src/utils/address.cjs +1 -1
- package/dist/src/utils/address.js +4 -4
- package/dist/src/utils/arrays.cjs +1 -1
- package/dist/src/utils/arrays.js +4 -4
- package/dist/src/utils/avatarImage.cjs +4 -4
- package/dist/src/utils/avatarImage.js +35 -40
- package/dist/src/utils/base58.cjs +1 -1
- package/dist/src/utils/base58.js +12 -15
- package/dist/src/utils/bigNumber.cjs +1 -1
- package/dist/src/utils/bigNumber.d.ts +1 -1
- package/dist/src/utils/bigNumber.js +5 -7
- package/dist/src/utils/bips.cjs +1 -1
- package/dist/src/utils/bips.js +12 -10
- package/dist/src/utils/daysBetween.cjs +1 -1
- package/dist/src/utils/daysBetween.js +6 -6
- package/dist/src/utils/env.cjs +1 -1
- package/dist/src/utils/env.js +4 -4
- package/dist/src/utils/hex.cjs +1 -1
- package/dist/src/utils/hex.js +7 -8
- package/dist/src/utils/id.cjs +1 -1
- package/dist/src/utils/id.js +7 -7
- package/dist/src/utils/initials.cjs +1 -1
- package/dist/src/utils/initials.js +12 -15
- package/dist/src/utils/isContractDeployed.cjs +1 -1
- package/dist/src/utils/isContractDeployed.js +9 -9
- package/dist/src/utils/nonNullable.cjs +1 -1
- package/dist/src/utils/nonNullable.js +6 -6
- package/dist/src/utils/number/abbreviateNumber.cjs +1 -1
- package/dist/src/utils/number/abbreviateNumber.js +13 -14
- package/dist/src/utils/number/isAllowedAddressHexInputValue.cjs +1 -1
- package/dist/src/utils/number/isAllowedAddressHexInputValue.js +4 -7
- package/dist/src/utils/number/isAllowedNumericInputValue.cjs +1 -1
- package/dist/src/utils/number/isAllowedNumericInputValue.js +5 -5
- package/dist/src/utils/number/isNumeric.cjs +1 -1
- package/dist/src/utils/number/isNumeric.js +4 -4
- package/dist/src/utils/number/prettifyNumber.cjs +1 -1
- package/dist/src/utils/number/prettifyNumber.js +65 -75
- package/dist/src/utils/parseAmount.cjs +1 -1
- package/dist/src/utils/parseAmount.js +10 -11
- package/dist/src/utils/pluralise.cjs +1 -1
- package/dist/src/utils/pluralise.js +4 -4
- package/dist/src/utils/readFileAsString.cjs +1 -1
- package/dist/src/utils/readFileAsString.js +6 -6
- package/dist/src/utils/retryUntilInitialised.cjs +1 -1
- package/dist/src/utils/retryUntilInitialised.js +21 -20
- package/dist/src/utils/schemas.cjs +1 -1
- package/dist/src/utils/schemas.js +29 -26
- package/dist/src/utils/starknet/starknet.cjs +1 -1
- package/dist/src/utils/starknet/starknet.js +64 -77
- package/dist/src/utils/starknet/starknetLibTypes.cjs +1 -1
- package/dist/src/utils/starknet/starknetLibTypes.js +7 -7
- package/dist/src/utils/starknet/starknetSchemas.cjs +1 -1
- package/dist/src/utils/starknet/starknetSchemas.js +84 -99
- package/dist/src/utils/transactions.cjs +1 -1
- package/dist/src/utils/transactions.js +10 -10
- package/dist/src/utils/url/urlWithQuery.cjs +1 -1
- package/dist/src/utils/url/urlWithQuery.js +8 -8
- package/dist/src/utils/voidify.cjs +1 -1
- package/dist/src/utils/voidify.js +7 -7
- package/dist/swap.cjs +1 -1
- package/dist/swap.js +8 -22
- package/package.json +20 -19
- package/dist/.eslintrc.d.cts +0 -39
- package/dist/_virtual/_commonjsHelpers.cjs +0 -1
- package/dist/_virtual/_commonjsHelpers.js +0 -6
- package/dist/_virtual/numeral.cjs +0 -1
- package/dist/_virtual/numeral.js +0 -7
- package/dist/_virtual/numeral2.cjs +0 -1
- package/dist/_virtual/numeral2.js +0 -4
- package/dist/_virtual/semver.cjs +0 -1
- package/dist/_virtual/semver.js +0 -7
- package/dist/_virtual/semver2.cjs +0 -1
- package/dist/_virtual/semver2.js +0 -4
|
@@ -1,118 +1,74 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, D = (e) => {
|
|
73
|
-
try {
|
|
74
|
-
return L.toBigInt(n.parse(e)) === w.ZERO;
|
|
75
|
-
} catch {
|
|
76
|
-
}
|
|
77
|
-
return !1;
|
|
78
|
-
}, G = (e, s) => !!s?.some((r) => z(r, e)), J = m((e) => {
|
|
79
|
-
const s = e.slice(0, 6), r = e.slice(-4);
|
|
80
|
-
return `${s}…${r}`;
|
|
81
|
-
}), K = m((e, s) => {
|
|
82
|
-
if (e.length < s)
|
|
83
|
-
return e;
|
|
84
|
-
const r = Math.floor((s - 1) / 2), t = e.slice(0, r), d = e.slice(-r);
|
|
85
|
-
return `${t}…${d}`;
|
|
1
|
+
import { decodeBase58 as e } from "../../utils/base58.js";
|
|
2
|
+
import { z as t } from "zod";
|
|
3
|
+
import { memoize as n } from "lodash-es";
|
|
4
|
+
import { constants as r, getChecksumAddress as i, num as a, validateAndParseAddress as o, validateChecksumAddress as s } from "starknet";
|
|
5
|
+
//#region src/chains/starknet/address.ts
|
|
6
|
+
var c = t.string().refine((e) => {
|
|
7
|
+
if (e.toLowerCase() === e) return !0;
|
|
8
|
+
try {
|
|
9
|
+
return s(e) && j(e);
|
|
10
|
+
} catch {}
|
|
11
|
+
return !1;
|
|
12
|
+
}, { message: "Invalid address (checksum error)" }), l = t.string().refine((e) => {
|
|
13
|
+
try {
|
|
14
|
+
return o(e);
|
|
15
|
+
} catch {}
|
|
16
|
+
return !1;
|
|
17
|
+
}, { message: "Invalid address (validation error)" }), u = t.string().regex(/^0x[0-9a-fA-F]+$/, "Invalid address"), d = u.min(50, "Address must at least be 50 characters long").max(66, "Address must at most be 66 characters long"), f = u.length(66, "Address must be 66 characters long"), p = d.pipe(c).transform((e) => `0x${(e.startsWith("0x") ? e.slice(2) : e).padStart(64, "0")}`), m = p.or(t.literal("")).transform((e) => e === "" ? void 0 : e).optional(), h = u.transform((e) => `0x${e.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), g = (e) => t.string().refine((e) => {
|
|
18
|
+
if (e.toLowerCase() === e) return !0;
|
|
19
|
+
try {
|
|
20
|
+
return s(e) && j(e);
|
|
21
|
+
} catch {}
|
|
22
|
+
return !1;
|
|
23
|
+
}, { message: e("validation.address.invalidChecksum") }), _ = (e) => t.string().refine((e) => {
|
|
24
|
+
try {
|
|
25
|
+
return o(e);
|
|
26
|
+
} catch {}
|
|
27
|
+
return !1;
|
|
28
|
+
}, { message: e("validation.address.validationError") }), v = (e) => t.string().regex(/^0x[0-9a-fA-F]+$/, e("validation.address.invalidFormat")), y = (e) => v(e).min(50, e("validation.address.tooShort")).max(66, e("validation.address.tooLong")), b = (e) => v(e).length(66, e("validation.address.exactLength")), x = (e) => {
|
|
29
|
+
let t = y(e), n = g(e);
|
|
30
|
+
return t.pipe(n).transform((e) => `0x${(e.startsWith("0x") ? e.slice(2) : e).padStart(64, "0")}`);
|
|
31
|
+
}, S = (e) => x(e).or(t.literal("")).transform((e) => e === "" ? void 0 : e).optional(), C = (e) => v(e).transform((e) => `0x${e.replace(/^0x/, "").toLowerCase().padStart(64, "0")}`), w = (e) => ({
|
|
32
|
+
validChecksumAddressSchema: g(e),
|
|
33
|
+
validateAddressRangeSchema: _(e),
|
|
34
|
+
addressSchemaBase: v(e),
|
|
35
|
+
addressSchemaLooseLength: y(e),
|
|
36
|
+
addressSchemaStrictLength: b(e),
|
|
37
|
+
addressSchema: x(e),
|
|
38
|
+
addressOrEmptyUndefinedSchema: S(e),
|
|
39
|
+
addressSchemaArgentBackend: C(e)
|
|
40
|
+
}), T = (e) => p.safeParse(e).success, E = T, D = (e) => i(e), O = (t) => {
|
|
41
|
+
if (!t) return !1;
|
|
42
|
+
try {
|
|
43
|
+
return E(e(t));
|
|
44
|
+
} catch {
|
|
45
|
+
return !1;
|
|
46
|
+
}
|
|
47
|
+
}, k = (e) => {
|
|
48
|
+
let t = D(e);
|
|
49
|
+
return `${t.slice(0, 2)}${t.slice(2, 6)}…${t.slice(-4)}`;
|
|
50
|
+
}, A = (e) => {
|
|
51
|
+
let t = D(e);
|
|
52
|
+
return `${t.slice(0, 2)} ${(t.slice(2).match(/.{1,4}/g) || []).join(" ")}`;
|
|
53
|
+
}, j = (e) => !/^0x[0-9a-f]{63,64}$/.test(e), M = (e) => e.toLowerCase().replace(/^[0x]+/, ""), N = (e) => {
|
|
54
|
+
try {
|
|
55
|
+
return /^(0x)?[0-9a-f]+$/i.test(e);
|
|
56
|
+
} catch {}
|
|
57
|
+
return !1;
|
|
58
|
+
}, P = (e, t) => {
|
|
59
|
+
try {
|
|
60
|
+
return !e || !t || !N(e) || !N(t) ? !1 : M(e) === M(t);
|
|
61
|
+
} catch {}
|
|
62
|
+
return !1;
|
|
63
|
+
}, F = (e) => {
|
|
64
|
+
try {
|
|
65
|
+
return a.toBigInt(u.parse(e)) === r.ZERO;
|
|
66
|
+
} catch {}
|
|
67
|
+
return !1;
|
|
68
|
+
}, I = (e, t) => !!t?.some((t) => P(t, e)), L = n((e) => `${e.slice(0, 6)}…${e.slice(-4)}`), R = n((e, t) => {
|
|
69
|
+
if (e.length < t) return e;
|
|
70
|
+
let n = Math.floor((t - 1) / 2);
|
|
71
|
+
return `${e.slice(0, n)}…${e.slice(-n)}`;
|
|
86
72
|
});
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
u as addressSchema,
|
|
90
|
-
W as addressSchemaArgentBackend,
|
|
91
|
-
n as addressSchemaBase,
|
|
92
|
-
k as addressSchemaLooseLength,
|
|
93
|
-
T as addressSchemaStrictLength,
|
|
94
|
-
M as formatFullAddress,
|
|
95
|
-
H as formatTruncatedAddress,
|
|
96
|
-
J as formatTruncatedSignerKey,
|
|
97
|
-
K as formatTruncatedString,
|
|
98
|
-
P as getAddressOrEmptyUndefinedSchema,
|
|
99
|
-
S as getAddressSchema,
|
|
100
|
-
v as getAddressSchemaArgentBackend,
|
|
101
|
-
o as getAddressSchemaBase,
|
|
102
|
-
g as getAddressSchemaLooseLength,
|
|
103
|
-
B as getAddressSchemaStrictLength,
|
|
104
|
-
j as getAddressValidationSchemas,
|
|
105
|
-
f as getValidChecksumAddressSchema,
|
|
106
|
-
y as getValidateAddressRangeSchema,
|
|
107
|
-
G as includesAddress,
|
|
108
|
-
b as isAddress,
|
|
109
|
-
q as isBase58Address,
|
|
110
|
-
z as isEqualAddress,
|
|
111
|
-
E as isValidAddress,
|
|
112
|
-
i as isValidHexString,
|
|
113
|
-
D as isZeroAddress,
|
|
114
|
-
A as normalizeAddress,
|
|
115
|
-
c as normalizeAddressForCompare,
|
|
116
|
-
C as validChecksumAddressSchema,
|
|
117
|
-
Z as validateAddressRangeSchema
|
|
118
|
-
};
|
|
73
|
+
//#endregion
|
|
74
|
+
export { m as addressOrEmptyUndefinedSchema, p as addressSchema, h as addressSchemaArgentBackend, u as addressSchemaBase, d as addressSchemaLooseLength, f as addressSchemaStrictLength, A as formatFullAddress, k as formatTruncatedAddress, L as formatTruncatedSignerKey, R as formatTruncatedString, S as getAddressOrEmptyUndefinedSchema, x as getAddressSchema, C as getAddressSchemaArgentBackend, v as getAddressSchemaBase, y as getAddressSchemaLooseLength, b as getAddressSchemaStrictLength, w as getAddressValidationSchemas, g as getValidChecksumAddressSchema, _ as getValidateAddressRangeSchema, I as includesAddress, T as isAddress, O as isBase58Address, P as isEqualAddress, E as isValidAddress, N as isValidHexString, F as isZeroAddress, D as normalizeAddress, M as normalizeAddressForCompare, c as validChecksumAddressSchema, l as validateAddressRangeSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`./address.cjs`),t=require(`./addressInput.cjs`),n=require(`./argentName.cjs`),r=require(`./starknetId.cjs`);let i=require(`zod`);var a=i.z.union([n.argentNameSchema,r.starknetIdSchema]),o=i.z.union([e.addressSchema,a]),s=i.z.union([t.addressInputSchema,a]),c=e=>a.safeParse(e).success,l=(e,t)=>{try{return t?n.isEqualArgentName(e,t)||r.isEqualStarknetId(e,t):!1}catch{}return!1},u=t=>r.isStarknetId(t)?r.normalizeStarknetId(t):n.isArgentName(t)?n.normalizeArgentName(t):e.normalizeAddress(t);exports.addressOrDomainInputSchema=s,exports.addressOrDomainSchema=o,exports.isEqualStarknetDomainName=l,exports.isStarknetDomainName=c,exports.normalizeAddressOrDomain=u,exports.starknetDomainNameSchema=a;
|
|
@@ -1,29 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
]), g = (e) => n.safeParse(e).success, q = (e, r) => {
|
|
16
|
-
try {
|
|
17
|
-
return r ? i(e, r) || f(e, r) : !1;
|
|
18
|
-
} catch {
|
|
19
|
-
}
|
|
20
|
-
return !1;
|
|
21
|
-
}, E = (e) => l(e) ? d(e) : c(e) ? u(e) : m(e);
|
|
22
|
-
export {
|
|
23
|
-
A as addressOrDomainInputSchema,
|
|
24
|
-
z as addressOrDomainSchema,
|
|
25
|
-
q as isEqualStarknetDomainName,
|
|
26
|
-
g as isStarknetDomainName,
|
|
27
|
-
E as normalizeAddressOrDomain,
|
|
28
|
-
n as starknetDomainNameSchema
|
|
29
|
-
};
|
|
1
|
+
import { addressSchema as e, normalizeAddress as t } from "./address.js";
|
|
2
|
+
import { addressInputSchema as n } from "./addressInput.js";
|
|
3
|
+
import { argentNameSchema as r, isArgentName as i, isEqualArgentName as a, normalizeArgentName as o } from "./argentName.js";
|
|
4
|
+
import { isEqualStarknetId as s, isStarknetId as c, normalizeStarknetId as l, starknetIdSchema as u } from "./starknetId.js";
|
|
5
|
+
import { z as d } from "zod";
|
|
6
|
+
//#region src/chains/starknet/addressDomain.ts
|
|
7
|
+
var f = d.union([r, u]), p = d.union([e, f]), m = d.union([n, f]), h = (e) => f.safeParse(e).success, g = (e, t) => {
|
|
8
|
+
try {
|
|
9
|
+
return t ? a(e, t) || s(e, t) : !1;
|
|
10
|
+
} catch {}
|
|
11
|
+
return !1;
|
|
12
|
+
}, _ = (e) => c(e) ? l(e) : i(e) ? o(e) : t(e);
|
|
13
|
+
//#endregion
|
|
14
|
+
export { m as addressOrDomainInputSchema, p as addressOrDomainSchema, g as isEqualStarknetDomainName, h as isStarknetDomainName, _ as normalizeAddressOrDomain, f as starknetDomainNameSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`./address.cjs`);var t=require(`zod`).z.string().regex(/^[a-zA-Z0-9.-]*$/g,`Invalid address character`).max(66,`Address cannot be over 66 characters`),n=e.addressSchemaStrictLength.pipe(e.validChecksumAddressSchema).pipe(e.validateAddressRangeSchema);exports.addressInputCharactersAndLengthSchema=t,exports.addressInputSchema=n;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
1
|
+
import { addressSchemaStrictLength as e, validChecksumAddressSchema as t, validateAddressRangeSchema as n } from "./address.js";
|
|
2
|
+
import { z as r } from "zod";
|
|
3
|
+
//#region src/chains/starknet/addressInput.ts
|
|
4
|
+
var i = r.string().regex(/^[a-zA-Z0-9.-]*$/g, "Invalid address character").max(66, "Address cannot be over 66 characters"), a = e.pipe(t).pipe(n);
|
|
5
|
+
//#endregion
|
|
6
|
+
export { i as addressInputCharactersAndLengthSchema, a as addressInputSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);var e=require(`zod`).z.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/,`Invalid Argent name`).max(253,`Argent name cannot be over 253 characters`),t=t=>e.safeParse(t).success,n=(e,t)=>{try{return t?r(e)===r(t):!1}catch{}return!1},r=t=>e.parse(t).toLowerCase();exports.argentNameSchema=e,exports.isArgentName=t,exports.isEqualArgentName=n,exports.normalizeArgentName=r;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
c as isArgentName,
|
|
12
|
-
o as isEqualArgentName,
|
|
13
|
-
a as normalizeArgentName
|
|
14
|
-
};
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
//#region src/chains/starknet/argentName.ts
|
|
3
|
+
var t = e.string().regex(/^([a-zA-Z0-9-]+\.)+argent.xyz$/, "Invalid Argent name").max(253, "Argent name cannot be over 253 characters"), n = (e) => t.safeParse(e).success, r = (e, t) => {
|
|
4
|
+
try {
|
|
5
|
+
return t ? i(e) === i(t) : !1;
|
|
6
|
+
} catch {}
|
|
7
|
+
return !1;
|
|
8
|
+
}, i = (e) => t.parse(e).toLowerCase();
|
|
9
|
+
//#endregion
|
|
10
|
+
export { t as argentNameSchema, n as isArgentName, r as isEqualArgentName, i as normalizeArgentName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);let e=require(`zod`);var t=e.z.union([e.z.literal(`0`),e.z.literal(`1`)]);exports.cairoVersionSchema=t;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { z as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
1
|
+
import { z as e } from "zod";
|
|
2
|
+
//#region src/chains/starknet/cairoVersionSchema.ts
|
|
3
|
+
var t = e.union([e.literal("0"), e.literal("1")]);
|
|
4
|
+
//#endregion
|
|
5
|
+
export { t as cairoVersionSchema };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e=`0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7`,t=`0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d`,n=`0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003`,r=`0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f`,i=`0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48`,a=`0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72`,o=`0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f`;exports.ETH_TOKEN_ADDRESS=e,exports.STANDARD_DEVNET_ACCOUNT_CLASS_HASH=o,exports.STRK_TOKEN_ADDRESS=t,exports.TXV1_ACCOUNT_CLASS_HASH=n,exports.TXV1_MULTISIG_CLASS_HASH=i,exports.TXV3_ACCOUNT_CLASS_HASH=r,exports.TXV3_MULTISIG_CLASS_HASH=a;
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
d as STRK_TOKEN_ADDRESS,
|
|
6
|
-
e as TXV1_ACCOUNT_CLASS_HASH,
|
|
7
|
-
S as TXV1_MULTISIG_CLASS_HASH,
|
|
8
|
-
f as TXV3_ACCOUNT_CLASS_HASH,
|
|
9
|
-
b as TXV3_MULTISIG_CLASS_HASH
|
|
10
|
-
};
|
|
1
|
+
//#region src/chains/starknet/constants.ts
|
|
2
|
+
var e = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7", t = "0x04718f5a0fc34cc1af16a1cdee98ffb20c31f5cd61d6ab07201858f4287c938d", n = "0x1a736d6ed154502257f02b1ccdf4d9d1089f80811cd6acad48e6b6a9d1f2003", r = "0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f", i = "0x737ee2f87ce571a58c6c8da558ec18a07ceb64a6172d5ec46171fbc80077a48", a = "0x6e150953b26271a740bf2b6e9bca17cc52c68d765f761295de51ceb8526ee72", o = "0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f";
|
|
3
|
+
//#endregion
|
|
4
|
+
export { e as ETH_TOKEN_ADDRESS, o as STANDARD_DEVNET_ACCOUNT_CLASS_HASH, t as STRK_TOKEN_ADDRESS, n as TXV1_ACCOUNT_CLASS_HASH, i as TXV1_MULTISIG_CLASS_HASH, r as TXV3_ACCOUNT_CLASS_HASH, a as TXV3_MULTISIG_CLASS_HASH };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`../../../_virtual/_rolldown/runtime.cjs`),t=require(`./address.cjs`),n=require(`./argentName.cjs`),r=require(`../../errors/address.cjs`),i=require(`../../http/HttpError.cjs`);let a=require(`zod`),o=require(`url-join`);o=e.__toESM(o);var s=a.z.object({walletAddress:t.addressSchemaArgentBackend,ens:n.argentNameSchema,chain:a.z.enum([`ethereum`,`starknet`]),deleted:a.z.boolean(),walletDeployed:a.z.boolean()}).or(a.z.object({status:a.z.string()}));async function c(e,n,a,s=`starknet`){let c=(0,o.default)(a,`wallet`,`?${new URLSearchParams({ens:e,chain:s})}`);try{let i=await n.get(c),a=i&&`walletAddress`in i?i.walletAddress:void 0;if(!a)throw new r.AddressError({code:`NO_ADDRESS_FROM_ARGENT_NAME`});if(t.isZeroAddress(a))throw new r.AddressError({code:`ARGENT_NAME_NOT_FOUND`,message:`${e} not found`});if(!t.isValidAddress(a))throw new r.AddressError({code:`ARGENT_NAME_INVALID_ADDRESS`,message:`${e} resolved to an invalid address (${a})`});return t.normalizeAddress(a)}catch(t){throw t instanceof i.HttpError&&t.status===404?new r.AddressError({code:`ARGENT_NAME_NOT_FOUND`,message:`${e} not found`}):t}}exports.apiWalletResponseSchema=s,exports.getAddressFromArgentName=c;
|
|
@@ -1,48 +1,40 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { addressSchemaArgentBackend as e, isValidAddress as t, isZeroAddress as n, normalizeAddress as r } from "./address.js";
|
|
2
|
+
import { argentNameSchema as i } from "./argentName.js";
|
|
3
|
+
import { AddressError as a } from "../../errors/address.js";
|
|
4
|
+
import { HttpError as o } from "../../http/HttpError.js";
|
|
2
5
|
import { z as s } from "zod";
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
message: `${o} resolved to an invalid address (${r})`
|
|
36
|
-
});
|
|
37
|
-
return N(r);
|
|
38
|
-
} catch (e) {
|
|
39
|
-
throw e instanceof _ && e.status === 404 ? new t({
|
|
40
|
-
code: "ARGENT_NAME_NOT_FOUND",
|
|
41
|
-
message: `${o} not found`
|
|
42
|
-
}) : e;
|
|
43
|
-
}
|
|
6
|
+
import c from "url-join";
|
|
7
|
+
//#region src/chains/starknet/getAddressFromArgentName.ts
|
|
8
|
+
var l = s.object({
|
|
9
|
+
walletAddress: e,
|
|
10
|
+
ens: i,
|
|
11
|
+
chain: s.enum(["ethereum", "starknet"]),
|
|
12
|
+
deleted: s.boolean(),
|
|
13
|
+
walletDeployed: s.boolean()
|
|
14
|
+
}).or(s.object({ status: s.string() }));
|
|
15
|
+
async function u(e, i, s, l = "starknet") {
|
|
16
|
+
let u = c(s, "wallet", `?${new URLSearchParams({
|
|
17
|
+
ens: e,
|
|
18
|
+
chain: l
|
|
19
|
+
})}`);
|
|
20
|
+
try {
|
|
21
|
+
let o = await i.get(u), s = o && "walletAddress" in o ? o.walletAddress : void 0;
|
|
22
|
+
if (!s) throw new a({ code: "NO_ADDRESS_FROM_ARGENT_NAME" });
|
|
23
|
+
if (n(s)) throw new a({
|
|
24
|
+
code: "ARGENT_NAME_NOT_FOUND",
|
|
25
|
+
message: `${e} not found`
|
|
26
|
+
});
|
|
27
|
+
if (!t(s)) throw new a({
|
|
28
|
+
code: "ARGENT_NAME_INVALID_ADDRESS",
|
|
29
|
+
message: `${e} resolved to an invalid address (${s})`
|
|
30
|
+
});
|
|
31
|
+
return r(s);
|
|
32
|
+
} catch (t) {
|
|
33
|
+
throw t instanceof o && t.status === 404 ? new a({
|
|
34
|
+
code: "ARGENT_NAME_NOT_FOUND",
|
|
35
|
+
message: `${e} not found`
|
|
36
|
+
}) : t;
|
|
37
|
+
}
|
|
44
38
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
T as getAddressFromArgentName
|
|
48
|
-
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { l as apiWalletResponseSchema, u as getAddressFromArgentName };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`./address.cjs`),t=require(`../../errors/address.cjs`),n=require(`../../errors/call.cjs`),r=require(`../../errors/network.cjs`),i=require(`../../utils/starknet/starknet.cjs`),a=require(`./network.cjs`);let o=require(`starknet`);function s(e){return e.replace(`.stark`,``).split(`.`).map(e=>o.starknetId.useEncoded(e).toString(10))}function c(e){let t=a.getChainIdFromNetworkId(e);return o.starknetId.getStarknetIdContract(t)}function l(e,t){let r=c(t),a=s(e);try{let e={domain:a,hint:[]};return i.callSchema.parse({contractAddress:r,entrypoint:`domain_to_address`,calldata:e})}catch(e){throw new n.CallError({code:`NOT_VALID`,options:{error:e}})}}async function u(i,a,o){if(!a||!o)throw new r.NetworkError({code:`NO_NETWORK_OR_MULTICALL`});let s;try{s=l(i,a)}catch(e){throw new n.CallError({code:`NOT_VALID`,options:{error:e}})}let c,u;try{c=await o.callContract(s),u=c[0]}catch{throw new t.AddressError({code:`STARKNAME_ERROR`})}if(e.isZeroAddress(u))throw new t.AddressError({code:`STARKNAME_NOT_FOUND`,message:`${i} not found`});if(!e.isValidAddress(u))throw new t.AddressError({code:`STARKNAME_INVALID_ADDRESS`,message:`${i} resolved to an invalid address (${u})`});return e.normalizeAddress(u)}exports.getAddressFromStarkName=u,exports.getCallFromStarkName=l,exports.getStarknetIdContractAddressFromNetworkId=c,exports.starkNameToCallDataDomain=s;
|
|
@@ -1,70 +1,63 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AddressError as
|
|
3
|
-
import { CallError as
|
|
4
|
-
import { NetworkError as
|
|
5
|
-
import { callSchema as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { isValidAddress as e, isZeroAddress as t, normalizeAddress as n } from "./address.js";
|
|
2
|
+
import { AddressError as r } from "../../errors/address.js";
|
|
3
|
+
import { CallError as i } from "../../errors/call.js";
|
|
4
|
+
import { NetworkError as a } from "../../errors/network.js";
|
|
5
|
+
import { callSchema as o } from "../../utils/starknet/starknet.js";
|
|
6
|
+
import { getChainIdFromNetworkId as s } from "./network.js";
|
|
7
|
+
import { starknetId as c } from "starknet";
|
|
8
|
+
//#region src/chains/starknet/getAddressFromStarkName.ts
|
|
9
|
+
function l(e) {
|
|
10
|
+
return e.replace(".stark", "").split(".").map((e) => c.useEncoded(e).toString(10));
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
function u(e) {
|
|
13
|
+
let t = s(e);
|
|
14
|
+
return c.getStarknetIdContract(t);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
function d(e, t) {
|
|
17
|
+
let n = u(t), r = l(e);
|
|
18
|
+
try {
|
|
19
|
+
let e = {
|
|
20
|
+
domain: r,
|
|
21
|
+
hint: []
|
|
22
|
+
};
|
|
23
|
+
return o.parse({
|
|
24
|
+
contractAddress: n,
|
|
25
|
+
entrypoint: "domain_to_address",
|
|
26
|
+
calldata: e
|
|
27
|
+
});
|
|
28
|
+
} catch (e) {
|
|
29
|
+
throw new i({
|
|
30
|
+
code: "NOT_VALID",
|
|
31
|
+
options: { error: e }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
30
34
|
}
|
|
31
|
-
async function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
});
|
|
58
|
-
if (!p(o))
|
|
59
|
-
throw new s({
|
|
60
|
-
code: "STARKNAME_INVALID_ADDRESS",
|
|
61
|
-
message: `${t} resolved to an invalid address (${o})`
|
|
62
|
-
});
|
|
63
|
-
return f(o);
|
|
35
|
+
async function f(o, s, c) {
|
|
36
|
+
if (!s || !c) throw new a({ code: "NO_NETWORK_OR_MULTICALL" });
|
|
37
|
+
let l;
|
|
38
|
+
try {
|
|
39
|
+
l = d(o, s);
|
|
40
|
+
} catch (e) {
|
|
41
|
+
throw new i({
|
|
42
|
+
code: "NOT_VALID",
|
|
43
|
+
options: { error: e }
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
let u, f;
|
|
47
|
+
try {
|
|
48
|
+
u = await c.callContract(l), f = u[0];
|
|
49
|
+
} catch {
|
|
50
|
+
throw new r({ code: "STARKNAME_ERROR" });
|
|
51
|
+
}
|
|
52
|
+
if (t(f)) throw new r({
|
|
53
|
+
code: "STARKNAME_NOT_FOUND",
|
|
54
|
+
message: `${o} not found`
|
|
55
|
+
});
|
|
56
|
+
if (!e(f)) throw new r({
|
|
57
|
+
code: "STARKNAME_INVALID_ADDRESS",
|
|
58
|
+
message: `${o} resolved to an invalid address (${f})`
|
|
59
|
+
});
|
|
60
|
+
return n(f);
|
|
64
61
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
S as getCallFromStarkName,
|
|
68
|
-
I as getStarknetIdContractAddressFromNetworkId,
|
|
69
|
-
h as starkNameToCallDataDomain
|
|
70
|
-
};
|
|
62
|
+
//#endregion
|
|
63
|
+
export { f as getAddressFromStarkName, d as getCallFromStarkName, u as getStarknetIdContractAddressFromNetworkId, l as starkNameToCallDataDomain };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`../../../_virtual/_rolldown/runtime.cjs`);const e=require(`../../errors/network.cjs`);let t=require(`starknet`);function n(n){switch(n){case`mainnet-alpha`:case t.constants.NetworkName.SN_MAIN:return t.constants.StarknetChainId.SN_MAIN;case`sepolia-alpha`:case t.constants.NetworkName.SN_SEPOLIA:return t.constants.StarknetChainId.SN_SEPOLIA;default:throw new e.NetworkError({code:`NOT_FOUND`,message:`Unknown networkId: ${n}`})}}function r(e){if(e===`mainnet`||e===`mainnet-alpha`)return`mainnet`;if(e===`sepolia`||e===`sepolia-alpha`)return`sepolia`;throw Error(`Invalid network id`)}exports.getArgentNetwork=r,exports.getChainIdFromNetworkId=n;
|