@argent/x-shared 1.79.0 → 1.79.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.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 +15 -15
- 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
package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
require(`./abstract/weierstrass.cjs`);const e=require(`../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.cjs`),t=require(`../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.cjs`);function n(n){return{hash:n,hmac:(r,...i)=>t.hmac(n,r,e.concatBytes(...i)),randomBytes:e.randomBytes}}exports.getHash=n;
|
package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { hmac as m } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js";
|
|
2
|
-
import { randomBytes as c, concatBytes as e } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js";
|
|
3
1
|
import "./abstract/weierstrass.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { concatBytes as e, randomBytes as t } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/utils.js";
|
|
3
|
+
import { hmac as n } from "../../../../../@noble_hashes@1.3.0/node_modules/@noble/hashes/esm/hmac.js";
|
|
4
|
+
//#region node_modules/.pnpm/@noble+curves@1.0.0/node_modules/@noble/curves/esm/_shortw_utils.js
|
|
5
|
+
function r(r) {
|
|
6
|
+
return {
|
|
7
|
+
hash: r,
|
|
8
|
+
hmac: (t, ...i) => n(r, t, e(...i)),
|
|
9
|
+
randomBytes: t
|
|
10
|
+
};
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
};
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as getHash };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`./utils.cjs`),t=require(`./modular.cjs`);var n=BigInt(0),r=BigInt(1);function i(e,t){let i=(e,t)=>{let n=t.negate();return e?n:t},a=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:i,unsafeLadder(t,i){let a=e.ZERO,o=t;for(;i>n;)i&r&&(a=a.add(o)),o=o.double(),i>>=r;return a},precomputeWindow(e,t){let{windows:n,windowSize:r}=a(t),i=[],o=e,s=o;for(let e=0;e<n;e++){s=o,i.push(s);for(let e=1;e<r;e++)s=s.add(o),i.push(s);o=s.double()}return i},wNAF(t,n,o){let{windows:s,windowSize:c}=a(t),l=e.ZERO,u=e.BASE,d=BigInt(2**t-1),f=2**t,p=BigInt(t);for(let e=0;e<s;e++){let t=e*c,a=Number(o&d);o>>=p,a>c&&(a-=f,o+=r);let s=t,m=t+Math.abs(a)-1,h=e%2!=0,g=a<0;a===0?u=u.add(i(h,n[s])):l=l.add(i(g,n[m]))}return{p:l,f:u}},wNAFCached(e,t,n,r){let i=e._WINDOW_SIZE||1,a=t.get(e);return a||(a=this.precomputeWindow(e,i),i!==1&&t.set(e,r(a))),this.wNAF(i,a,n)}}}function a(n){return t.validateField(n.Fp),e.validateObject(n,{n:`bigint`,h:`bigint`,Gx:`field`,Gy:`field`},{nBitLength:`isSafeInteger`,nByteLength:`isSafeInteger`}),Object.freeze({...t.nLength(n.n,n.nBitLength),...n,p:n.Fp.ORDER})}exports.validateBasic=a,exports.wNAF=i;
|
package/dist/node_modules/.pnpm/@noble_curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js
CHANGED
|
@@ -1,87 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
* @returns real and fake (for const-time) points
|
|
48
|
-
*/
|
|
49
|
-
wNAF(t, n, e) {
|
|
50
|
-
const { windows: f, windowSize: s } = h(t);
|
|
51
|
-
let o = i.ZERO, d = i.BASE;
|
|
52
|
-
const w = BigInt(2 ** t - 1), a = 2 ** t, b = BigInt(t);
|
|
53
|
-
for (let c = 0; c < f; c++) {
|
|
54
|
-
const p = c * s;
|
|
55
|
-
let r = Number(e & w);
|
|
56
|
-
e >>= b, r > s && (r -= a, e += g);
|
|
57
|
-
const B = p, m = p + Math.abs(r) - 1, I = c % 2 !== 0, N = r < 0;
|
|
58
|
-
r === 0 ? d = d.add(l(I, n[B])) : o = o.add(l(N, n[m]));
|
|
59
|
-
}
|
|
60
|
-
return { p: o, f: d };
|
|
61
|
-
},
|
|
62
|
-
wNAFCached(t, n, e, f) {
|
|
63
|
-
const s = t._WINDOW_SIZE || 1;
|
|
64
|
-
let o = n.get(t);
|
|
65
|
-
return o || (o = this.precomputeWindow(t, s), s !== 1 && n.set(t, f(o))), this.wNAF(s, o, e);
|
|
66
|
-
}
|
|
67
|
-
};
|
|
1
|
+
import { validateObject as e } from "./utils.js";
|
|
2
|
+
import { nLength as t, validateField as n } from "./modular.js";
|
|
3
|
+
//#region node_modules/.pnpm/@noble+curves@1.0.0/node_modules/@noble/curves/esm/abstract/curve.js
|
|
4
|
+
var r = BigInt(0), i = BigInt(1);
|
|
5
|
+
function a(e, t) {
|
|
6
|
+
let n = (e, t) => {
|
|
7
|
+
let n = t.negate();
|
|
8
|
+
return e ? n : t;
|
|
9
|
+
}, a = (e) => ({
|
|
10
|
+
windows: Math.ceil(t / e) + 1,
|
|
11
|
+
windowSize: 2 ** (e - 1)
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
constTimeNegate: n,
|
|
15
|
+
unsafeLadder(t, n) {
|
|
16
|
+
let a = e.ZERO, o = t;
|
|
17
|
+
for (; n > r;) n & i && (a = a.add(o)), o = o.double(), n >>= i;
|
|
18
|
+
return a;
|
|
19
|
+
},
|
|
20
|
+
precomputeWindow(e, t) {
|
|
21
|
+
let { windows: n, windowSize: r } = a(t), i = [], o = e, s = o;
|
|
22
|
+
for (let e = 0; e < n; e++) {
|
|
23
|
+
s = o, i.push(s);
|
|
24
|
+
for (let e = 1; e < r; e++) s = s.add(o), i.push(s);
|
|
25
|
+
o = s.double();
|
|
26
|
+
}
|
|
27
|
+
return i;
|
|
28
|
+
},
|
|
29
|
+
wNAF(t, r, o) {
|
|
30
|
+
let { windows: s, windowSize: c } = a(t), l = e.ZERO, u = e.BASE, d = BigInt(2 ** t - 1), f = 2 ** t, p = BigInt(t);
|
|
31
|
+
for (let e = 0; e < s; e++) {
|
|
32
|
+
let t = e * c, a = Number(o & d);
|
|
33
|
+
o >>= p, a > c && (a -= f, o += i);
|
|
34
|
+
let s = t, m = t + Math.abs(a) - 1, h = e % 2 != 0, g = a < 0;
|
|
35
|
+
a === 0 ? u = u.add(n(h, r[s])) : l = l.add(n(g, r[m]));
|
|
36
|
+
}
|
|
37
|
+
return {
|
|
38
|
+
p: l,
|
|
39
|
+
f: u
|
|
40
|
+
};
|
|
41
|
+
},
|
|
42
|
+
wNAFCached(e, t, n, r) {
|
|
43
|
+
let i = e._WINDOW_SIZE || 1, a = t.get(e);
|
|
44
|
+
return a || (a = this.precomputeWindow(e, i), i !== 1 && t.set(e, r(a))), this.wNAF(i, a, n);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
68
47
|
}
|
|
69
|
-
function
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
48
|
+
function o(r) {
|
|
49
|
+
return n(r.Fp), e(r, {
|
|
50
|
+
n: "bigint",
|
|
51
|
+
h: "bigint",
|
|
52
|
+
Gx: "field",
|
|
53
|
+
Gy: "field"
|
|
54
|
+
}, {
|
|
55
|
+
nBitLength: "isSafeInteger",
|
|
56
|
+
nByteLength: "isSafeInteger"
|
|
57
|
+
}), Object.freeze({
|
|
58
|
+
...t(r.n, r.nBitLength),
|
|
59
|
+
...r,
|
|
60
|
+
p: r.Fp.ORDER
|
|
61
|
+
});
|
|
83
62
|
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
z as wNAF
|
|
87
|
-
};
|
|
63
|
+
//#endregion
|
|
64
|
+
export { o as validateBasic, a as wNAF };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const e=require(`./utils.cjs`);var t=BigInt(0),n=BigInt(1),r=BigInt(2),i=BigInt(3),a=BigInt(4),o=BigInt(5),s=BigInt(8),c=BigInt(16);function l(e,n){let r=e%n;return r>=t?r:n+r}function u(e,r,i){if(i<=t||r<t)throw Error(`Expected power/modulo > 0`);if(i===n)return t;let a=n;for(;r>t;)r&n&&(a=a*e%i),e=e*e%i,r>>=n;return a}function d(e,r){if(e===t||r<=t)throw Error(`invert: expected positive integers, got n=${e} mod=${r}`);let i=l(e,r),a=r,o=t,s=n,c=n,u=t;for(;i!==t;){let e=a/i,t=a%i,n=o-c*e,r=s-u*e;a=i,i=t,o=c,s=u,c=n,u=r}if(a!==n)throw Error(`invert: does not exist`);return l(o,r)}function f(e){let i=(e-n)/r,o,s,c;for(o=e-n,s=0;o%r===t;o/=r,s++);for(c=r;c<e&&u(c,i,e)!==e-n;c++);if(s===1){let t=(e+n)/a;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}let l=(o+n)/r;return function(e,t){if(e.pow(t,i)===e.neg(e.ONE))throw Error(`Cannot find square root`);let r=s,a=e.pow(e.mul(e.ONE,c),o),u=e.pow(t,l),d=e.pow(t,o);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let n=e.sqr(d);t<r&&!e.eql(n,e.ONE);t++)n=e.sqr(n);let i=e.pow(a,n<<BigInt(r-t-1));a=e.sqr(i),u=e.mul(u,i),d=e.mul(d,a),r=t}return u}}function p(e){if(e%a===i){let t=(e+n)/a;return function(e,n){let r=e.pow(n,t);if(!e.eql(e.sqr(r),n))throw Error(`Cannot find square root`);return r}}if(e%s===o){let t=(e-o)/s;return function(e,n){let i=e.mul(n,r),a=e.pow(i,t),o=e.mul(n,a),s=e.mul(e.mul(o,r),a),c=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(c),n))throw Error(`Cannot find square root`);return c}}return e%c,f(e)}var m=[`create`,`isValid`,`is0`,`neg`,`inv`,`sqrt`,`sqr`,`eql`,`add`,`sub`,`mul`,`pow`,`div`,`addN`,`subN`,`mulN`,`sqrN`];function h(t){return e.validateObject(t,m.reduce((e,t)=>(e[t]=`function`,e),{ORDER:`bigint`,MASK:`bigint`,BYTES:`isSafeInteger`,BITS:`isSafeInteger`}))}function g(e,r,i){if(i<t)throw Error(`Expected power > 0`);if(i===t)return e.ONE;if(i===n)return r;let a=e.ONE,o=r;for(;i>t;)i&n&&(a=e.mul(a,o)),o=e.sqr(o),i>>=n;return a}function _(e,t){let n=Array(t.length),r=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),i=e.inv(r);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),i),n}function v(e,t){let n=t===void 0?e.toString(2).length:t;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function y(r,i,a=!1,o={}){if(r<=t)throw Error(`Expected Fp ORDER > 0, got ${r}`);let{nBitLength:s,nByteLength:c}=v(r,i);if(c>2048)throw Error(`Field lengths over 2048 bytes are not supported`);let u=p(r),f=Object.freeze({ORDER:r,BITS:s,BYTES:c,MASK:e.bitMask(s),ZERO:t,ONE:n,create:e=>l(e,r),isValid:e=>{if(typeof e!=`bigint`)throw Error(`Invalid field element: expected bigint, got ${typeof e}`);return t<=e&&e<r},is0:e=>e===t,isOdd:e=>(e&n)===n,neg:e=>l(-e,r),eql:(e,t)=>e===t,sqr:e=>l(e*e,r),add:(e,t)=>l(e+t,r),sub:(e,t)=>l(e-t,r),mul:(e,t)=>l(e*t,r),pow:(e,t)=>g(f,e,t),div:(e,t)=>l(e*d(t,r),r),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:e=>d(e,r),sqrt:o.sqrt||(e=>u(f,e)),invertBatch:e=>_(f,e),cmov:(e,t,n)=>n?t:e,toBytes:t=>a?e.numberToBytesLE(t,c):e.numberToBytesBE(t,c),fromBytes:t=>{if(t.length!==c)throw Error(`Fp.fromBytes: expected ${c}, got ${t.length}`);return a?e.bytesToNumberLE(t):e.bytesToNumberBE(t)}});return Object.freeze(f)}function b(t,r,i=!1){t=e.ensureBytes(`privateHash`,t);let a=t.length,o=v(r).nByteLength+8;if(o<24||a<o||a>1024)throw Error(`hashToPrivateScalar: expected ${o}-1024 bytes of input, got ${a}`);return l(i?e.bytesToNumberLE(t):e.bytesToNumberBE(t),r-n)+n}exports.Field=y,exports.FpPow=g,exports.hashToPrivateScalar=b,exports.invert=d,exports.mod=l,exports.nLength=v,exports.validateField=h;
|
|
@@ -1,202 +1,165 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
BigInt(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return n >= f ? n : o + n;
|
|
1
|
+
import { bitMask as e, bytesToNumberBE as t, bytesToNumberLE as n, ensureBytes as r, numberToBytesBE as i, numberToBytesLE as a, validateObject as o } from "./utils.js";
|
|
2
|
+
//#region node_modules/.pnpm/@noble+curves@1.0.0/node_modules/@noble/curves/esm/abstract/modular.js
|
|
3
|
+
var s = BigInt(0), c = BigInt(1), l = BigInt(2), u = BigInt(3), d = BigInt(4), f = BigInt(5), p = BigInt(8), m = BigInt(16);
|
|
4
|
+
function h(e, t) {
|
|
5
|
+
let n = e % t;
|
|
6
|
+
return n >= s ? n : t + n;
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
for (; o > f; )
|
|
16
|
-
o & u && (r = r * e % n), e = e * e % n, o >>= u;
|
|
17
|
-
return r;
|
|
8
|
+
function g(e, t, n) {
|
|
9
|
+
if (n <= s || t < s) throw Error("Expected power/modulo > 0");
|
|
10
|
+
if (n === c) return s;
|
|
11
|
+
let r = c;
|
|
12
|
+
for (; t > s;) t & c && (r = r * e % n), e = e * e % n, t >>= c;
|
|
13
|
+
return r;
|
|
18
14
|
}
|
|
19
|
-
function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
throw new Error("invert: does not exist");
|
|
29
|
-
return g(s, o);
|
|
15
|
+
function _(e, t) {
|
|
16
|
+
if (e === s || t <= s) throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);
|
|
17
|
+
let n = h(e, t), r = t, i = s, a = c, o = c, l = s;
|
|
18
|
+
for (; n !== s;) {
|
|
19
|
+
let e = r / n, t = r % n, s = i - o * e, c = a - l * e;
|
|
20
|
+
r = n, n = t, i = o, a = l, o = s, l = c;
|
|
21
|
+
}
|
|
22
|
+
if (r !== c) throw Error("invert: does not exist");
|
|
23
|
+
return h(i, t);
|
|
30
24
|
}
|
|
31
|
-
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
|
-
for (let v = i.sqr(h); q < l && !i.eql(v, i.ONE); q++)
|
|
57
|
-
v = i.sqr(v);
|
|
58
|
-
const N = i.pow(a, u << BigInt(l - q - 1));
|
|
59
|
-
a = i.sqr(N), B = i.mul(B, N), h = i.mul(h, a), l = q;
|
|
60
|
-
}
|
|
61
|
-
return B;
|
|
62
|
-
};
|
|
25
|
+
function v(e) {
|
|
26
|
+
let t = (e - c) / l, n, r, i;
|
|
27
|
+
for (n = e - c, r = 0; n % l === s; n /= l, r++);
|
|
28
|
+
for (i = l; i < e && g(i, t, e) !== e - c; i++);
|
|
29
|
+
if (r === 1) {
|
|
30
|
+
let t = (e + c) / d;
|
|
31
|
+
return function(e, n) {
|
|
32
|
+
let r = e.pow(n, t);
|
|
33
|
+
if (!e.eql(e.sqr(r), n)) throw Error("Cannot find square root");
|
|
34
|
+
return r;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
let a = (n + c) / l;
|
|
38
|
+
return function(e, o) {
|
|
39
|
+
if (e.pow(o, t) === e.neg(e.ONE)) throw Error("Cannot find square root");
|
|
40
|
+
let s = r, l = e.pow(e.mul(e.ONE, i), n), u = e.pow(o, a), d = e.pow(o, n);
|
|
41
|
+
for (; !e.eql(d, e.ONE);) {
|
|
42
|
+
if (e.eql(d, e.ZERO)) return e.ZERO;
|
|
43
|
+
let t = 1;
|
|
44
|
+
for (let n = e.sqr(d); t < s && !e.eql(n, e.ONE); t++) n = e.sqr(n);
|
|
45
|
+
let n = e.pow(l, c << BigInt(s - t - 1));
|
|
46
|
+
l = e.sqr(n), u = e.mul(u, n), d = e.mul(d, l), s = t;
|
|
47
|
+
}
|
|
48
|
+
return u;
|
|
49
|
+
};
|
|
63
50
|
}
|
|
64
|
-
function
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
return j(e);
|
|
51
|
+
function y(e) {
|
|
52
|
+
if (e % d === u) {
|
|
53
|
+
let t = (e + c) / d;
|
|
54
|
+
return function(e, n) {
|
|
55
|
+
let r = e.pow(n, t);
|
|
56
|
+
if (!e.eql(e.sqr(r), n)) throw Error("Cannot find square root");
|
|
57
|
+
return r;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
if (e % p === f) {
|
|
61
|
+
let t = (e - f) / p;
|
|
62
|
+
return function(e, n) {
|
|
63
|
+
let r = e.mul(n, l), i = e.pow(r, t), a = e.mul(n, i), o = e.mul(e.mul(a, l), i), s = e.mul(a, e.sub(o, e.ONE));
|
|
64
|
+
if (!e.eql(e.sqr(s), n)) throw Error("Cannot find square root");
|
|
65
|
+
return s;
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return e % m, v(e);
|
|
84
69
|
}
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
70
|
+
var b = [
|
|
71
|
+
"create",
|
|
72
|
+
"isValid",
|
|
73
|
+
"is0",
|
|
74
|
+
"neg",
|
|
75
|
+
"inv",
|
|
76
|
+
"sqrt",
|
|
77
|
+
"sqr",
|
|
78
|
+
"eql",
|
|
79
|
+
"add",
|
|
80
|
+
"sub",
|
|
81
|
+
"mul",
|
|
82
|
+
"pow",
|
|
83
|
+
"div",
|
|
84
|
+
"addN",
|
|
85
|
+
"subN",
|
|
86
|
+
"mulN",
|
|
87
|
+
"sqrN"
|
|
103
88
|
];
|
|
104
|
-
function
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return C(e, n);
|
|
89
|
+
function x(e) {
|
|
90
|
+
return o(e, b.reduce((e, t) => (e[t] = "function", e), {
|
|
91
|
+
ORDER: "bigint",
|
|
92
|
+
MASK: "bigint",
|
|
93
|
+
BYTES: "isSafeInteger",
|
|
94
|
+
BITS: "isSafeInteger"
|
|
95
|
+
}));
|
|
112
96
|
}
|
|
113
|
-
function
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
let r = e.ONE, s = o;
|
|
121
|
-
for (; n > f; )
|
|
122
|
-
n & u && (r = e.mul(r, s)), s = e.sqr(s), n >>= u;
|
|
123
|
-
return r;
|
|
97
|
+
function S(e, t, n) {
|
|
98
|
+
if (n < s) throw Error("Expected power > 0");
|
|
99
|
+
if (n === s) return e.ONE;
|
|
100
|
+
if (n === c) return t;
|
|
101
|
+
let r = e.ONE, i = t;
|
|
102
|
+
for (; n > s;) n & c && (r = e.mul(r, i)), i = e.sqr(i), n >>= c;
|
|
103
|
+
return r;
|
|
124
104
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
|
|
105
|
+
function C(e, t) {
|
|
106
|
+
let n = Array(t.length), r = t.reduce((t, r, i) => e.is0(r) ? t : (n[i] = t, e.mul(t, r)), e.ONE), i = e.inv(r);
|
|
107
|
+
return t.reduceRight((t, r, i) => e.is0(r) ? t : (n[i] = e.mul(t, n[i]), e.mul(t, r)), i), n;
|
|
128
108
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
109
|
+
function w(e, t) {
|
|
110
|
+
let n = t === void 0 ? e.toString(2).length : t;
|
|
111
|
+
return {
|
|
112
|
+
nBitLength: n,
|
|
113
|
+
nByteLength: Math.ceil(n / 8)
|
|
114
|
+
};
|
|
132
115
|
}
|
|
133
|
-
function
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
fromBytes: (t) => {
|
|
175
|
-
if (t.length !== c)
|
|
176
|
-
throw new Error(`Fp.fromBytes: expected ${c}, got ${t.length}`);
|
|
177
|
-
return n ? y(t) : m(t);
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
return Object.freeze(i);
|
|
116
|
+
function T(r, o, l = !1, u = {}) {
|
|
117
|
+
if (r <= s) throw Error(`Expected Fp ORDER > 0, got ${r}`);
|
|
118
|
+
let { nBitLength: d, nByteLength: f } = w(r, o);
|
|
119
|
+
if (f > 2048) throw Error("Field lengths over 2048 bytes are not supported");
|
|
120
|
+
let p = y(r), m = Object.freeze({
|
|
121
|
+
ORDER: r,
|
|
122
|
+
BITS: d,
|
|
123
|
+
BYTES: f,
|
|
124
|
+
MASK: e(d),
|
|
125
|
+
ZERO: s,
|
|
126
|
+
ONE: c,
|
|
127
|
+
create: (e) => h(e, r),
|
|
128
|
+
isValid: (e) => {
|
|
129
|
+
if (typeof e != "bigint") throw Error(`Invalid field element: expected bigint, got ${typeof e}`);
|
|
130
|
+
return s <= e && e < r;
|
|
131
|
+
},
|
|
132
|
+
is0: (e) => e === s,
|
|
133
|
+
isOdd: (e) => (e & c) === c,
|
|
134
|
+
neg: (e) => h(-e, r),
|
|
135
|
+
eql: (e, t) => e === t,
|
|
136
|
+
sqr: (e) => h(e * e, r),
|
|
137
|
+
add: (e, t) => h(e + t, r),
|
|
138
|
+
sub: (e, t) => h(e - t, r),
|
|
139
|
+
mul: (e, t) => h(e * t, r),
|
|
140
|
+
pow: (e, t) => S(m, e, t),
|
|
141
|
+
div: (e, t) => h(e * _(t, r), r),
|
|
142
|
+
sqrN: (e) => e * e,
|
|
143
|
+
addN: (e, t) => e + t,
|
|
144
|
+
subN: (e, t) => e - t,
|
|
145
|
+
mulN: (e, t) => e * t,
|
|
146
|
+
inv: (e) => _(e, r),
|
|
147
|
+
sqrt: u.sqrt || ((e) => p(m, e)),
|
|
148
|
+
invertBatch: (e) => C(m, e),
|
|
149
|
+
cmov: (e, t, n) => n ? t : e,
|
|
150
|
+
toBytes: (e) => l ? a(e, f) : i(e, f),
|
|
151
|
+
fromBytes: (e) => {
|
|
152
|
+
if (e.length !== f) throw Error(`Fp.fromBytes: expected ${f}, got ${e.length}`);
|
|
153
|
+
return l ? n(e) : t(e);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
return Object.freeze(m);
|
|
181
157
|
}
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
const c = n ? y(e) : m(e);
|
|
188
|
-
return g(c, o - u) + u;
|
|
158
|
+
function E(e, i, a = !1) {
|
|
159
|
+
e = r("privateHash", e);
|
|
160
|
+
let o = e.length, s = w(i).nByteLength + 8;
|
|
161
|
+
if (s < 24 || o < s || o > 1024) throw Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${o}`);
|
|
162
|
+
return h(a ? n(e) : t(e), i - c) + c;
|
|
189
163
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
z as FpInvertBatch,
|
|
193
|
-
O as FpPow,
|
|
194
|
-
k as FpSqrt,
|
|
195
|
-
Y as hashToPrivateScalar,
|
|
196
|
-
S as invert,
|
|
197
|
-
g as mod,
|
|
198
|
-
x as nLength,
|
|
199
|
-
Z as pow,
|
|
200
|
-
j as tonelliShanks,
|
|
201
|
-
Q as validateField
|
|
202
|
-
};
|
|
164
|
+
//#endregion
|
|
165
|
+
export { T as Field, S as FpPow, E as hashToPrivateScalar, _ as invert, h as mod, w as nLength, x as validateField };
|