UNPKG

@xlink-network/xlink-sdk

Version:
47 lines (45 loc) 1.28 kB
import { EVMEndpointContract } from "./chunk-RHGELTWO.mjs"; import { InvalidMethodParametersError } from "./chunk-KTUPNUM5.mjs"; import { BigNumber } from "./chunk-KHTJNOQE.mjs"; // src/xlinkSdkUtils/types.ts var NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i; function toSDKNumberOrUndefined(n) { if (n == null) return void 0; const str = BigNumber.toString(n); if (!NUMERIC.test(str)) { throw new InvalidMethodParametersError( ["toSDKNumberOrUndefined"], [ { name: "n", expected: "a number, bigint, or a string that can be converted to a number", received: str } ] ); } return BigNumber.toString(n); } var evmNativeCurrencyAddress = Symbol( "[XLinkSDK] EVM Native Currency Address" ); var isStacksContractAddressEqual = (a, b) => { return a.deployerAddress === b.deployerAddress && a.contractName === b.contractName; }; var PublicEVMContractType; ((PublicEVMContractType2) => { PublicEVMContractType2.BridgeEndpoint = EVMEndpointContract.BridgeEndpoint; })(PublicEVMContractType || (PublicEVMContractType = {})); export { toSDKNumberOrUndefined, evmNativeCurrencyAddress, isStacksContractAddressEqual, PublicEVMContractType }; //# sourceMappingURL=chunk-FZQUIYHC.mjs.map