@polyester/sdk 0.22.0 → 0.22.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @polyester/sdk
2
2
 
3
+ ## 0.22.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix the testnet environment chain ID to `888169` and chain name to `Polyester Chain Testnet`. ([#133](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/133))
8
+
9
+ ## 0.22.1
10
+
11
+ ### Patch Changes
12
+
13
+ - Export `POLYESTER_TESTNET_ENVIRONMENT` from the SDK package entrypoint so consumers can import the testnet preset alongside devnet. ([#131](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/131))
14
+
3
15
  ## 0.22.0
4
16
 
5
17
  ### Minor Changes
@@ -52,6 +52,7 @@ interface CreatePolyesterEnvironmentParams {
52
52
  */
53
53
  declare function createPolyesterEnvironment(params: CreatePolyesterEnvironmentParams): PolyesterEnvironment;
54
54
  declare const POLYESTER_DEVNET_ENVIRONMENT: PolyesterEnvironment;
55
+ declare const POLYESTER_TESTNET_ENVIRONMENT: PolyesterEnvironment;
55
56
  //#endregion
56
- export { CreatePolyesterEnvironmentParams, POLYESTER_DEVNET_ENVIRONMENT, PolyesterAccountAbstractionEnvironment, PolyesterContractsEnvironment, PolyesterEntryPointConfig, PolyesterEnvironment, PolyesterSafeDeploymentConfig, createPolyesterEnvironment };
57
+ export { CreatePolyesterEnvironmentParams, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_TESTNET_ENVIRONMENT, PolyesterAccountAbstractionEnvironment, PolyesterContractsEnvironment, PolyesterEntryPointConfig, PolyesterEnvironment, PolyesterSafeDeploymentConfig, createPolyesterEnvironment };
57
58
  //# sourceMappingURL=environment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","names":[],"sources":["../src/environment.ts"],"mappings":";;;UAKiB;WACJ,SAAS;WACT;;UAGI;WACJ,SAAS;WACT,wBAAwB;WACxB,uBAAuB;WACvB,yBAAyB;WACzB,sBAAsB;WACtB,kBAAkB;WAClB,2BAA2B;;UAGvB;WACJ;WACA;WACA,YAAY;WACZ,MAAM;;UAGF;WACJ,uBAAuB;;UAGnB;WACJ;WACA;WACA;WACA;WACA;WACA,OAAO;WACP,oBAAoB;WACpB,WAAW;;UAGP;WACJ;WACA;WACA;WACA;WACA,OAAO;WACP;aACI;aACA;aACA,YAAY;aACZ,MAAM;;WAEV,WAAW;;;;;iBA4KR,2BACZ,QAAQ,mCACT;cAkEU,8BAA4B"}
1
+ {"version":3,"file":"environment.d.ts","names":[],"sources":["../src/environment.ts"],"mappings":";;;UAKiB;WACJ,SAAS;WACT;;UAGI;WACJ,SAAS;WACT,wBAAwB;WACxB,uBAAuB;WACvB,yBAAyB;WACzB,sBAAsB;WACtB,kBAAkB;WAClB,2BAA2B;;UAGvB;WACJ;WACA;WACA,YAAY;WACZ,MAAM;;UAGF;WACJ,uBAAuB;;UAGnB;WACJ;WACA;WACA;WACA;WACA;WACA,OAAO;WACP,oBAAoB;WACpB,WAAW;;UAGP;WACJ;WACA;WACA;WACA;WACA,OAAO;WACP;aACI;aACA;aACA,YAAY;aACZ,MAAM;;WAEV,WAAW;;;;;iBA4KR,2BACZ,QAAQ,mCACT;cAkEU,8BAA4B;cAqD5B,+BAA6B"}
@@ -183,14 +183,14 @@ const POLYESTER_DEVNET_ENVIRONMENT = createPolyesterEnvironment({
183
183
  },
184
184
  contracts: { tradingGatewayAddress: "0xD3fecf5D39131e23b6B0f872cA0a21c8A5a30932" }
185
185
  });
186
- createPolyesterEnvironment({
186
+ const POLYESTER_TESTNET_ENVIRONMENT = createPolyesterEnvironment({
187
187
  name: "polyester-testnet",
188
188
  apiUrl: "https://api-testnet.polyester.com",
189
189
  websocketUrl: "wss://api-testnet.polyester.com",
190
190
  rpcUrl: "https://rpc.polyester.live",
191
191
  chain: {
192
- id: 888168,
193
- name: "Polyester Chain Devnet",
192
+ id: 888169,
193
+ name: "Polyester Chain Testnet",
194
194
  nativeCurrency: {
195
195
  decimals: 18,
196
196
  name: "POL",
@@ -226,6 +226,6 @@ createPolyesterEnvironment({
226
226
  contracts: { tradingGatewayAddress: "0x20ef1BCeE69D73Ce1649E688dAA9A7AcF441f0EE" }
227
227
  });
228
228
  //#endregion
229
- export { POLYESTER_DEVNET_ENVIRONMENT, createPolyesterEnvironment, parsePolyesterEnvironment };
229
+ export { POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_TESTNET_ENVIRONMENT, createPolyesterEnvironment, parsePolyesterEnvironment };
230
230
 
231
231
  //# sourceMappingURL=environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","names":[],"sources":["../src/environment.ts"],"sourcesContent":["import type { SafeVersion } from \"permissionless/accounts\";\nimport { ConfigurationError } from \"./shared/errors.js\";\nimport type { Address, Chain } from \"viem\";\nimport { checksumEvmAddress, evmUtf8ToBytes, isEvmAddress, keccak256Hex } from \"./utils/evm.js\";\n\nexport interface PolyesterEntryPointConfig {\n readonly address: Address;\n readonly version: \"0.7\";\n}\n\nexport interface PolyesterSafeDeploymentConfig {\n readonly version: SafeVersion;\n readonly safeModuleSetupAddress: Address;\n readonly safe4337ModuleAddress: Address;\n readonly safeProxyFactoryAddress: Address;\n readonly safeSingletonAddress: Address;\n readonly multiSendAddress: Address;\n readonly multiSendCallOnlyAddress?: Address;\n}\n\nexport interface PolyesterAccountAbstractionEnvironment {\n readonly bundlerUrl: string;\n readonly paymasterUrl: string;\n readonly entryPoint: PolyesterEntryPointConfig;\n readonly safe: PolyesterSafeDeploymentConfig;\n}\n\nexport interface PolyesterContractsEnvironment {\n readonly tradingGatewayAddress: Address;\n}\n\nexport interface PolyesterEnvironment {\n readonly name: string;\n readonly fingerprint: string;\n readonly apiUrl: string;\n readonly websocketUrl: string;\n readonly rpcUrl: string;\n readonly chain: Chain;\n readonly accountAbstraction: PolyesterAccountAbstractionEnvironment;\n readonly contracts: PolyesterContractsEnvironment;\n}\n\nexport interface CreatePolyesterEnvironmentParams {\n readonly name: string;\n readonly apiUrl: string;\n readonly websocketUrl: string;\n readonly rpcUrl: string;\n readonly chain: Chain;\n readonly accountAbstraction: {\n readonly bundlerUrl: string;\n readonly paymasterUrl: string;\n readonly entryPoint: PolyesterEntryPointConfig;\n readonly safe: PolyesterSafeDeploymentConfig;\n };\n readonly contracts: PolyesterContractsEnvironment;\n}\n\nconst LOCAL_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\"]);\n\nfunction requireObject(value: unknown, label: string): asserts value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new ConfigurationError(`${label} must be an object.`);\n }\n}\n\nfunction requireNonEmptyString(value: unknown, label: string): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new ConfigurationError(`${label} must be a non-empty string.`);\n }\n}\n\nfunction isLocalHost(hostname: string): boolean {\n return LOCAL_HOSTS.has(hostname);\n}\n\nfunction normalizeUrl(\n value: string,\n label: string,\n allowedProtocols: readonly string[],\n options?: { allowSearch?: boolean },\n): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new ConfigurationError(`${label} must be a valid URL.`);\n }\n\n if (!allowedProtocols.includes(url.protocol)) {\n throw new ConfigurationError(`${label} must use ${allowedProtocols.join(\" or \")}.`);\n }\n\n const insecureRemote =\n (url.protocol === \"http:\" || url.protocol === \"ws:\") && !isLocalHost(url.hostname);\n if (insecureRemote) {\n throw new ConfigurationError(`${label} must use a secure protocol for remote hosts.`);\n }\n\n if (options?.allowSearch === false && url.search) {\n throw new ConfigurationError(`${label} must not include query parameters.`);\n }\n\n url.hash = \"\";\n return url.toString().replace(/\\/+$/u, \"\");\n}\n\nfunction normalizeAddress(value: Address, label: string): Address {\n if (!isEvmAddress(value)) {\n throw new ConfigurationError(`${label} must be a valid address.`);\n }\n return checksumEvmAddress(value);\n}\n\nfunction normalizeEntryPoint(entryPoint: PolyesterEntryPointConfig): PolyesterEntryPointConfig {\n requireObject(entryPoint, \"accountAbstraction.entryPoint\");\n if (entryPoint.version !== \"0.7\") {\n throw new ConfigurationError(\"accountAbstraction.entryPoint.version must be 0.7.\");\n }\n return Object.freeze({\n address: normalizeAddress(entryPoint.address, \"accountAbstraction.entryPoint.address\"),\n version: entryPoint.version,\n });\n}\n\nfunction normalizeSafeConfig(safe: PolyesterSafeDeploymentConfig): PolyesterSafeDeploymentConfig {\n requireObject(safe, \"accountAbstraction.safe\");\n if (safe.version !== \"1.4.1\" && safe.version !== \"1.5.0\") {\n throw new ConfigurationError(\n 'accountAbstraction.safe.version must be either \"1.4.1\" or \"1.5.0\".',\n );\n }\n return Object.freeze({\n version: safe.version,\n safeModuleSetupAddress: normalizeAddress(\n safe.safeModuleSetupAddress,\n \"accountAbstraction.safe.safeModuleSetupAddress\",\n ),\n safe4337ModuleAddress: normalizeAddress(\n safe.safe4337ModuleAddress,\n \"accountAbstraction.safe.safe4337ModuleAddress\",\n ),\n safeProxyFactoryAddress: normalizeAddress(\n safe.safeProxyFactoryAddress,\n \"accountAbstraction.safe.safeProxyFactoryAddress\",\n ),\n safeSingletonAddress: normalizeAddress(\n safe.safeSingletonAddress,\n \"accountAbstraction.safe.safeSingletonAddress\",\n ),\n multiSendAddress: normalizeAddress(\n safe.multiSendAddress,\n \"accountAbstraction.safe.multiSendAddress\",\n ),\n multiSendCallOnlyAddress: safe.multiSendCallOnlyAddress\n ? normalizeAddress(\n safe.multiSendCallOnlyAddress,\n \"accountAbstraction.safe.multiSendCallOnlyAddress\",\n )\n : undefined,\n });\n}\n\nfunction normalizeChain(chain: Chain, rpcUrl: string): Chain {\n requireObject(chain, \"chain\");\n if (!Number.isInteger(chain.id) || chain.id <= 0) {\n throw new ConfigurationError(\"chain.id must be a positive integer.\");\n }\n requireNonEmptyString(chain.name, \"chain.name\");\n requireObject(chain.nativeCurrency, \"chain.nativeCurrency\");\n if (!Number.isInteger(chain.nativeCurrency.decimals) || chain.nativeCurrency.decimals < 0) {\n throw new ConfigurationError(\n \"chain.nativeCurrency.decimals must be a non-negative integer.\",\n );\n }\n requireNonEmptyString(chain.nativeCurrency.name, \"chain.nativeCurrency.name\");\n requireNonEmptyString(chain.nativeCurrency.symbol, \"chain.nativeCurrency.symbol\");\n requireObject(chain.rpcUrls, \"chain.rpcUrls\");\n requireObject(chain.rpcUrls.default, \"chain.rpcUrls.default\");\n if (!Array.isArray(chain.rpcUrls.default.http)) {\n throw new ConfigurationError(\"chain.rpcUrls.default.http must be an array.\");\n }\n\n // Shape parity with viem's defineChain: spread over undefined defaults.\n return Object.freeze({\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n rpcUrls: {\n ...chain.rpcUrls,\n default: {\n ...chain.rpcUrls.default,\n http: [rpcUrl],\n },\n },\n });\n}\n\nfunction environmentFingerprint(input: {\n apiUrl: string;\n websocketUrl: string;\n rpcUrl: string;\n chainId: number;\n accountAbstraction: PolyesterAccountAbstractionEnvironment;\n contracts: PolyesterContractsEnvironment;\n}): string {\n return keccak256Hex(\n evmUtf8ToBytes(\n JSON.stringify({\n apiUrl: input.apiUrl,\n websocketUrl: input.websocketUrl,\n rpcUrl: input.rpcUrl,\n chainId: input.chainId,\n bundlerUrl: input.accountAbstraction.bundlerUrl,\n paymasterUrl: input.accountAbstraction.paymasterUrl,\n entryPoint: input.accountAbstraction.entryPoint,\n safe: input.accountAbstraction.safe,\n contracts: input.contracts,\n }),\n ),\n );\n}\n\n/**\n * Creates a complete SDK environment configuration from entrypoint and contract settings.\n */\nexport function createPolyesterEnvironment(\n params: CreatePolyesterEnvironmentParams,\n): PolyesterEnvironment {\n requireObject(params, \"Environment configuration\");\n requireNonEmptyString(params.name, \"name\");\n requireObject(params.accountAbstraction, \"accountAbstraction\");\n requireObject(params.contracts, \"contracts\");\n const apiUrl = normalizeUrl(params.apiUrl, \"apiUrl\", [\"https:\", \"http:\"], {\n allowSearch: false,\n });\n const websocketUrl = normalizeUrl(params.websocketUrl, \"websocketUrl\", [\"wss:\", \"ws:\"]);\n const rpcUrl = normalizeUrl(params.rpcUrl, \"rpcUrl\", [\"https:\", \"http:\"]);\n const bundlerUrl = normalizeUrl(params.accountAbstraction.bundlerUrl, \"bundlerUrl\", [\n \"https:\",\n \"http:\",\n ]);\n const paymasterUrl = normalizeUrl(params.accountAbstraction.paymasterUrl, \"paymasterUrl\", [\n \"https:\",\n \"http:\",\n ]);\n const chain = normalizeChain(params.chain, rpcUrl);\n const accountAbstraction = Object.freeze({\n bundlerUrl,\n paymasterUrl,\n entryPoint: normalizeEntryPoint(params.accountAbstraction.entryPoint),\n safe: normalizeSafeConfig(params.accountAbstraction.safe),\n });\n const contracts = Object.freeze({\n tradingGatewayAddress: normalizeAddress(\n params.contracts.tradingGatewayAddress,\n \"contracts.tradingGatewayAddress\",\n ),\n });\n const fingerprint = environmentFingerprint({\n apiUrl,\n websocketUrl,\n rpcUrl,\n chainId: chain.id,\n accountAbstraction,\n contracts,\n });\n\n return Object.freeze({\n name: params.name,\n fingerprint,\n apiUrl,\n websocketUrl,\n rpcUrl,\n chain,\n accountAbstraction,\n contracts,\n });\n}\n\n/**\n * Parses a complete environment supplied to a public SDK client constructor.\n */\nexport function parsePolyesterEnvironment(environment: PolyesterEnvironment): PolyesterEnvironment {\n requireObject(environment, \"environment\");\n const parsed = createPolyesterEnvironment(environment);\n if (environment.fingerprint !== parsed.fingerprint) {\n throw new ConfigurationError(\n \"environment.fingerprint must match the environment configuration.\",\n );\n }\n return parsed;\n}\n\nexport const POLYESTER_DEVNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-devnet\",\n apiUrl: \"https://api-devnet.polyester.ai\",\n websocketUrl: \"wss://api-devnet.polyester.ai\",\n rpcUrl: \"https://rpc.polyester.tech\",\n chain: {\n id: 888168,\n name: \"Polyester Chain Devnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"POL\",\n symbol: \"POL\",\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.polyester.tech\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Polyester Scan\",\n url: \"https://devnet.polyesterscan.com\",\n },\n },\n contracts: {\n multicall3: {\n address: \"0xF35A6AE5408fa1356064849D0BC3855f801aa6aC\",\n blockCreated: 563457,\n },\n },\n },\n accountAbstraction: {\n bundlerUrl: \"https://bundler.polyester.tech\",\n paymasterUrl: \"https://paymaster.polyester.tech\",\n entryPoint: {\n address: \"0x59a4B77766509c4507D79eFF8089474eC3daC174\",\n version: \"0.7\",\n },\n safe: {\n version: \"1.4.1\",\n safeModuleSetupAddress: \"0x80791683D9C079A37Debc67EaDdbFcBC6f0FF2bB\",\n safe4337ModuleAddress: \"0x0713FF3d4c1b4f177833a372b1e3cb977540EA11\",\n safeProxyFactoryAddress: \"0xF8F0F649Dd3bFa9095206691E9fb2356c26216dE\",\n safeSingletonAddress: \"0x92abEa238FEA8908c397cE65366ea9278f0AeC7A\",\n multiSendAddress: \"0x70C8a8CcB45a8E2589B0f019374fc923dA34E4c7\",\n multiSendCallOnlyAddress: \"0x375C86a08DA98d1944D7B3c736307A72186CcAf1\",\n },\n },\n contracts: {\n tradingGatewayAddress: \"0xD3fecf5D39131e23b6B0f872cA0a21c8A5a30932\",\n },\n});\n\nexport const POLYESTER_TESTNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-testnet\",\n apiUrl: \"https://api-testnet.polyester.com\",\n websocketUrl: \"wss://api-testnet.polyester.com\",\n rpcUrl: \"https://rpc.polyester.live\",\n chain: {\n id: 888168,\n name: \"Polyester Chain Devnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"POL\",\n symbol: \"POL\",\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.polyester.live\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Polyester Scan\",\n url: \"https://testnet.polyesterscan.com\",\n },\n },\n contracts: {\n multicall3: {\n address: \"0xF35A6AE5408fa1356064849D0BC3855f801aa6aC\",\n blockCreated: 179823,\n },\n },\n },\n accountAbstraction: {\n bundlerUrl: \"https://bundler.polyester.live\",\n paymasterUrl: \"https://paymaster.polyester.live\",\n entryPoint: {\n address: \"0x35c524a72ffb4D348d616cDD340D176c8f3C8B2C\",\n version: \"0.7\",\n },\n safe: {\n version: \"1.4.1\",\n safeModuleSetupAddress: \"0xdA9510c95Ab50EAd5A3DD28FA6BACce497dCF1fB\",\n safe4337ModuleAddress: \"0xE278E4BCb71b095f7dAaa1bcEc1950696Fc40C74\",\n safeProxyFactoryAddress: \"0x2b8250158D58dD6D5e89313fa940586C9054A547\",\n safeSingletonAddress: \"0x6f00AB12B6A8aFf400F14f4Cd738549f0F53390d\",\n multiSendAddress: \"0xA38fEFA19ff5d8E3d988b2a0e6C8A2ae099fd97D\",\n multiSendCallOnlyAddress: \"0xE99b6c6d550B322347EeE11f4e8643377D8475A8\",\n },\n },\n contracts: {\n tradingGatewayAddress: \"0x20ef1BCeE69D73Ce1649E688dAA9A7AcF441f0EE\",\n },\n});\n"],"mappings":";;;AAyDA,MAAM,8BAAc,IAAI,IAAI;CAAC;CAAa;CAAa;CAAO;AAAO,CAAC;AAEtE,SAAS,cAAc,OAAgB,OAAyD;CAC5F,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAClE,MAAM,IAAI,mBAAmB,GAAG,MAAM,oBAAoB;AAElE;AAEA,SAAS,sBAAsB,OAAgB,OAAwC;CACnF,IAAI,OAAO,UAAU,YAAY,MAAM,KAAK,CAAC,CAAC,WAAW,GACrD,MAAM,IAAI,mBAAmB,GAAG,MAAM,6BAA6B;AAE3E;AAEA,SAAS,YAAY,UAA2B;CAC5C,OAAO,YAAY,IAAI,QAAQ;AACnC;AAEA,SAAS,aACL,OACA,OACA,kBACA,SACM;CACN,IAAI;CACJ,IAAI;EACA,MAAM,IAAI,IAAI,KAAK;CACvB,QAAQ;EACJ,MAAM,IAAI,mBAAmB,GAAG,MAAM,sBAAsB;CAChE;CAEA,IAAI,CAAC,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;EACA,WAAW,EACP,YAAY;GACR,SAAS;GACT,cAAc;EAClB,EACJ;CACJ;CACA,oBAAoB;EAChB,YAAY;EACZ,cAAc;EACd,YAAY;GACR,SAAS;GACT,SAAS;EACb;EACA,MAAM;GACF,SAAS;GACT,wBAAwB;GACxB,uBAAuB;GACvB,yBAAyB;GACzB,sBAAsB;GACtB,kBAAkB;GAClB,0BAA0B;EAC9B;CACJ;CACA,WAAW,EACP,uBAAuB,6CAC3B;AACJ,CAAC;AAE4C,2BAA2B;CACpE,MAAM;CACN,QAAQ;CACR,cAAc;CACd,QAAQ;CACR,OAAO;EACH,IAAI;EACJ,MAAM;EACN,gBAAgB;GACZ,UAAU;GACV,MAAM;GACN,QAAQ;EACZ;EACA,SAAS,EACL,SAAS,EACL,MAAM,CAAC,4BAA4B,EACvC,EACJ;EACA,gBAAgB,EACZ,SAAS;GACL,MAAM;GACN,KAAK;EACT,EACJ;EACA,WAAW,EACP,YAAY;GACR,SAAS;GACT,cAAc;EAClB,EACJ;CACJ;CACA,oBAAoB;EAChB,YAAY;EACZ,cAAc;EACd,YAAY;GACR,SAAS;GACT,SAAS;EACb;EACA,MAAM;GACF,SAAS;GACT,wBAAwB;GACxB,uBAAuB;GACvB,yBAAyB;GACzB,sBAAsB;GACtB,kBAAkB;GAClB,0BAA0B;EAC9B;CACJ;CACA,WAAW,EACP,uBAAuB,6CAC3B;AACJ,CAAC"}
1
+ {"version":3,"file":"environment.js","names":[],"sources":["../src/environment.ts"],"sourcesContent":["import type { SafeVersion } from \"permissionless/accounts\";\nimport { ConfigurationError } from \"./shared/errors.js\";\nimport type { Address, Chain } from \"viem\";\nimport { checksumEvmAddress, evmUtf8ToBytes, isEvmAddress, keccak256Hex } from \"./utils/evm.js\";\n\nexport interface PolyesterEntryPointConfig {\n readonly address: Address;\n readonly version: \"0.7\";\n}\n\nexport interface PolyesterSafeDeploymentConfig {\n readonly version: SafeVersion;\n readonly safeModuleSetupAddress: Address;\n readonly safe4337ModuleAddress: Address;\n readonly safeProxyFactoryAddress: Address;\n readonly safeSingletonAddress: Address;\n readonly multiSendAddress: Address;\n readonly multiSendCallOnlyAddress?: Address;\n}\n\nexport interface PolyesterAccountAbstractionEnvironment {\n readonly bundlerUrl: string;\n readonly paymasterUrl: string;\n readonly entryPoint: PolyesterEntryPointConfig;\n readonly safe: PolyesterSafeDeploymentConfig;\n}\n\nexport interface PolyesterContractsEnvironment {\n readonly tradingGatewayAddress: Address;\n}\n\nexport interface PolyesterEnvironment {\n readonly name: string;\n readonly fingerprint: string;\n readonly apiUrl: string;\n readonly websocketUrl: string;\n readonly rpcUrl: string;\n readonly chain: Chain;\n readonly accountAbstraction: PolyesterAccountAbstractionEnvironment;\n readonly contracts: PolyesterContractsEnvironment;\n}\n\nexport interface CreatePolyesterEnvironmentParams {\n readonly name: string;\n readonly apiUrl: string;\n readonly websocketUrl: string;\n readonly rpcUrl: string;\n readonly chain: Chain;\n readonly accountAbstraction: {\n readonly bundlerUrl: string;\n readonly paymasterUrl: string;\n readonly entryPoint: PolyesterEntryPointConfig;\n readonly safe: PolyesterSafeDeploymentConfig;\n };\n readonly contracts: PolyesterContractsEnvironment;\n}\n\nconst LOCAL_HOSTS = new Set([\"localhost\", \"127.0.0.1\", \"::1\", \"[::1]\"]);\n\nfunction requireObject(value: unknown, label: string): asserts value is Record<string, unknown> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new ConfigurationError(`${label} must be an object.`);\n }\n}\n\nfunction requireNonEmptyString(value: unknown, label: string): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new ConfigurationError(`${label} must be a non-empty string.`);\n }\n}\n\nfunction isLocalHost(hostname: string): boolean {\n return LOCAL_HOSTS.has(hostname);\n}\n\nfunction normalizeUrl(\n value: string,\n label: string,\n allowedProtocols: readonly string[],\n options?: { allowSearch?: boolean },\n): string {\n let url: URL;\n try {\n url = new URL(value);\n } catch {\n throw new ConfigurationError(`${label} must be a valid URL.`);\n }\n\n if (!allowedProtocols.includes(url.protocol)) {\n throw new ConfigurationError(`${label} must use ${allowedProtocols.join(\" or \")}.`);\n }\n\n const insecureRemote =\n (url.protocol === \"http:\" || url.protocol === \"ws:\") && !isLocalHost(url.hostname);\n if (insecureRemote) {\n throw new ConfigurationError(`${label} must use a secure protocol for remote hosts.`);\n }\n\n if (options?.allowSearch === false && url.search) {\n throw new ConfigurationError(`${label} must not include query parameters.`);\n }\n\n url.hash = \"\";\n return url.toString().replace(/\\/+$/u, \"\");\n}\n\nfunction normalizeAddress(value: Address, label: string): Address {\n if (!isEvmAddress(value)) {\n throw new ConfigurationError(`${label} must be a valid address.`);\n }\n return checksumEvmAddress(value);\n}\n\nfunction normalizeEntryPoint(entryPoint: PolyesterEntryPointConfig): PolyesterEntryPointConfig {\n requireObject(entryPoint, \"accountAbstraction.entryPoint\");\n if (entryPoint.version !== \"0.7\") {\n throw new ConfigurationError(\"accountAbstraction.entryPoint.version must be 0.7.\");\n }\n return Object.freeze({\n address: normalizeAddress(entryPoint.address, \"accountAbstraction.entryPoint.address\"),\n version: entryPoint.version,\n });\n}\n\nfunction normalizeSafeConfig(safe: PolyesterSafeDeploymentConfig): PolyesterSafeDeploymentConfig {\n requireObject(safe, \"accountAbstraction.safe\");\n if (safe.version !== \"1.4.1\" && safe.version !== \"1.5.0\") {\n throw new ConfigurationError(\n 'accountAbstraction.safe.version must be either \"1.4.1\" or \"1.5.0\".',\n );\n }\n return Object.freeze({\n version: safe.version,\n safeModuleSetupAddress: normalizeAddress(\n safe.safeModuleSetupAddress,\n \"accountAbstraction.safe.safeModuleSetupAddress\",\n ),\n safe4337ModuleAddress: normalizeAddress(\n safe.safe4337ModuleAddress,\n \"accountAbstraction.safe.safe4337ModuleAddress\",\n ),\n safeProxyFactoryAddress: normalizeAddress(\n safe.safeProxyFactoryAddress,\n \"accountAbstraction.safe.safeProxyFactoryAddress\",\n ),\n safeSingletonAddress: normalizeAddress(\n safe.safeSingletonAddress,\n \"accountAbstraction.safe.safeSingletonAddress\",\n ),\n multiSendAddress: normalizeAddress(\n safe.multiSendAddress,\n \"accountAbstraction.safe.multiSendAddress\",\n ),\n multiSendCallOnlyAddress: safe.multiSendCallOnlyAddress\n ? normalizeAddress(\n safe.multiSendCallOnlyAddress,\n \"accountAbstraction.safe.multiSendCallOnlyAddress\",\n )\n : undefined,\n });\n}\n\nfunction normalizeChain(chain: Chain, rpcUrl: string): Chain {\n requireObject(chain, \"chain\");\n if (!Number.isInteger(chain.id) || chain.id <= 0) {\n throw new ConfigurationError(\"chain.id must be a positive integer.\");\n }\n requireNonEmptyString(chain.name, \"chain.name\");\n requireObject(chain.nativeCurrency, \"chain.nativeCurrency\");\n if (!Number.isInteger(chain.nativeCurrency.decimals) || chain.nativeCurrency.decimals < 0) {\n throw new ConfigurationError(\n \"chain.nativeCurrency.decimals must be a non-negative integer.\",\n );\n }\n requireNonEmptyString(chain.nativeCurrency.name, \"chain.nativeCurrency.name\");\n requireNonEmptyString(chain.nativeCurrency.symbol, \"chain.nativeCurrency.symbol\");\n requireObject(chain.rpcUrls, \"chain.rpcUrls\");\n requireObject(chain.rpcUrls.default, \"chain.rpcUrls.default\");\n if (!Array.isArray(chain.rpcUrls.default.http)) {\n throw new ConfigurationError(\"chain.rpcUrls.default.http must be an array.\");\n }\n\n // Shape parity with viem's defineChain: spread over undefined defaults.\n return Object.freeze({\n formatters: undefined,\n fees: undefined,\n serializers: undefined,\n ...chain,\n rpcUrls: {\n ...chain.rpcUrls,\n default: {\n ...chain.rpcUrls.default,\n http: [rpcUrl],\n },\n },\n });\n}\n\nfunction environmentFingerprint(input: {\n apiUrl: string;\n websocketUrl: string;\n rpcUrl: string;\n chainId: number;\n accountAbstraction: PolyesterAccountAbstractionEnvironment;\n contracts: PolyesterContractsEnvironment;\n}): string {\n return keccak256Hex(\n evmUtf8ToBytes(\n JSON.stringify({\n apiUrl: input.apiUrl,\n websocketUrl: input.websocketUrl,\n rpcUrl: input.rpcUrl,\n chainId: input.chainId,\n bundlerUrl: input.accountAbstraction.bundlerUrl,\n paymasterUrl: input.accountAbstraction.paymasterUrl,\n entryPoint: input.accountAbstraction.entryPoint,\n safe: input.accountAbstraction.safe,\n contracts: input.contracts,\n }),\n ),\n );\n}\n\n/**\n * Creates a complete SDK environment configuration from entrypoint and contract settings.\n */\nexport function createPolyesterEnvironment(\n params: CreatePolyesterEnvironmentParams,\n): PolyesterEnvironment {\n requireObject(params, \"Environment configuration\");\n requireNonEmptyString(params.name, \"name\");\n requireObject(params.accountAbstraction, \"accountAbstraction\");\n requireObject(params.contracts, \"contracts\");\n const apiUrl = normalizeUrl(params.apiUrl, \"apiUrl\", [\"https:\", \"http:\"], {\n allowSearch: false,\n });\n const websocketUrl = normalizeUrl(params.websocketUrl, \"websocketUrl\", [\"wss:\", \"ws:\"]);\n const rpcUrl = normalizeUrl(params.rpcUrl, \"rpcUrl\", [\"https:\", \"http:\"]);\n const bundlerUrl = normalizeUrl(params.accountAbstraction.bundlerUrl, \"bundlerUrl\", [\n \"https:\",\n \"http:\",\n ]);\n const paymasterUrl = normalizeUrl(params.accountAbstraction.paymasterUrl, \"paymasterUrl\", [\n \"https:\",\n \"http:\",\n ]);\n const chain = normalizeChain(params.chain, rpcUrl);\n const accountAbstraction = Object.freeze({\n bundlerUrl,\n paymasterUrl,\n entryPoint: normalizeEntryPoint(params.accountAbstraction.entryPoint),\n safe: normalizeSafeConfig(params.accountAbstraction.safe),\n });\n const contracts = Object.freeze({\n tradingGatewayAddress: normalizeAddress(\n params.contracts.tradingGatewayAddress,\n \"contracts.tradingGatewayAddress\",\n ),\n });\n const fingerprint = environmentFingerprint({\n apiUrl,\n websocketUrl,\n rpcUrl,\n chainId: chain.id,\n accountAbstraction,\n contracts,\n });\n\n return Object.freeze({\n name: params.name,\n fingerprint,\n apiUrl,\n websocketUrl,\n rpcUrl,\n chain,\n accountAbstraction,\n contracts,\n });\n}\n\n/**\n * Parses a complete environment supplied to a public SDK client constructor.\n */\nexport function parsePolyesterEnvironment(environment: PolyesterEnvironment): PolyesterEnvironment {\n requireObject(environment, \"environment\");\n const parsed = createPolyesterEnvironment(environment);\n if (environment.fingerprint !== parsed.fingerprint) {\n throw new ConfigurationError(\n \"environment.fingerprint must match the environment configuration.\",\n );\n }\n return parsed;\n}\n\nexport const POLYESTER_DEVNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-devnet\",\n apiUrl: \"https://api-devnet.polyester.ai\",\n websocketUrl: \"wss://api-devnet.polyester.ai\",\n rpcUrl: \"https://rpc.polyester.tech\",\n chain: {\n id: 888168,\n name: \"Polyester Chain Devnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"POL\",\n symbol: \"POL\",\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.polyester.tech\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Polyester Scan\",\n url: \"https://devnet.polyesterscan.com\",\n },\n },\n contracts: {\n multicall3: {\n address: \"0xF35A6AE5408fa1356064849D0BC3855f801aa6aC\",\n blockCreated: 563457,\n },\n },\n },\n accountAbstraction: {\n bundlerUrl: \"https://bundler.polyester.tech\",\n paymasterUrl: \"https://paymaster.polyester.tech\",\n entryPoint: {\n address: \"0x59a4B77766509c4507D79eFF8089474eC3daC174\",\n version: \"0.7\",\n },\n safe: {\n version: \"1.4.1\",\n safeModuleSetupAddress: \"0x80791683D9C079A37Debc67EaDdbFcBC6f0FF2bB\",\n safe4337ModuleAddress: \"0x0713FF3d4c1b4f177833a372b1e3cb977540EA11\",\n safeProxyFactoryAddress: \"0xF8F0F649Dd3bFa9095206691E9fb2356c26216dE\",\n safeSingletonAddress: \"0x92abEa238FEA8908c397cE65366ea9278f0AeC7A\",\n multiSendAddress: \"0x70C8a8CcB45a8E2589B0f019374fc923dA34E4c7\",\n multiSendCallOnlyAddress: \"0x375C86a08DA98d1944D7B3c736307A72186CcAf1\",\n },\n },\n contracts: {\n tradingGatewayAddress: \"0xD3fecf5D39131e23b6B0f872cA0a21c8A5a30932\",\n },\n});\n\nexport const POLYESTER_TESTNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-testnet\",\n apiUrl: \"https://api-testnet.polyester.com\",\n websocketUrl: \"wss://api-testnet.polyester.com\",\n rpcUrl: \"https://rpc.polyester.live\",\n chain: {\n id: 888169,\n name: \"Polyester Chain Testnet\",\n nativeCurrency: {\n decimals: 18,\n name: \"POL\",\n symbol: \"POL\",\n },\n rpcUrls: {\n default: {\n http: [\"https://rpc.polyester.live\"],\n },\n },\n blockExplorers: {\n default: {\n name: \"Polyester Scan\",\n url: \"https://testnet.polyesterscan.com\",\n },\n },\n contracts: {\n multicall3: {\n address: \"0xF35A6AE5408fa1356064849D0BC3855f801aa6aC\",\n blockCreated: 179823,\n },\n },\n },\n accountAbstraction: {\n bundlerUrl: \"https://bundler.polyester.live\",\n paymasterUrl: \"https://paymaster.polyester.live\",\n entryPoint: {\n address: \"0x35c524a72ffb4D348d616cDD340D176c8f3C8B2C\",\n version: \"0.7\",\n },\n safe: {\n version: \"1.4.1\",\n safeModuleSetupAddress: \"0xdA9510c95Ab50EAd5A3DD28FA6BACce497dCF1fB\",\n safe4337ModuleAddress: \"0xE278E4BCb71b095f7dAaa1bcEc1950696Fc40C74\",\n safeProxyFactoryAddress: \"0x2b8250158D58dD6D5e89313fa940586C9054A547\",\n safeSingletonAddress: \"0x6f00AB12B6A8aFf400F14f4Cd738549f0F53390d\",\n multiSendAddress: \"0xA38fEFA19ff5d8E3d988b2a0e6C8A2ae099fd97D\",\n multiSendCallOnlyAddress: \"0xE99b6c6d550B322347EeE11f4e8643377D8475A8\",\n },\n },\n contracts: {\n tradingGatewayAddress: \"0x20ef1BCeE69D73Ce1649E688dAA9A7AcF441f0EE\",\n },\n});\n"],"mappings":";;;AAyDA,MAAM,8BAAc,IAAI,IAAI;CAAC;CAAa;CAAa;CAAO;AAAO,CAAC;AAEtE,SAAS,cAAc,OAAgB,OAAyD;CAC5F,IAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ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B,sBAAsB;GACtB,kBAAkB;GAClB,0BAA0B;EAC9B;CACJ;CACA,WAAW,EACP,uBAAuB,6CAC3B;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AccountSigner, AccountSignerConfig, AccountSignerFactory, HexAddress } from "./account-signer/types.js";
2
- import { CreatePolyesterEnvironmentParams, POLYESTER_DEVNET_ENVIRONMENT, PolyesterAccountAbstractionEnvironment, PolyesterContractsEnvironment, PolyesterEntryPointConfig, PolyesterEnvironment, PolyesterSafeDeploymentConfig, createPolyesterEnvironment } from "./environment.js";
2
+ import { CreatePolyesterEnvironmentParams, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_TESTNET_ENVIRONMENT, PolyesterAccountAbstractionEnvironment, PolyesterContractsEnvironment, PolyesterEntryPointConfig, PolyesterEnvironment, PolyesterSafeDeploymentConfig, createPolyesterEnvironment } from "./environment.js";
3
3
  import { CreatePolyesterAccountSignerParams } from "./account-signer/create-polyester-account-signer.js";
4
4
  import "./account-signer/index.js";
5
5
  import { AssetConfig, DepositWithdrawConfig, PairConfig, PairStatus, SpotConfig, ZipperAssetChainVariant, ZipperAssetConfig, ZipperChainConfig, ZipperChainContractConfig } from "./shared/catalog-config.js";
@@ -105,4 +105,4 @@ import "./services/triggers/triggers.types.js";
105
105
  import "./services/vip/vip.types.js";
106
106
  import "./services/whiteboard/whiteboard.types.js";
107
107
  import "./services/zipper/zipper.types.js";
108
- export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, type ActiveAccountInfo, type AddressBook, type AddressBookEntries, type AddressBookEntriesView, type AddressBookEntry, type AddressBookRecentDestinationsView, type AddressBookTag, type AddressBookTagSummary, type AddressBookView, type AddressBookViewInvalidated, AlreadyExistsError, type ApiKey, type ApiKeyEd25519AuthProvider, type ApiKeyIdInput, type ApiKeyPolicy, type ApiKeyPolicyApplyInput, type ApiKeyPolicyCreateInput, type ApiKeyPolicyUpdateInput, type ApiKeyStatus, type ApiKeysCreateInput, type ApiKeysListInput, type ApiKeysUpdateInput, type ArchiveWhiteboardBoardInput, type ArchiveWhiteboardBoardResult, type AssetConfig, type AuthHydrationData, type AuthLoginMethod, type AuthState, type AuthTokenStorage, type AuthTokenStorageSetOptions, AuthenticationError, type BalanceHistoryInput, type BalanceHistoryResponse, type BalanceRange, type BatchCancelOrderInput, type BatchCancelOrderResult, type BatchCancelOrdersInput, type BatchCancelOrdersResult, type BatchCreateOrderResult, type BatchCreateOrdersInput, type BatchCreateOrdersResult, type BatchGuardApprovals, type BatchReplaceAdmissionItem, type BatchReplaceOrdersInput, type BatchReplaceOrdersResult, type BatchSignProtectedActionInput, type BeginMfaChallengeInput, type BeginMfaChallengeResult, type BeginPasskeyEnrollmentInput, type BeginPasskeyEnrollmentResult, type BeginTotpEnrollmentInput, type BeginTotpEnrollmentResult, type CancelAllAfterInput, type CancelAllAfterResult, type CancelAllOrdersInput, type CancelAllOrdersResponse, type CancelOrderInput, type CancelOrderResult, type CancelTriggerInput, type CancelTriggerResult, type Candle, type CandleColumnar, type CandleColumnarInt, type CandleInt, type ChainAnalyticsRange, type ClaimFreshStepUpInput, type ClaimFreshStepUpResult, type ClaimGeneratedUsernameInput, type ColumnarTimeWindow, type CompleteMfaChallengeResult, ConfigurationError, type ConnectChannelParams, type ConsumeFreshStepUpInput, type CookieAuthTokenStorageOptions, type CopyAddressBookEntryInput, type CreateAddressBookEntryInput, type CreateAddressBookTagInput, type CreateDepositAddressInput, type CreateGuardSignerWalletResult, type CreateInternalTransferInput, type CreateInternalTransferResult, type CreateOrderResult, type CreateOrderbookSubscriptionInput, type CreatePolyesterAccountSignerParams, type CreatePolyesterEnvironmentParams, type CreateServerClientFromCookiesParams, type CreateServerClientFromRequestParams, type CreateSubaccountInput, type CreateSubaccountParams, type CreateSubaccountResult$1 as CreateSubaccountResult, type CreateSubaccountResult$1 as CreateSubaccountServiceResult, type CreateTradingWithdrawResult, type CreateTradingWithdrawToExternalChainInput, type CreateTradingWithdrawToExternalChainServiceInput, type CreateTradingWithdrawToFundingInput, type CreateTradingWithdrawToFundingServiceInput, type CreateTriggerInput, type CreateTriggerResult, type CreateWhiteboardBoardInput, type CreateWhiteboardBoardResult, type CurrencyConversionConfig, type CurrencyConversionRates, type CurrencyMetadata, type DeleteAddressBookEntryInput, type DeleteAddressBookTagInput, type DeleteMfaFactorInput, type DepositAddress, type DepositWithdrawConfig, type EffectiveSubaccountPermissions, type EquityGroupBy, type EquityHistoryInput, type EquityHistoryResponse, type EquitySeries, type EquitySeriesGrouping, type EvmHex, type ExportGuardSignerWalletResult, type FiatConversionRate, type FiatConversionSnapshot, type FinishPasskeyChallengeInput, type FinishPasskeyEnrollmentInput, type FinishPasskeyEnrollmentResult, type FinishTotpEnrollmentInput, type FinishTotpEnrollmentResult, type GeneratedUsernameOffer, type GetAddressBookViewInput, type GetBatchReplaceStatusInput, type GetBatchReplaceStatusResult, type GetCandlesColumnsInput, type GetCandlesInput, type GetLifecycleFlowInput, type GetLifecycleFlowOutput, type GetMarketTradesInput, type GetOrderDetailsInput, type GetOrderbookHeatmapInput, type GetOrderbookInput, type GetSpotFeeRatesInput, type GetTriggerInput, type GetUnifiedAssetBalancesInput, type GetUserTradesInput, type GetVerificationResponse, type GetWhiteboardBoardInput, type GetWhiteboardBoardResult, type GetZippedAssetSupplyGroupInput, type GetZippedAssetSupplyInput, type GuardApproval, type GuardSignerScopedInput, type GuardSignerStatus, type HeatmapDepthValue, type HeatmapIntervalValue, type HeatmapQuantityModeValue, type HexAddress, InternalServerError, type InternalTransferDestination, type InternalTransferWhitelistEntries, type InternalTransferWhitelistEntry, type InviteSubaccountMemberInput, type JwtAuthProvider, type LadderDetailsOutput, type LedgerBalance, type LedgerTransfer, type LedgerTransferSide, type LifecycleAssetIds, type LifecycleFlowDetail, type LifecycleFlowState, type LifecycleFlowStep, type LifecycleFlowStepActivity, type LifecycleFlowSummary, type LifecycleFlowSummaryProgress, type LifecycleFlowTimelineItem, type LifecycleFlowTxMatch, type LifecycleListOrderBy, type LifecycleListScope, type LifecycleReason, type LifecycleRequestFee, type LifecycleRequestFeeStatus, type LifecycleSort, type LifecycleTxLookupKind, type LifecycleZipperReason, type ListAddressBookEntriesInput, type ListApiKeyPoliciesResponse, type ListDepositAddressesInput, type ListInternalTransferWhitelistEntriesInput, type ListLifecycleFlowsByTxInput, type ListLifecycleFlowsByTxOutput, type ListLifecycleFlowsInput, type ListLifecycleFlowsOutput, type ListMarketOverviewInput, type ListMfaFactorsResult, type ListSubaccountInvitesInput, type ListTransferCounterpartiesInput, type ListTransferDestinationsInput, type ListTransfersInput, type ListTriggerEventsInput, type ListTriggerEventsResult, type ListTriggersInput, type ListTriggersResult, type ListWhiteboardBoardsInput, type ListWhiteboardBoardsResult, type LoginOptions, type LoginResult, type LoginWithWalletInput, type LoginWithWalletResponse, type MarketOverview, type MarketOverviewOrderBy, type MarketOverviewSort, type MarketOverviewSparkline, type MarketTrade, type Me, MfaEnrollmentRequiredError, type MfaFactor, MfaLastFactorRequiredError, MfaRequiredError, type MfaSessionInfo, MfaVerificationError, type MfaVerificationFailureReason, type MintWhiteboardJoinTokenInput, type MirroredWithdrawWhitelistEntry, type ModifyOrderInput, type ModifyOrderResult, type ModifyTriggerInput, type ModifyTriggerResult, NetworkError, type NewOrderInput, type NextVipTierThresholds, type Nonce, type OpenOrdersInput, type Order, type OrderDetails, type OrderErrorCode, type OrderErrorDetail, type OrderHistoryInput, type OrderIntentInput, type OrderTransfer, type OrderbookData, type OrderbookHeatmapDeltaBucket, type OrderbookHeatmapDeltaChain, type OrderbookHeatmapDeltaLevels, type OrderbookHeatmapKeyframe, type OrderbookHeatmapLevels, type OrderbookHeatmapLiveBucket, type OrderbookHeatmapResponse, type OrderbookLevel, type OrderbookStreamHandlers, type OrderbookSubscription, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, type PairConfig, type PairStatus, type PauseTriggerInput, type PauseTriggerResult, PermissionError, type PolicyAction, PolicyInUseError, PolicyLockedError, type PolicyMarketScope, PolicyScopeMismatchError, type PolyesterAccountAbstractionEnvironment, PolyesterBrowserClient, type PolyesterBrowserClientConfig, PolyesterClient, type PolyesterClientBaseConfig, type PolyesterClientConfig, type PolyesterContractsEnvironment, type PolyesterEntryPointConfig, type PolyesterEnvironment, PolyesterError, type PolyesterErrorCode, type PolyesterErrorDetail, type PolyesterErrorOptions, type PolyesterMutationOptions, type PolyesterRealtime, type PolyesterRealtimeAuthConfig, type PolyesterRequestOptions, type PolyesterSafeDeploymentConfig, PolyesterServerClient, type PolyesterServerClientConfig, type PortfolioEquityHistoryInput, type PortfolioEquityHistoryResponse, type PortfolioEquitySeries, type PortfolioEquitySeriesGrouping, type PortfolioEquitySnapshotResponse, PreconditionFailedError, type PreparedTradingWithdraw, type PreviewOrderResult, type Profile, type RateLimitConfig, type RateLimitDetail, RateLimitError, type RateLimitErrorOptions, type RateLimitFailureReason, type RateLimitPolicyClass, type RateLimitRefillModel, type RateLimitScope, type RegenerateRecoveryCodesInput, type RegenerateRecoveryCodesResult, type ReleaseFreshStepUpInput, type RemoveSubaccountMemberInput, RequestError, type ResolveAccountInput, type ResolvedAccount, type ResolvedInternalTransferDestination, ResourceNotFoundError, type RespondSubaccountInviteInput, type ResumeTriggerInput, type ResumeTriggerResult, RevisionConflictError, type RiskPolicyInput, type RotateGuardSignerWalletResult, type SdkSubscriptionErrorContext, type ServerSessionSnapshot, ServiceUnavailableError, type SessionData, SessionElevationRequiredError, type SetSubaccountMemberMfaRequirementInput, type SignProtectedActionInput, type SocialProvider, type SocialProviderInput, type SocialVerification, type SocialVerificationMethod, type SocialVerificationStatus, type SparklineIntervalName, type SpotConfig, type SpotFeeRate, type SpotPairVolumeSeries, type SpotVolumeHistoryInput, type SpotVolumeHistoryResponse, type StablecoinConversionRate, StaleQuoteError, type StartVerificationInput, type StartVerificationResponse, StepUpRequiredError, type StopDetailsOutput, type StopLossInput, type Subaccount, type SubaccountActivityInput, type SubaccountEvent, type SubaccountIdInput, type SubaccountInvite, type SubaccountInviteStatus, type SubaccountMember, type SubaccountPermission, type SubaccountPermissionDefinition, type SubaccountPolicy, type SubaccountPolicyApplyInput, type SubaccountPolicyCreateInput, type SubaccountPolicyUpdateInput, type SubaccountRole, type SubaccountRoleCatalog, type SubaccountRoleDefinition, type SubaccountScopedInput, type SubaccountStatus, type SubscribeHandlers, type SubscribeZippedAssetSupplyInput, type TakeProfitInput, type Timeframe, TimeoutError, type Trade, type TradingRateLimitClass, type TradingRateLimitRule, type TradingRateLimits, type TradingWithdrawSigningConfig, type TradingWithdrawWalletSigner, type TradingWithdrawWalletTypedData, type TrailingDetailsOutput, type TrailingStopInput, type TransferCodeValue, type TransferCounterparties, type TransferCounterparty, type TransferDestination, type TransferDestinations, type TransferSideKind, TransientError, type Transports, type Trigger, type TriggerDetailsOutput, type TriggerEvent, type TwapDetailsOutput, type UnifiedAssetBalancesResponse, type UpdateAddressBookEntryInput, type UpdateAddressBookTagInput, type UpdateMfaFactorInput, type UpdateMfaFactorResult, type UpdateProfileInput, type UpdateSubaccountInput, type UpdateSubaccountMemberRoleInput, type UpdateWhiteboardBoardAclInput, type UpdateWhiteboardBoardAclResult, type UpdateWhiteboardBoardInput, type UpdateWhiteboardBoardResult, type UsernameHistoryEntry, type ValidateWithdrawDestinationInput, type ValidateWithdrawDestinationResult, ValidationError, type VerificationReadyResponse, type VerifyRecoveryCodeChallengeInput, type VerifyTotpChallengeInput, type VipStatus, type VipTier, type VipTierCatalog, type WhiteboardAccess, type WhiteboardAclEntry, type WhiteboardAclEntryInput, type WhiteboardAclSubjectType, type WhiteboardAudience, type WhiteboardBoard, type WhiteboardBoardDetails, type WhiteboardBoardListItem, type WhiteboardJoinTokenResult, type WhiteboardPermissions, type WhiteboardPresencePayload, type WhiteboardResolvedRole, type WhiteboardSnapshot, type WhiteboardWritableRole, type WithdrawWhitelistView, type ZippedAssetSupplyBatch, type ZippedAssetSupplyGroupResponse, type ZippedAssetSupplyResponse, type ZippedAssetSupplySeries, type ZippedAssetSupplyUpdate, type ZipperAssetChainVariant, type ZipperAssetConfig, type ZipperChainConfig, type ZipperChainContractConfig, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, keccak256Hex, mergeLedgerBalances, normalizeErrorMessage, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
108
+ export { type AccountCodeValue, type AccountIdentity, type AccountScope, type AccountScopedInput, type AccountSigner, type AccountSignerAuthEvents, type AccountSignerConfig, type CreateSubaccountResult as AccountSignerCreateSubaccountResult, type AccountSignerFactory, type ActiveAccountInfo, type AddressBook, type AddressBookEntries, type AddressBookEntriesView, type AddressBookEntry, type AddressBookRecentDestinationsView, type AddressBookTag, type AddressBookTagSummary, type AddressBookView, type AddressBookViewInvalidated, AlreadyExistsError, type ApiKey, type ApiKeyEd25519AuthProvider, type ApiKeyIdInput, type ApiKeyPolicy, type ApiKeyPolicyApplyInput, type ApiKeyPolicyCreateInput, type ApiKeyPolicyUpdateInput, type ApiKeyStatus, type ApiKeysCreateInput, type ApiKeysListInput, type ApiKeysUpdateInput, type ArchiveWhiteboardBoardInput, type ArchiveWhiteboardBoardResult, type AssetConfig, type AuthHydrationData, type AuthLoginMethod, type AuthState, type AuthTokenStorage, type AuthTokenStorageSetOptions, AuthenticationError, type BalanceHistoryInput, type BalanceHistoryResponse, type BalanceRange, type BatchCancelOrderInput, type BatchCancelOrderResult, type BatchCancelOrdersInput, type BatchCancelOrdersResult, type BatchCreateOrderResult, type BatchCreateOrdersInput, type BatchCreateOrdersResult, type BatchGuardApprovals, type BatchReplaceAdmissionItem, type BatchReplaceOrdersInput, type BatchReplaceOrdersResult, type BatchSignProtectedActionInput, type BeginMfaChallengeInput, type BeginMfaChallengeResult, type BeginPasskeyEnrollmentInput, type BeginPasskeyEnrollmentResult, type BeginTotpEnrollmentInput, type BeginTotpEnrollmentResult, type CancelAllAfterInput, type CancelAllAfterResult, type CancelAllOrdersInput, type CancelAllOrdersResponse, type CancelOrderInput, type CancelOrderResult, type CancelTriggerInput, type CancelTriggerResult, type Candle, type CandleColumnar, type CandleColumnarInt, type CandleInt, type ChainAnalyticsRange, type ClaimFreshStepUpInput, type ClaimFreshStepUpResult, type ClaimGeneratedUsernameInput, type ColumnarTimeWindow, type CompleteMfaChallengeResult, ConfigurationError, type ConnectChannelParams, type ConsumeFreshStepUpInput, type CookieAuthTokenStorageOptions, type CopyAddressBookEntryInput, type CreateAddressBookEntryInput, type CreateAddressBookTagInput, type CreateDepositAddressInput, type CreateGuardSignerWalletResult, type CreateInternalTransferInput, type CreateInternalTransferResult, type CreateOrderResult, type CreateOrderbookSubscriptionInput, type CreatePolyesterAccountSignerParams, type CreatePolyesterEnvironmentParams, type CreateServerClientFromCookiesParams, type CreateServerClientFromRequestParams, type CreateSubaccountInput, type CreateSubaccountParams, type CreateSubaccountResult$1 as CreateSubaccountResult, type CreateSubaccountResult$1 as CreateSubaccountServiceResult, type CreateTradingWithdrawResult, type CreateTradingWithdrawToExternalChainInput, type CreateTradingWithdrawToExternalChainServiceInput, type CreateTradingWithdrawToFundingInput, type CreateTradingWithdrawToFundingServiceInput, type CreateTriggerInput, type CreateTriggerResult, type CreateWhiteboardBoardInput, type CreateWhiteboardBoardResult, type CurrencyConversionConfig, type CurrencyConversionRates, type CurrencyMetadata, type DeleteAddressBookEntryInput, type DeleteAddressBookTagInput, type DeleteMfaFactorInput, type DepositAddress, type DepositWithdrawConfig, type EffectiveSubaccountPermissions, type EquityGroupBy, type EquityHistoryInput, type EquityHistoryResponse, type EquitySeries, type EquitySeriesGrouping, type EvmHex, type ExportGuardSignerWalletResult, type FiatConversionRate, type FiatConversionSnapshot, type FinishPasskeyChallengeInput, type FinishPasskeyEnrollmentInput, type FinishPasskeyEnrollmentResult, type FinishTotpEnrollmentInput, type FinishTotpEnrollmentResult, type GeneratedUsernameOffer, type GetAddressBookViewInput, type GetBatchReplaceStatusInput, type GetBatchReplaceStatusResult, type GetCandlesColumnsInput, type GetCandlesInput, type GetLifecycleFlowInput, type GetLifecycleFlowOutput, type GetMarketTradesInput, type GetOrderDetailsInput, type GetOrderbookHeatmapInput, type GetOrderbookInput, type GetSpotFeeRatesInput, type GetTriggerInput, type GetUnifiedAssetBalancesInput, type GetUserTradesInput, type GetVerificationResponse, type GetWhiteboardBoardInput, type GetWhiteboardBoardResult, type GetZippedAssetSupplyGroupInput, type GetZippedAssetSupplyInput, type GuardApproval, type GuardSignerScopedInput, type GuardSignerStatus, type HeatmapDepthValue, type HeatmapIntervalValue, type HeatmapQuantityModeValue, type HexAddress, InternalServerError, type InternalTransferDestination, type InternalTransferWhitelistEntries, type InternalTransferWhitelistEntry, type InviteSubaccountMemberInput, type JwtAuthProvider, type LadderDetailsOutput, type LedgerBalance, type LedgerTransfer, type LedgerTransferSide, type LifecycleAssetIds, type LifecycleFlowDetail, type LifecycleFlowState, type LifecycleFlowStep, type LifecycleFlowStepActivity, type LifecycleFlowSummary, type LifecycleFlowSummaryProgress, type LifecycleFlowTimelineItem, type LifecycleFlowTxMatch, type LifecycleListOrderBy, type LifecycleListScope, type LifecycleReason, type LifecycleRequestFee, type LifecycleRequestFeeStatus, type LifecycleSort, type LifecycleTxLookupKind, type LifecycleZipperReason, type ListAddressBookEntriesInput, type ListApiKeyPoliciesResponse, type ListDepositAddressesInput, type ListInternalTransferWhitelistEntriesInput, type ListLifecycleFlowsByTxInput, type ListLifecycleFlowsByTxOutput, type ListLifecycleFlowsInput, type ListLifecycleFlowsOutput, type ListMarketOverviewInput, type ListMfaFactorsResult, type ListSubaccountInvitesInput, type ListTransferCounterpartiesInput, type ListTransferDestinationsInput, type ListTransfersInput, type ListTriggerEventsInput, type ListTriggerEventsResult, type ListTriggersInput, type ListTriggersResult, type ListWhiteboardBoardsInput, type ListWhiteboardBoardsResult, type LoginOptions, type LoginResult, type LoginWithWalletInput, type LoginWithWalletResponse, type MarketOverview, type MarketOverviewOrderBy, type MarketOverviewSort, type MarketOverviewSparkline, type MarketTrade, type Me, MfaEnrollmentRequiredError, type MfaFactor, MfaLastFactorRequiredError, MfaRequiredError, type MfaSessionInfo, MfaVerificationError, type MfaVerificationFailureReason, type MintWhiteboardJoinTokenInput, type MirroredWithdrawWhitelistEntry, type ModifyOrderInput, type ModifyOrderResult, type ModifyTriggerInput, type ModifyTriggerResult, NetworkError, type NewOrderInput, type NextVipTierThresholds, type Nonce, type OpenOrdersInput, type Order, type OrderDetails, type OrderErrorCode, type OrderErrorDetail, type OrderHistoryInput, type OrderIntentInput, type OrderTransfer, type OrderbookData, type OrderbookHeatmapDeltaBucket, type OrderbookHeatmapDeltaChain, type OrderbookHeatmapDeltaLevels, type OrderbookHeatmapKeyframe, type OrderbookHeatmapLevels, type OrderbookHeatmapLiveBucket, type OrderbookHeatmapResponse, type OrderbookLevel, type OrderbookStreamHandlers, type OrderbookSubscription, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, type PairConfig, type PairStatus, type PauseTriggerInput, type PauseTriggerResult, PermissionError, type PolicyAction, PolicyInUseError, PolicyLockedError, type PolicyMarketScope, PolicyScopeMismatchError, type PolyesterAccountAbstractionEnvironment, PolyesterBrowserClient, type PolyesterBrowserClientConfig, PolyesterClient, type PolyesterClientBaseConfig, type PolyesterClientConfig, type PolyesterContractsEnvironment, type PolyesterEntryPointConfig, type PolyesterEnvironment, PolyesterError, type PolyesterErrorCode, type PolyesterErrorDetail, type PolyesterErrorOptions, type PolyesterMutationOptions, type PolyesterRealtime, type PolyesterRealtimeAuthConfig, type PolyesterRequestOptions, type PolyesterSafeDeploymentConfig, PolyesterServerClient, type PolyesterServerClientConfig, type PortfolioEquityHistoryInput, type PortfolioEquityHistoryResponse, type PortfolioEquitySeries, type PortfolioEquitySeriesGrouping, type PortfolioEquitySnapshotResponse, PreconditionFailedError, type PreparedTradingWithdraw, type PreviewOrderResult, type Profile, type RateLimitConfig, type RateLimitDetail, RateLimitError, type RateLimitErrorOptions, type RateLimitFailureReason, type RateLimitPolicyClass, type RateLimitRefillModel, type RateLimitScope, type RegenerateRecoveryCodesInput, type RegenerateRecoveryCodesResult, type ReleaseFreshStepUpInput, type RemoveSubaccountMemberInput, RequestError, type ResolveAccountInput, type ResolvedAccount, type ResolvedInternalTransferDestination, ResourceNotFoundError, type RespondSubaccountInviteInput, type ResumeTriggerInput, type ResumeTriggerResult, RevisionConflictError, type RiskPolicyInput, type RotateGuardSignerWalletResult, type SdkSubscriptionErrorContext, type ServerSessionSnapshot, ServiceUnavailableError, type SessionData, SessionElevationRequiredError, type SetSubaccountMemberMfaRequirementInput, type SignProtectedActionInput, type SocialProvider, type SocialProviderInput, type SocialVerification, type SocialVerificationMethod, type SocialVerificationStatus, type SparklineIntervalName, type SpotConfig, type SpotFeeRate, type SpotPairVolumeSeries, type SpotVolumeHistoryInput, type SpotVolumeHistoryResponse, type StablecoinConversionRate, StaleQuoteError, type StartVerificationInput, type StartVerificationResponse, StepUpRequiredError, type StopDetailsOutput, type StopLossInput, type Subaccount, type SubaccountActivityInput, type SubaccountEvent, type SubaccountIdInput, type SubaccountInvite, type SubaccountInviteStatus, type SubaccountMember, type SubaccountPermission, type SubaccountPermissionDefinition, type SubaccountPolicy, type SubaccountPolicyApplyInput, type SubaccountPolicyCreateInput, type SubaccountPolicyUpdateInput, type SubaccountRole, type SubaccountRoleCatalog, type SubaccountRoleDefinition, type SubaccountScopedInput, type SubaccountStatus, type SubscribeHandlers, type SubscribeZippedAssetSupplyInput, type TakeProfitInput, type Timeframe, TimeoutError, type Trade, type TradingRateLimitClass, type TradingRateLimitRule, type TradingRateLimits, type TradingWithdrawSigningConfig, type TradingWithdrawWalletSigner, type TradingWithdrawWalletTypedData, type TrailingDetailsOutput, type TrailingStopInput, type TransferCodeValue, type TransferCounterparties, type TransferCounterparty, type TransferDestination, type TransferDestinations, type TransferSideKind, TransientError, type Transports, type Trigger, type TriggerDetailsOutput, type TriggerEvent, type TwapDetailsOutput, type UnifiedAssetBalancesResponse, type UpdateAddressBookEntryInput, type UpdateAddressBookTagInput, type UpdateMfaFactorInput, type UpdateMfaFactorResult, type UpdateProfileInput, type UpdateSubaccountInput, type UpdateSubaccountMemberRoleInput, type UpdateWhiteboardBoardAclInput, type UpdateWhiteboardBoardAclResult, type UpdateWhiteboardBoardInput, type UpdateWhiteboardBoardResult, type UsernameHistoryEntry, type ValidateWithdrawDestinationInput, type ValidateWithdrawDestinationResult, ValidationError, type VerificationReadyResponse, type VerifyRecoveryCodeChallengeInput, type VerifyTotpChallengeInput, type VipStatus, type VipTier, type VipTierCatalog, type WhiteboardAccess, type WhiteboardAclEntry, type WhiteboardAclEntryInput, type WhiteboardAclSubjectType, type WhiteboardAudience, type WhiteboardBoard, type WhiteboardBoardDetails, type WhiteboardBoardListItem, type WhiteboardJoinTokenResult, type WhiteboardPermissions, type WhiteboardPresencePayload, type WhiteboardResolvedRole, type WhiteboardSnapshot, type WhiteboardWritableRole, type WithdrawWhitelistView, type ZippedAssetSupplyBatch, type ZippedAssetSupplyGroupResponse, type ZippedAssetSupplyResponse, type ZippedAssetSupplySeries, type ZippedAssetSupplyUpdate, type ZipperAssetChainVariant, type ZipperAssetConfig, type ZipperChainConfig, type ZipperChainContractConfig, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, keccak256Hex, mergeLedgerBalances, normalizeErrorMessage, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalSe
2
2
  import { tsObjToNsString } from "./utils/time.js";
3
3
  import { connectErrorToPolyesterError, createErrorMappingInterceptor, toPolyesterError } from "./shared/connect-error-mapping.js";
4
4
  import { checksumEvmAddress, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, isEvmAddress, isEvmAddressStrict, keccak256Hex } from "./utils/evm.js";
5
- import { POLYESTER_DEVNET_ENVIRONMENT, createPolyesterEnvironment } from "./environment.js";
5
+ import { POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_TESTNET_ENVIRONMENT, createPolyesterEnvironment } from "./environment.js";
6
6
  import { formatConnectError, formatUserFacingError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError } from "./utils/errors.js";
7
7
  import { compareUnsignedIntegerStrings, shouldApplyReconciliationUpdate } from "./shared/reconciliation.js";
8
8
  import { mergeLedgerBalances } from "./services/balances/balances.merge.js";
@@ -14,4 +14,4 @@ import { PolyesterBrowserClient } from "./browser-client.js";
14
14
  import { PolyesterServerClient, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest } from "./server-client.js";
15
15
  import { isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isSessionElevationRequiredError } from "./utils/connect-mfa-errors.js";
16
16
  import { columnarTimestampSecAt, expandColumnarTimestampsSec } from "./utils/columnar-time.js";
17
- export { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterBrowserClient, PolyesterClient, PolyesterError, PolyesterServerClient, PreconditionFailedError, RateLimitError, RequestError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, TimeoutError, TransientError, ValidationError, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, keccak256Hex, mergeLedgerBalances, normalizeErrorMessage, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
17
+ export { AlreadyExistsError, AuthenticationError, ConfigurationError, InternalServerError, MfaEnrollmentRequiredError, MfaLastFactorRequiredError, MfaRequiredError, MfaVerificationError, NetworkError, POLYESTER_AUTH_TOKEN_COOKIE_NAME, POLYESTER_DEVNET_ENVIRONMENT, POLYESTER_SESSION_COOKIE_NAME, POLYESTER_TESTNET_ENVIRONMENT, PermissionError, PolicyInUseError, PolicyLockedError, PolicyScopeMismatchError, PolyesterBrowserClient, PolyesterClient, PolyesterError, PolyesterServerClient, PreconditionFailedError, RateLimitError, RequestError, ResourceNotFoundError, RevisionConflictError, ServiceUnavailableError, SessionElevationRequiredError, StaleQuoteError, StepUpRequiredError, TimeoutError, TransientError, ValidationError, checksumEvmAddress, columnarTimestampSecAt, compareUnsignedIntegerStrings, connectErrorToPolyesterError, createCookieAuthTokenStorage, createErrorMappingInterceptor, createMemoryAuthTokenStorage, createPolyesterEnvironment, createPolyesterServerClientFromCookies, createPolyesterServerClientFromRequest, errorFromHttpStatus, evmHexToBytes, evmUtf8ToBytes, evmUtf8ToHex, expandColumnarTimestampsSec, formatConnectError, formatUserFacingError, isAbortError, isEvmAddress, isEvmAddressStrict, isFreshStepUpRequiredError, isMfaEnrollmentRequiredError, isMfaLastFactorRequiredError, isPolicyInUseError, isPolicyLockedError, isPolicyScopeMismatchError, isResourceNotFoundError, isRetryableError, isRevisionConflictError, isSessionElevationRequiredError, keccak256Hex, mergeLedgerBalances, normalizeErrorMessage, shouldApplyReconciliationUpdate, tsObjToNsString as timestampToNanoseconds, toPolyesterError, validateCreateAddressBookEntryInput };
@@ -11,7 +11,7 @@ type TimestampInit = {
11
11
  };
12
12
  declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
13
13
  readonly symbolId: v.NumberSchema<undefined>;
14
- readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
14
+ readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
15
15
  readonly tsSec: v.BigintSchema<undefined>;
16
16
  readonly open: v.BigintSchema<undefined>;
17
17
  readonly high: v.BigintSchema<undefined>;
@@ -22,7 +22,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
22
22
  readonly isClosed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
23
23
  }, undefined>, v.TransformAction<{
24
24
  symbolId: number;
25
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
25
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
26
26
  tsSec: bigint;
27
27
  open: bigint;
28
28
  high: bigint;
@@ -33,7 +33,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
33
33
  isClosed: boolean;
34
34
  }, {
35
35
  symbolId: number;
36
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
36
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
37
37
  time: number;
38
38
  open: string;
39
39
  high: string;
@@ -46,7 +46,7 @@ declare function createCandleRowSchema(scales: SdkScales): v.SchemaWithPipe<read
46
46
  declare const createCandleRowIntSchema: typeof createCandleRowSchema;
47
47
  declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
48
48
  readonly symbolId: v.NumberSchema<undefined>;
49
- readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
49
+ readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
50
50
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
51
51
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
52
52
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -63,7 +63,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
63
63
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
64
64
  }, undefined>, v.TransformAction<{
65
65
  symbolId: number;
66
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
66
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
67
67
  tsSec: bigint[];
68
68
  open: bigint[];
69
69
  high: bigint[];
@@ -80,7 +80,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
80
80
  nextPageToken: string;
81
81
  }, {
82
82
  symbolId: number;
83
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
83
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
84
84
  time: number[];
85
85
  open: string[];
86
86
  high: string[];
@@ -100,7 +100,7 @@ declare function createCandleColumnarSchema(scales: SdkScales): v.SchemaWithPipe
100
100
  }>]>;
101
101
  declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
102
102
  readonly symbolId: v.NumberSchema<undefined>;
103
- readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">>]>;
103
+ readonly timeframe: v.SchemaWithPipe<readonly [v.EnumSchema<typeof Timeframe$1, undefined>, v.TransformAction<Timeframe$1, DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">>]>;
104
104
  readonly tsSec: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
105
105
  readonly open: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
106
106
  readonly high: v.ArraySchema<v.BigintSchema<undefined>, undefined>;
@@ -117,7 +117,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
117
117
  readonly nextPageToken: v.OptionalSchema<v.StringSchema<undefined>, "">;
118
118
  }, undefined>, v.TransformAction<{
119
119
  symbolId: number;
120
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
120
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
121
121
  tsSec: bigint[];
122
122
  open: bigint[];
123
123
  high: bigint[];
@@ -134,7 +134,7 @@ declare function createCandleColumnarIntSchema(scales: SdkScales): v.SchemaWithP
134
134
  nextPageToken: string;
135
135
  }, {
136
136
  symbolId: number;
137
- timeframe: DecodedEnum<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo">;
137
+ timeframe: DecodedEnum<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo">;
138
138
  tsSec: number[];
139
139
  open: string[];
140
140
  high: string[];
@@ -158,7 +158,7 @@ type CandleColumnar = v.InferOutput<ReturnType<typeof createCandleColumnarSchema
158
158
  type CandleColumnarInt = v.InferOutput<ReturnType<typeof createCandleColumnarIntSchema>>;
159
159
  declare function createListCandlesInputSchema(): v.SchemaWithPipe<readonly [v.ObjectSchema<{
160
160
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
161
- readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1s" | "1m" | "5m" | "15m" | "30m" | "1h" | "4h" | "12h" | "1w" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_4 | Timeframe$1.DAY_1 | Timeframe$1.HOUR_12 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
161
+ readonly timeframe: v.SchemaWithPipe<readonly [v.PicklistSchema<readonly ["1s", "1m", "5m", "15m", "30m", "1h", "4h", "12h", "1d", "1w", "1mo"], undefined>, v.TransformAction<"1d" | "1h" | "1w" | "1m" | "1s" | "5m" | "15m" | "30m" | "4h" | "12h" | "1mo", Timeframe$1.SEC_1 | Timeframe$1.MIN_1 | Timeframe$1.MIN_5 | Timeframe$1.MIN_15 | Timeframe$1.MIN_30 | Timeframe$1.HOUR_1 | Timeframe$1.HOUR_4 | Timeframe$1.DAY_1 | Timeframe$1.HOUR_12 | Timeframe$1.WEEK_1 | Timeframe$1.MONTH_1>]>;
162
162
  readonly limit: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 10000, undefined>]>, undefined>;
163
163
  readonly includeIncomplete: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
164
164
  readonly includeReference: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
@@ -13,7 +13,7 @@ type TimestampInit = {
13
13
  };
14
14
  declare const GetOrderbookHeatmapInputSchema: v.SchemaWithPipe<readonly [v.ObjectSchema<{
15
15
  readonly symbolId: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 4294967295, undefined>]>;
16
- readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1s" | "1m" | "5m" | "1h", HeatmapInterval>]>;
16
+ readonly interval: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["1s", "1m", "5m", "1h"], undefined>, "1s">, v.TransformAction<"1h" | "1m" | "1s" | "5m", HeatmapInterval>]>;
17
17
  readonly depth: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly [1, 5, 10, 20, 50, 100, 200, 500, 1000], undefined>, 50>, v.TransformAction<5 | 10 | 20 | 1 | 200 | 1000 | 500 | 100 | 50, HeatmapDepth>]>;
18
18
  readonly quantityMode: v.SchemaWithPipe<readonly [v.OptionalSchema<v.PicklistSchema<readonly ["close", "peak"], undefined>, "close">, v.TransformAction<"close" | "peak", HeatmapQuantityMode>]>;
19
19
  readonly limit: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.GtValueAction<number, 0, undefined>, v.MaxValueAction<number, 20000, undefined>]>;
@@ -122,7 +122,7 @@ declare function convertHeatmapDeltaBucket(bucket: OrderbookHeatmapDeltaBucketRa
122
122
  type OrderbookHeatmapDeltaBucket = ReturnType<typeof convertHeatmapDeltaBucket>;
123
123
  declare const OrderbookHeatmapLiveBucketRawSchema: v.ObjectSchema<{
124
124
  readonly symbolId: v.NumberSchema<undefined>;
125
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
125
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
126
126
  readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
127
127
  readonly isFinal: v.BooleanSchema<undefined>;
128
128
  readonly bids: v.OptionalSchema<v.ObjectSchema<{
@@ -142,7 +142,7 @@ declare const OrderbookHeatmapLiveBucketRawSchema: v.ObjectSchema<{
142
142
  type OrderbookHeatmapLiveBucketRaw = v.InferOutput<typeof OrderbookHeatmapLiveBucketRawSchema>;
143
143
  declare function convertHeatmapLiveBucket(bucket: OrderbookHeatmapLiveBucketRaw, scales: SdkScales): {
144
144
  symbolId: number;
145
- interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
145
+ interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
146
146
  tsSec: number;
147
147
  isFinal: boolean;
148
148
  bids: {
@@ -226,7 +226,7 @@ declare function convertHeatmapDeltaChain(chain: OrderbookHeatmapDeltaChainRaw,
226
226
  type OrderbookHeatmapDeltaChain = ReturnType<typeof convertHeatmapDeltaChain>;
227
227
  declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.SchemaWithPipe<readonly [v.ObjectSchema<{
228
228
  readonly symbolId: v.NumberSchema<undefined>;
229
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
229
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
230
230
  readonly depth: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, 5 | 10 | 20 | 1 | "unspecified" | 200 | 1000 | 500 | 100 | 50>]>;
231
231
  readonly chain: v.OptionalSchema<v.ObjectSchema<{
232
232
  readonly baseKeyframe: v.OptionalSchema<v.ObjectSchema<{
@@ -267,7 +267,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
267
267
  readonly quantityMode: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"close" | "peak">>]>;
268
268
  readonly liveBucket: v.OptionalSchema<v.ObjectSchema<{
269
269
  readonly symbolId: v.NumberSchema<undefined>;
270
- readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1s" | "1m" | "5m" | "1h">>]>;
270
+ readonly interval: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.TransformAction<number, DecodedEnum<"1h" | "1m" | "1s" | "5m">>]>;
271
271
  readonly tsSec: v.SchemaWithPipe<readonly [v.BigintSchema<undefined>, v.TransformAction<bigint, number>]>;
272
272
  readonly isFinal: v.BooleanSchema<undefined>;
273
273
  readonly bids: v.OptionalSchema<v.ObjectSchema<{
@@ -286,7 +286,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
286
286
  }, undefined>, undefined>;
287
287
  }, undefined>, v.TransformAction<{
288
288
  symbolId: number;
289
- interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
289
+ interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
290
290
  depth: 5 | 10 | 20 | 1 | "unspecified" | 200 | 1000 | 500 | 100 | 50;
291
291
  chain?: {
292
292
  baseKeyframe?: {
@@ -327,7 +327,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
327
327
  quantityMode: DecodedEnum<"close" | "peak">;
328
328
  liveBucket?: {
329
329
  symbolId: number;
330
- interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
330
+ interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
331
331
  tsSec: number;
332
332
  isFinal: boolean;
333
333
  bids?: {
@@ -346,7 +346,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
346
346
  } | undefined;
347
347
  }, {
348
348
  symbolId: number;
349
- interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
349
+ interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
350
350
  depth: 5 | 10 | 20 | 1 | "unspecified" | 200 | 1000 | 500 | 100 | 50;
351
351
  chain: {
352
352
  baseKeyframe: {
@@ -387,7 +387,7 @@ declare function createOrderbookHeatmapResponseSchema(scales: SdkScales): v.Sche
387
387
  quantityMode: DecodedEnum<"close" | "peak">;
388
388
  liveBucket: {
389
389
  symbolId: number;
390
- interval: DecodedEnum<"1s" | "1m" | "5m" | "1h">;
390
+ interval: DecodedEnum<"1h" | "1m" | "1s" | "5m">;
391
391
  tsSec: number;
392
392
  isFinal: boolean;
393
393
  bids: {