@polyester/sdk 0.22.3 → 0.23.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/CHANGELOG.md +14 -0
- package/dist/account-signer/types.d.ts +1 -1
- package/dist/account-signer/types.js.map +1 -1
- package/dist/environment.js +4 -4
- package/dist/environment.js.map +1 -1
- package/dist/gen/auth/v1/auth_pb.d.ts +88 -46
- package/dist/gen/auth/v1/auth_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/auth_pb.js +43 -11
- package/dist/gen/auth/v1/auth_pb.js.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.d.ts +5 -17
- package/dist/gen/auth/v1/subaccounts_pb.d.ts.map +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js +1 -1
- package/dist/gen/auth/v1/subaccounts_pb.js.map +1 -1
- package/dist/gen/chain/withdraw/v1/withdraw_pb.d.ts +2 -2
- package/dist/gen/chain/withdraw/v1/withdraw_pb.js.map +1 -1
- package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts +2 -1
- package/dist/gen/marketoverview/v1/marketoverview_pb.d.ts.map +1 -1
- package/dist/gen/marketoverview/v1/marketoverview_pb.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/services/auth/account-signer-auth.d.ts +7 -3
- package/dist/services/auth/account-signer-auth.d.ts.map +1 -1
- package/dist/services/auth/account-signer-auth.js +28 -13
- package/dist/services/auth/account-signer-auth.js.map +1 -1
- package/dist/services/auth/auth.d.ts +19 -14
- package/dist/services/auth/auth.d.ts.map +1 -1
- package/dist/services/auth/auth.js +24 -14
- package/dist/services/auth/auth.js.map +1 -1
- package/dist/services/auth/auth.types.d.ts +2 -2
- package/dist/services/auth/wallet-challenge.schemas.js +20 -0
- package/dist/services/auth/wallet-challenge.schemas.js.map +1 -0
- package/dist/services/heatmap/heatmap.schemas.d.ts +4 -4
- package/dist/services/orderbook/orderbook.schemas.d.ts +1 -1
- package/dist/services/orders/orders-batch.schemas.d.ts +14 -14
- package/dist/services/orders/orders-input.schemas.d.ts +1 -1
- package/dist/services/orders/orders-output.schemas.d.ts +6 -6
- package/dist/services/subaccounts/subaccounts.d.ts +1 -1
- package/dist/services/subaccounts/subaccounts.js +1 -1
- package/dist/services/subaccounts/subaccounts.js.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.d.ts +5 -7
- package/dist/services/subaccounts/subaccounts.schemas.d.ts.map +1 -1
- package/dist/services/subaccounts/subaccounts.schemas.js +4 -5
- package/dist/services/subaccounts/subaccounts.schemas.js.map +1 -1
- package/dist/services/trading-withdraws/index.d.ts +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.d.ts +10 -72
- package/dist/services/trading-withdraws/trading-withdraws.d.ts.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.js +8 -84
- package/dist/services/trading-withdraws/trading-withdraws.js.map +1 -1
- package/dist/services/trading-withdraws/trading-withdraws.types.d.ts +2 -2
- package/dist/services/trading-withdraws/wallet-message.js +43 -0
- package/dist/services/trading-withdraws/wallet-message.js.map +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @polyester/sdk
|
|
2
2
|
|
|
3
|
+
## 0.23.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Update devnet and testnet API and WebSocket URLs. ([#141](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/141))
|
|
8
|
+
|
|
9
|
+
## 0.23.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- Replace nonce authentication with server-issued SIWE challenges for wallet login and subaccount creation. ([#138](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/138))
|
|
14
|
+
|
|
15
|
+
- Replace wallet Trading withdrawal `signTypedData` with EIP-191 `signMessage` authorization. ([#137](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/137))
|
|
16
|
+
|
|
3
17
|
## 0.22.3
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -14,7 +14,7 @@ interface AccountSigner {
|
|
|
14
14
|
readonly accountAddress: HexAddress;
|
|
15
15
|
/** The owner/EOA address (optional metadata about the controlling signer) */
|
|
16
16
|
readonly ownerAddress?: HexAddress;
|
|
17
|
-
/** Sign
|
|
17
|
+
/** Sign the exact UTF-8 message with EIP-191 semantics for accountAddress (including smart-account wrapping when required). */
|
|
18
18
|
signMessage(message: string): Promise<Hex>;
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/account-signer/types.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport { isEvmAddress } from \"../utils/evm.js\";\nimport { ConfigurationError } from \"../shared/errors.js\";\n\nexport type HexAddress = `0x${string}`;\n\n/**\n * Minimal account signer interface for SDK operations.\n *\n * The SDK authenticates the Polyester smart account address. The owner address\n * is optional metadata about the EOA or custody provider that controls it.\n */\nexport interface AccountSigner {\n /** Fingerprint of the PolyesterEnvironment this signer was created for */\n readonly environmentFingerprint: string;\n\n /** The smart account address (used for authentication and trading) */\n readonly accountAddress: HexAddress;\n\n /** The owner/EOA address (optional metadata about the controlling signer) */\n readonly ownerAddress?: HexAddress;\n\n /** Sign
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/account-signer/types.ts"],"sourcesContent":["import type { Hex } from \"viem\";\nimport { isEvmAddress } from \"../utils/evm.js\";\nimport { ConfigurationError } from \"../shared/errors.js\";\n\nexport type HexAddress = `0x${string}`;\n\n/**\n * Minimal account signer interface for SDK operations.\n *\n * The SDK authenticates the Polyester smart account address. The owner address\n * is optional metadata about the EOA or custody provider that controls it.\n */\nexport interface AccountSigner {\n /** Fingerprint of the PolyesterEnvironment this signer was created for */\n readonly environmentFingerprint: string;\n\n /** The smart account address (used for authentication and trading) */\n readonly accountAddress: HexAddress;\n\n /** The owner/EOA address (optional metadata about the controlling signer) */\n readonly ownerAddress?: HexAddress;\n\n /** Sign the exact UTF-8 message with EIP-191 semantics for accountAddress (including smart-account wrapping when required). */\n signMessage(message: string): Promise<Hex>;\n}\n\n/**\n * Factory function type for lazy account signer initialization.\n * Useful when the signer might not be available at client creation time.\n */\nexport type AccountSignerFactory = () => AccountSigner | null | Promise<AccountSigner | null>;\n\n/**\n * Account signer configuration for the client.\n * Can be a signer instance or a factory for lazy initialization.\n */\nexport type AccountSignerConfig = AccountSigner | AccountSignerFactory;\n\n/**\n * Helper to check if an account signer config is a factory function.\n */\nexport function isAccountSignerFactory(\n config: AccountSignerConfig,\n): config is AccountSignerFactory {\n return typeof config === \"function\";\n}\n\n/**\n * Asserts that a value implements the account signer contract.\n */\nexport function assertAccountSigner(value: AccountSigner): void {\n if (typeof value !== \"object\" || value === null) {\n throw new ConfigurationError(\"Account signer must be an object or factory function.\");\n }\n if (!value.environmentFingerprint) {\n throw new ConfigurationError(\"Account signer must include an environmentFingerprint.\");\n }\n if (!isEvmAddress(value.accountAddress)) {\n throw new ConfigurationError(\"Account signer must include a valid accountAddress.\");\n }\n if (value.ownerAddress && !isEvmAddress(value.ownerAddress)) {\n throw new ConfigurationError(\"Account signer ownerAddress must be a valid address.\");\n }\n if (typeof value.signMessage !== \"function\") {\n throw new ConfigurationError(\"Account signer must include a signMessage function.\");\n }\n}\n\n/**\n * Helper to resolve an account signer from config.\n */\nexport async function resolveAccountSigner(\n config: AccountSignerConfig | undefined,\n): Promise<AccountSigner | null> {\n if (!config) return null;\n const accountSigner = isAccountSignerFactory(config) ? await config() : config;\n if (accountSigner) assertAccountSigner(accountSigner);\n return accountSigner;\n}\n"],"mappings":";;;;;;AAyCA,SAAgB,uBACZ,QAC8B;CAC9B,OAAO,OAAO,WAAW;AAC7B;;;;AAKA,SAAgB,oBAAoB,OAA4B;CAC5D,IAAI,OAAO,UAAU,YAAY,UAAU,MACvC,MAAM,IAAI,mBAAmB,uDAAuD;CAExF,IAAI,CAAC,MAAM,wBACP,MAAM,IAAI,mBAAmB,wDAAwD;CAEzF,IAAI,CAAC,aAAa,MAAM,cAAc,GAClC,MAAM,IAAI,mBAAmB,qDAAqD;CAEtF,IAAI,MAAM,gBAAgB,CAAC,aAAa,MAAM,YAAY,GACtD,MAAM,IAAI,mBAAmB,sDAAsD;CAEvF,IAAI,OAAO,MAAM,gBAAgB,YAC7B,MAAM,IAAI,mBAAmB,qDAAqD;AAE1F;;;;AAKA,eAAsB,qBAClB,QAC6B;CAC7B,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,gBAAgB,uBAAuB,MAAM,IAAI,MAAM,OAAO,IAAI;CACxE,IAAI,eAAe,oBAAoB,aAAa;CACpD,OAAO;AACX"}
|
package/dist/environment.js
CHANGED
|
@@ -143,8 +143,8 @@ function parsePolyesterEnvironment(environment) {
|
|
|
143
143
|
}
|
|
144
144
|
const POLYESTER_DEVNET_ENVIRONMENT = createPolyesterEnvironment({
|
|
145
145
|
name: "polyester-devnet",
|
|
146
|
-
apiUrl: "https://api
|
|
147
|
-
websocketUrl: "wss://api
|
|
146
|
+
apiUrl: "https://api.devnet.polyester.com",
|
|
147
|
+
websocketUrl: "wss://api.devnet.polyester.com",
|
|
148
148
|
rpcUrl: "https://rpc.polyester.tech",
|
|
149
149
|
chain: {
|
|
150
150
|
id: 888168,
|
|
@@ -185,8 +185,8 @@ const POLYESTER_DEVNET_ENVIRONMENT = createPolyesterEnvironment({
|
|
|
185
185
|
});
|
|
186
186
|
const POLYESTER_TESTNET_ENVIRONMENT = createPolyesterEnvironment({
|
|
187
187
|
name: "polyester-testnet",
|
|
188
|
-
apiUrl: "https://api
|
|
189
|
-
websocketUrl: "wss://api
|
|
188
|
+
apiUrl: "https://api.testnet.polyester.com",
|
|
189
|
+
websocketUrl: "wss://api.testnet.polyester.com",
|
|
190
190
|
rpcUrl: "https://rpc.polyester.live",
|
|
191
191
|
chain: {
|
|
192
192
|
id: 888169,
|
package/dist/environment.js.map
CHANGED
|
@@ -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: 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: \"0xfc9B0991DC84E419C9b164dE89795958a5B0A0cF\",\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,iBAAiB,SAAS,IAAI,QAAQ,GACvC,MAAM,IAAI,mBAAmB,GAAG,MAAM,YAAY,iBAAiB,KAAK,MAAM,EAAE,EAAE;CAKtF,KADK,IAAI,aAAa,WAAW,IAAI,aAAa,UAAU,CAAC,YAAY,IAAI,QAAQ,GAEjF,MAAM,IAAI,mBAAmB,GAAG,MAAM,8CAA8C;CAGxF,IAAI,SAAS,gBAAgB,SAAS,IAAI,QACtC,MAAM,IAAI,mBAAmB,GAAG,MAAM,oCAAoC;CAG9E,IAAI,OAAO;CACX,OAAO,IAAI,SAAS,CAAC,CAAC,QAAQ,SAAS,EAAE;AAC7C;AAEA,SAA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,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.com\",\n websocketUrl: \"wss://api.devnet.polyester.com\",\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: \"0xfc9B0991DC84E419C9b164dE89795958a5B0A0cF\",\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,MA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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;AAED,MAAa,gCAAgC,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"}
|
|
@@ -3,78 +3,92 @@ import { Message } from "@bufbuild/protobuf";
|
|
|
3
3
|
import { GenEnum, GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
4
4
|
import { Timestamp } from "@bufbuild/protobuf/wkt";
|
|
5
5
|
declare namespace auth_pb_d_exports {
|
|
6
|
-
export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService,
|
|
6
|
+
export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService, CreateWalletChallengeRequest, CreateWalletChallengeRequestSchema, CreateWalletChallengeResponse, CreateWalletChallengeResponseSchema, LoginWithWalletRequest, LoginWithWalletRequestSchema, LoginWithWalletResponse, LoginWithWalletResponseSchema, MeRequest, MeRequestSchema, MeResponse, MeResponseSchema, WalletChallengePurpose, WalletChallengePurposeSchema, file_auth_v1_auth };
|
|
7
7
|
}
|
|
8
8
|
/**
|
|
9
9
|
* Describes the file auth/v1/auth.proto.
|
|
10
10
|
*/
|
|
11
11
|
declare const file_auth_v1_auth: GenFile;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* CreateWalletChallengeRequest requests a short-lived EIP-4361 message whose
|
|
14
|
+
* exact UTF-8 bytes must be signed by the wallet.
|
|
15
15
|
*
|
|
16
|
-
* @generated from message auth.v1.
|
|
16
|
+
* @generated from message auth.v1.CreateWalletChallengeRequest
|
|
17
17
|
*/
|
|
18
|
-
type
|
|
18
|
+
type CreateWalletChallengeRequest = Message<"auth.v1.CreateWalletChallengeRequest"> & {
|
|
19
19
|
/**
|
|
20
|
-
* Smart-account EVM address, formatted as 0x plus 40 hex characters.
|
|
20
|
+
* Smart-account EVM address being authenticated, formatted as 0x plus 40 hex characters.
|
|
21
21
|
*
|
|
22
22
|
* @generated from field: string smart_account_address = 1;
|
|
23
23
|
*/
|
|
24
24
|
smartAccountAddress: string;
|
|
25
|
+
/**
|
|
26
|
+
* EVM address selected in the wallet and written into the EIP-4361 message.
|
|
27
|
+
* For CREATE_SUBACCOUNT, this must equal smart_account_address.
|
|
28
|
+
*
|
|
29
|
+
* @generated from field: string signer_address = 2;
|
|
30
|
+
*/
|
|
31
|
+
signerAddress: string;
|
|
32
|
+
/**
|
|
33
|
+
* Browser origin URI requesting the signature, including scheme and optional
|
|
34
|
+
* port but no path, query, fragment, or user information.
|
|
35
|
+
*
|
|
36
|
+
* @generated from field: string uri = 3;
|
|
37
|
+
*/
|
|
38
|
+
uri: string;
|
|
39
|
+
/**
|
|
40
|
+
* Operation for which the challenge may be consumed.
|
|
41
|
+
*
|
|
42
|
+
* @generated from field: auth.v1.WalletChallengePurpose purpose = 4;
|
|
43
|
+
*/
|
|
44
|
+
purpose: WalletChallengePurpose;
|
|
25
45
|
};
|
|
26
46
|
/**
|
|
27
|
-
* Describes the message auth.v1.
|
|
28
|
-
* Use `create(
|
|
47
|
+
* Describes the message auth.v1.CreateWalletChallengeRequest.
|
|
48
|
+
* Use `create(CreateWalletChallengeRequestSchema)` to create a new message.
|
|
29
49
|
*/
|
|
30
|
-
declare const
|
|
50
|
+
declare const CreateWalletChallengeRequestSchema: GenMessage<CreateWalletChallengeRequest>;
|
|
31
51
|
/**
|
|
32
|
-
*
|
|
52
|
+
* CreateWalletChallengeResponse contains the canonical EIP-4361 message.
|
|
33
53
|
*
|
|
34
|
-
* @generated from message auth.v1.
|
|
54
|
+
* @generated from message auth.v1.CreateWalletChallengeResponse
|
|
35
55
|
*/
|
|
36
|
-
type
|
|
56
|
+
type CreateWalletChallengeResponse = Message<"auth.v1.CreateWalletChallengeResponse"> & {
|
|
37
57
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
58
|
+
* Canonical EIP-4361 message. Sign these UTF-8 bytes exactly once with
|
|
59
|
+
* personal_sign; do not hash, alter, or reconstruct the message.
|
|
40
60
|
*
|
|
41
|
-
* @generated from field: string
|
|
61
|
+
* @generated from field: string message = 1;
|
|
42
62
|
*/
|
|
43
|
-
|
|
63
|
+
message: string;
|
|
44
64
|
/**
|
|
45
|
-
* Time in UTC when the
|
|
65
|
+
* Time in UTC when the challenge expires. Wallet challenges expire after 5 minutes.
|
|
46
66
|
*
|
|
47
67
|
* @generated from field: google.protobuf.Timestamp expires_at = 2;
|
|
48
68
|
*/
|
|
49
69
|
expiresAt?: Timestamp | undefined;
|
|
50
70
|
};
|
|
51
71
|
/**
|
|
52
|
-
* Describes the message auth.v1.
|
|
53
|
-
* Use `create(
|
|
72
|
+
* Describes the message auth.v1.CreateWalletChallengeResponse.
|
|
73
|
+
* Use `create(CreateWalletChallengeResponseSchema)` to create a new message.
|
|
54
74
|
*/
|
|
55
|
-
declare const
|
|
75
|
+
declare const CreateWalletChallengeResponseSchema: GenMessage<CreateWalletChallengeResponse>;
|
|
56
76
|
/**
|
|
57
|
-
* LoginWithWalletRequest completes smart-account wallet login using
|
|
58
|
-
*
|
|
77
|
+
* LoginWithWalletRequest completes smart-account wallet login using the exact
|
|
78
|
+
* server-issued EIP-4361 message and its signature.
|
|
59
79
|
*
|
|
60
80
|
* @generated from message auth.v1.LoginWithWalletRequest
|
|
61
81
|
*/
|
|
62
82
|
type LoginWithWalletRequest = Message<"auth.v1.LoginWithWalletRequest"> & {
|
|
63
83
|
/**
|
|
64
|
-
* Smart-account EVM address
|
|
65
|
-
* 40 hex characters.
|
|
84
|
+
* Smart-account EVM address bound into the challenge resource, formatted as
|
|
85
|
+
* 0x plus 40 hex characters.
|
|
66
86
|
*
|
|
67
87
|
* @generated from field: string smart_account_address = 1;
|
|
68
88
|
*/
|
|
69
89
|
smartAccountAddress: string;
|
|
70
90
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
* @generated from field: string nonce = 2;
|
|
74
|
-
*/
|
|
75
|
-
nonce: string;
|
|
76
|
-
/**
|
|
77
|
-
* Signature over the canonical login message containing the nonce. Maximum
|
|
91
|
+
* Signature over message using EIP-191 personal_sign semantics. Maximum
|
|
78
92
|
* length is 8192 characters to support universal wallet signatures.
|
|
79
93
|
*
|
|
80
94
|
* @generated from field: string signature = 3;
|
|
@@ -95,19 +109,18 @@ type LoginWithWalletRequest = Message<"auth.v1.LoginWithWalletRequest"> & {
|
|
|
95
109
|
*/
|
|
96
110
|
ip: string;
|
|
97
111
|
/**
|
|
98
|
-
* Optional
|
|
99
|
-
* as 0x plus 40 hex characters. This value is metadata and is not used for
|
|
100
|
-
* signature verification.
|
|
112
|
+
* Optional provider hint for the signing wallet. Maximum length is 32 characters.
|
|
101
113
|
*
|
|
102
|
-
* @generated from field: string
|
|
114
|
+
* @generated from field: string wallet_provider = 7;
|
|
103
115
|
*/
|
|
104
|
-
|
|
116
|
+
walletProvider: string;
|
|
105
117
|
/**
|
|
106
|
-
*
|
|
118
|
+
* Exact EIP-4361 message returned by CreateWalletChallenge. Maximum length is
|
|
119
|
+
* 4096 UTF-8 bytes.
|
|
107
120
|
*
|
|
108
|
-
* @generated from field: string
|
|
121
|
+
* @generated from field: string message = 8;
|
|
109
122
|
*/
|
|
110
|
-
|
|
123
|
+
message: string;
|
|
111
124
|
};
|
|
112
125
|
/**
|
|
113
126
|
* Describes the message auth.v1.LoginWithWalletRequest.
|
|
@@ -261,6 +274,35 @@ type AcceptTermsResponse = Message<"auth.v1.AcceptTermsResponse"> & {};
|
|
|
261
274
|
* Use `create(AcceptTermsResponseSchema)` to create a new message.
|
|
262
275
|
*/
|
|
263
276
|
declare const AcceptTermsResponseSchema: GenMessage<AcceptTermsResponse>;
|
|
277
|
+
/**
|
|
278
|
+
* Purpose for a server-issued wallet challenge.
|
|
279
|
+
*
|
|
280
|
+
* @generated from enum auth.v1.WalletChallengePurpose
|
|
281
|
+
*/
|
|
282
|
+
declare enum WalletChallengePurpose {
|
|
283
|
+
/**
|
|
284
|
+
* No wallet challenge purpose was specified.
|
|
285
|
+
*
|
|
286
|
+
* @generated from enum value: WALLET_PROOF_UNSPECIFIED = 0;
|
|
287
|
+
*/
|
|
288
|
+
WALLET_PROOF_UNSPECIFIED = 0,
|
|
289
|
+
/**
|
|
290
|
+
* Authenticate the wallet and create a Polyester session.
|
|
291
|
+
*
|
|
292
|
+
* @generated from enum value: LOGIN = 1;
|
|
293
|
+
*/
|
|
294
|
+
LOGIN = 1,
|
|
295
|
+
/**
|
|
296
|
+
* Prove control of a new smart account before creating a sub-account.
|
|
297
|
+
*
|
|
298
|
+
* @generated from enum value: CREATE_SUBACCOUNT = 2;
|
|
299
|
+
*/
|
|
300
|
+
CREATE_SUBACCOUNT = 2
|
|
301
|
+
}
|
|
302
|
+
/**
|
|
303
|
+
* Describes the enum auth.v1.WalletChallengePurpose.
|
|
304
|
+
*/
|
|
305
|
+
declare const WalletChallengePurposeSchema: GenEnum<WalletChallengePurpose>;
|
|
264
306
|
/**
|
|
265
307
|
* High-level error codes for authentication and account-domain failures.
|
|
266
308
|
*
|
|
@@ -525,17 +567,17 @@ declare const AuthErrorCodeSchema: GenEnum<AuthErrorCode>;
|
|
|
525
567
|
*/
|
|
526
568
|
declare const AuthService: GenService<{
|
|
527
569
|
/**
|
|
528
|
-
*
|
|
570
|
+
* Create a short-lived EIP-4361 wallet challenge.
|
|
529
571
|
*
|
|
530
|
-
* @generated from rpc auth.v1.AuthService.
|
|
572
|
+
* @generated from rpc auth.v1.AuthService.CreateWalletChallenge
|
|
531
573
|
*/
|
|
532
|
-
|
|
574
|
+
createWalletChallenge: {
|
|
533
575
|
methodKind: "unary";
|
|
534
|
-
input: typeof
|
|
535
|
-
output: typeof
|
|
576
|
+
input: typeof CreateWalletChallengeRequestSchema;
|
|
577
|
+
output: typeof CreateWalletChallengeResponseSchema;
|
|
536
578
|
};
|
|
537
579
|
/**
|
|
538
|
-
* Verify a signed
|
|
580
|
+
* Verify a signed EIP-4361 message and issue an access token. Login and account creation
|
|
539
581
|
* do not accept terms; explicit consent is recorded only by AcceptTerms.
|
|
540
582
|
*
|
|
541
583
|
* @generated from rpc auth.v1.AuthService.LoginWithWallet
|
|
@@ -571,5 +613,5 @@ declare const AuthService: GenService<{
|
|
|
571
613
|
};
|
|
572
614
|
}>;
|
|
573
615
|
//#endregion
|
|
574
|
-
export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService,
|
|
616
|
+
export { AcceptTermsRequest, AcceptTermsRequestSchema, AcceptTermsResponse, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetail, AuthErrorDetailSchema, AuthService, CreateWalletChallengeRequest, CreateWalletChallengeRequestSchema, CreateWalletChallengeResponse, CreateWalletChallengeResponseSchema, LoginWithWalletRequest, LoginWithWalletRequestSchema, LoginWithWalletResponse, LoginWithWalletResponseSchema, MeRequest, MeRequestSchema, MeResponse, MeResponseSchema, WalletChallengePurpose, WalletChallengePurposeSchema, auth_pb_d_exports, file_auth_v1_auth };
|
|
575
617
|
//# sourceMappingURL=auth_pb.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth_pb.d.ts","names":[],"sources":["../../../../src/gen/auth/v1/auth_pb.ts"],"mappings":";;;;;;;;;;cAea,mBAAmB;;;;;;;KASpB
|
|
1
|
+
{"version":3,"file":"auth_pb.d.ts","names":[],"sources":["../../../../src/gen/auth/v1/auth_pb.ts"],"mappings":";;;;;;;;;;cAea,mBAAmB;;;;;;;KASpB,+BAA+B;;;;;;EAMzC;;;;;;;EAQA;;;;;;;EAQA;;;;;;EAOA,SAAS;;;;;;cAOE,oCAAoC,WAAW;;;;;;KAQhD,gCAAgC;;;;;;;EAO1C;;;;;;EAOA,YAAY;;;;;;cAOD,qCAAqC,WAAW;;;;;;;KASjD,yBAAyB;;;;;;;EAOnC;;;;;;;EAQA;;;;;;;EAQA;;;;;;;EAQA;;;;;;EAOA;;;;;;;EAQA;;;;;;cAOW,8BAA8B,WAAW;;;;;;;KAS1C,0BAA0B;;;;;;EAMpC;;;;;;EAOA,YAAY;;;;;;EAOZ;;;;;;EAOA;;;;;;EAOA,UAAU;;;;;;cAOC,+BAA+B,WAAW;;;;;;;KAS3C,YAAY;;;;;cAOX,iBAAiB,WAAW;;;;;;KAQ7B,aAAa;;;;;;EAMvB;;;;;;;;EASA;;;;;;EAOA;;;;;;;EAQA;;;;;;EAOA,UAAU;;;;;;cAOC,kBAAkB,WAAW;;;;;;KAQ9B,kBAAkB;;;;;;EAM5B,MAAM;;;;;;EAON;;;;;;cAOW,uBAAuB,WAAW;;;;;;KAQnC,qBAAqB;;;;;cAOpB,0BAA0B,WAAW;;;;;;;KAStC,sBAAsB;;;;;cAOrB,2BAA2B,WAAW;;;;;;aAQvC;;;;;;EAMV;;;;;;EAOA;;;;;;EAOA;;;;;cAMW,8BAA8B,QAAQ;;;;;;aAQvC;;;;;;EAMV;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;cAMW,qBAAqB,QAAQ;;;;;;cAQ7B,aAAa;;;;;;EAMxB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;;EAQjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;;;;;EAWjB;IACE;IACA,cAAc;IACd,eAAe;;;;;;;EAOjB;IACE;IACA,cAAc;IACd,eAAe"}
|
|
@@ -10,28 +10,30 @@ var auth_pb_exports = /* @__PURE__ */ __exportAll({
|
|
|
10
10
|
AuthErrorCodeSchema: () => AuthErrorCodeSchema,
|
|
11
11
|
AuthErrorDetailSchema: () => AuthErrorDetailSchema,
|
|
12
12
|
AuthService: () => AuthService,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
CreateWalletChallengeRequestSchema: () => CreateWalletChallengeRequestSchema,
|
|
14
|
+
CreateWalletChallengeResponseSchema: () => CreateWalletChallengeResponseSchema,
|
|
15
15
|
LoginWithWalletRequestSchema: () => LoginWithWalletRequestSchema,
|
|
16
16
|
LoginWithWalletResponseSchema: () => LoginWithWalletResponseSchema,
|
|
17
17
|
MeRequestSchema: () => MeRequestSchema,
|
|
18
18
|
MeResponseSchema: () => MeResponseSchema,
|
|
19
|
+
WalletChallengePurpose: () => WalletChallengePurpose,
|
|
20
|
+
WalletChallengePurposeSchema: () => WalletChallengePurposeSchema,
|
|
19
21
|
file_auth_v1_auth: () => file_auth_v1_auth
|
|
20
22
|
});
|
|
21
23
|
/**
|
|
22
24
|
* Describes the file auth/v1/auth.proto.
|
|
23
25
|
*/
|
|
24
|
-
const file_auth_v1_auth = /*@__PURE__*/ fileDesc("
|
|
26
|
+
const file_auth_v1_auth = /*@__PURE__*/ fileDesc("ChJhdXRoL3YxL2F1dGgucHJvdG8SB2F1dGgudjEinAEKHENyZWF0ZVdhbGxldENoYWxsZW5nZVJlcXVlc3QSHwoVc21hcnRfYWNjb3VudF9hZGRyZXNzGAEgASgJQgASGAoOc2lnbmVyX2FkZHJlc3MYAiABKAlCABINCgN1cmkYAyABKAlCABIyCgdwdXJwb3NlGAQgASgOMh8uYXV0aC52MS5XYWxsZXRDaGFsbGVuZ2VQdXJwb3NlQgAiYAodQ3JlYXRlV2FsbGV0Q2hhbGxlbmdlUmVzcG9uc2USDwoHbWVzc2FnZRgBIAEoCRIuCgpleHBpcmVzX2F0GAIgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcCKgAQoWTG9naW5XaXRoV2FsbGV0UmVxdWVzdBIfChVzbWFydF9hY2NvdW50X2FkZHJlc3MYASABKAlCABITCglzaWduYXR1cmUYAyABKAlCABIUCgp1c2VyX2FnZW50GAQgASgJQgASDAoCaXAYBSABKAlCABIZ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RBAfEiIKHkFVVEhfU1RFUF9VUF9QUk9PRl9VTkFWQUlMQUJMRRAgEiAKHEFVVEhfU1RFUF9VUF9BTFJFQURZX0NMQUlNRUQQIRIWChJBVVRIX1BPTElDWV9JTl9VU0UQIhIWChJBVVRIX1BPTElDWV9MT0NLRUQQIxIeChpBVVRIX1BPTElDWV9TQ09QRV9NSVNNQVRDSBAkEhoKFkFVVEhfUkVWSVNJT05fQ09ORkxJQ1QQJRIfChtBVVRIX01GQV9FTEVWQVRJT05fUkVRVUlSRUQQJhIhCh1BVVRIX01GQV9MQVNUX0ZBQ1RPUl9SRVFVSVJFRBAnEhcKE0FVVEhfSU5URVJOQUxfRVJST1IQKBIbChdBVVRIX1RFUk1TX05PVF9BQ0NFUFRFRBApMs8CCgtBdXRoU2VydmljZRJoChVDcmVhdGVXYWxsZXRDaGFsbGVuZ2USJS5hdXRoLnYxLkNyZWF0ZVdhbGxldENoYWxsZW5nZVJlcXVlc3QaJi5hdXRoLnYxLkNyZWF0ZVdhbGxldENoYWxsZW5nZVJlc3BvbnNlIgASVgoPTG9naW5XaXRoV2FsbGV0Eh8uYXV0aC52MS5Mb2dpbldpdGhXYWxsZXRSZXF1ZXN0GiAuYXV0aC52MS5Mb2dpbldpdGhXYWxsZXRSZXNwb25zZSIAEk0KC0FjY2VwdFRlcm1zEhsuYXV0aC52MS5BY2NlcHRUZXJtc1JlcXVlc3QaHC5hdXRoLnYxLkFjY2VwdFRlcm1zUmVzcG9uc2UiA5ACAhIvCgJNZRISLmF1dGgudjEuTWVSZXF1ZXN0GhMuYXV0aC52MS5NZVJlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9hdXRoL3YxO2F1dGh2MWIGcHJvdG8z", [file_auth_v1_mfa, file_google_protobuf_timestamp]);
|
|
25
27
|
/**
|
|
26
|
-
* Describes the message auth.v1.
|
|
27
|
-
* Use `create(
|
|
28
|
+
* Describes the message auth.v1.CreateWalletChallengeRequest.
|
|
29
|
+
* Use `create(CreateWalletChallengeRequestSchema)` to create a new message.
|
|
28
30
|
*/
|
|
29
|
-
const
|
|
31
|
+
const CreateWalletChallengeRequestSchema = /*@__PURE__*/ messageDesc(file_auth_v1_auth, 0);
|
|
30
32
|
/**
|
|
31
|
-
* Describes the message auth.v1.
|
|
32
|
-
* Use `create(
|
|
33
|
+
* Describes the message auth.v1.CreateWalletChallengeResponse.
|
|
34
|
+
* Use `create(CreateWalletChallengeResponseSchema)` to create a new message.
|
|
33
35
|
*/
|
|
34
|
-
const
|
|
36
|
+
const CreateWalletChallengeResponseSchema = /*@__PURE__*/ messageDesc(file_auth_v1_auth, 1);
|
|
35
37
|
/**
|
|
36
38
|
* Describes the message auth.v1.LoginWithWalletRequest.
|
|
37
39
|
* Use `create(LoginWithWalletRequestSchema)` to create a new message.
|
|
@@ -68,6 +70,36 @@ const AcceptTermsRequestSchema = /*@__PURE__*/ messageDesc(file_auth_v1_auth, 7)
|
|
|
68
70
|
*/
|
|
69
71
|
const AcceptTermsResponseSchema = /*@__PURE__*/ messageDesc(file_auth_v1_auth, 8);
|
|
70
72
|
/**
|
|
73
|
+
* Purpose for a server-issued wallet challenge.
|
|
74
|
+
*
|
|
75
|
+
* @generated from enum auth.v1.WalletChallengePurpose
|
|
76
|
+
*/
|
|
77
|
+
let WalletChallengePurpose = /* @__PURE__ */ function(WalletChallengePurpose) {
|
|
78
|
+
/**
|
|
79
|
+
* No wallet challenge purpose was specified.
|
|
80
|
+
*
|
|
81
|
+
* @generated from enum value: WALLET_PROOF_UNSPECIFIED = 0;
|
|
82
|
+
*/
|
|
83
|
+
WalletChallengePurpose[WalletChallengePurpose["WALLET_PROOF_UNSPECIFIED"] = 0] = "WALLET_PROOF_UNSPECIFIED";
|
|
84
|
+
/**
|
|
85
|
+
* Authenticate the wallet and create a Polyester session.
|
|
86
|
+
*
|
|
87
|
+
* @generated from enum value: LOGIN = 1;
|
|
88
|
+
*/
|
|
89
|
+
WalletChallengePurpose[WalletChallengePurpose["LOGIN"] = 1] = "LOGIN";
|
|
90
|
+
/**
|
|
91
|
+
* Prove control of a new smart account before creating a sub-account.
|
|
92
|
+
*
|
|
93
|
+
* @generated from enum value: CREATE_SUBACCOUNT = 2;
|
|
94
|
+
*/
|
|
95
|
+
WalletChallengePurpose[WalletChallengePurpose["CREATE_SUBACCOUNT"] = 2] = "CREATE_SUBACCOUNT";
|
|
96
|
+
return WalletChallengePurpose;
|
|
97
|
+
}({});
|
|
98
|
+
/**
|
|
99
|
+
* Describes the enum auth.v1.WalletChallengePurpose.
|
|
100
|
+
*/
|
|
101
|
+
const WalletChallengePurposeSchema = /*@__PURE__*/ enumDesc(file_auth_v1_auth, 0);
|
|
102
|
+
/**
|
|
71
103
|
* High-level error codes for authentication and account-domain failures.
|
|
72
104
|
*
|
|
73
105
|
* @generated from enum auth.v1.AuthErrorCode
|
|
@@ -324,7 +356,7 @@ let AuthErrorCode = /* @__PURE__ */ function(AuthErrorCode) {
|
|
|
324
356
|
/**
|
|
325
357
|
* Describes the enum auth.v1.AuthErrorCode.
|
|
326
358
|
*/
|
|
327
|
-
const AuthErrorCodeSchema = /*@__PURE__*/ enumDesc(file_auth_v1_auth,
|
|
359
|
+
const AuthErrorCodeSchema = /*@__PURE__*/ enumDesc(file_auth_v1_auth, 1);
|
|
328
360
|
/**
|
|
329
361
|
* AuthService manages wallet login, explicit terms consent, and caller authentication context.
|
|
330
362
|
*
|
|
@@ -332,6 +364,6 @@ const AuthErrorCodeSchema = /*@__PURE__*/ enumDesc(file_auth_v1_auth, 0);
|
|
|
332
364
|
*/
|
|
333
365
|
const AuthService = /*@__PURE__*/ serviceDesc(file_auth_v1_auth, 0);
|
|
334
366
|
//#endregion
|
|
335
|
-
export { AcceptTermsRequestSchema, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetailSchema, AuthService,
|
|
367
|
+
export { AcceptTermsRequestSchema, AcceptTermsResponseSchema, AuthErrorCode, AuthErrorCodeSchema, AuthErrorDetailSchema, AuthService, CreateWalletChallengeRequestSchema, CreateWalletChallengeResponseSchema, LoginWithWalletRequestSchema, LoginWithWalletResponseSchema, MeRequestSchema, MeResponseSchema, WalletChallengePurpose, WalletChallengePurposeSchema, auth_pb_exports, file_auth_v1_auth };
|
|
336
368
|
|
|
337
369
|
//# sourceMappingURL=auth_pb.js.map
|