@polyester/sdk 0.4.1 → 0.4.3
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 +16 -0
- package/dist/core-client.d.ts +9 -0
- package/dist/core-client.d.ts.map +1 -1
- package/dist/core-client.js +21 -0
- package/dist/core-client.js.map +1 -1
- package/dist/environment.js +4 -0
- package/dist/environment.js.map +1 -1
- package/dist/gen/fees/v1/fees_pb.d.ts +124 -0
- package/dist/gen/fees/v1/fees_pb.d.ts.map +1 -0
- package/dist/gen/fees/v1/fees_pb.js +39 -0
- package/dist/gen/fees/v1/fees_pb.js.map +1 -0
- package/dist/gen/index.d.ts +4 -1
- package/dist/gen/index.js +4 -1
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts +223 -0
- package/dist/gen/ratelimit/v1/ratelimit_pb.d.ts.map +1 -0
- package/dist/gen/ratelimit/v1/ratelimit_pb.js +86 -0
- package/dist/gen/ratelimit/v1/ratelimit_pb.js.map +1 -0
- package/dist/gen/vip/v1/vip_pb.d.ts +277 -0
- package/dist/gen/vip/v1/vip_pb.d.ts.map +1 -0
- package/dist/gen/vip/v1/vip_pb.js +60 -0
- package/dist/gen/vip/v1/vip_pb.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/services/candles/candles.schemas.d.ts +10 -10
- package/dist/services/fees/fees.d.ts +19 -0
- package/dist/services/fees/fees.d.ts.map +1 -0
- package/dist/services/fees/fees.js +32 -0
- package/dist/services/fees/fees.js.map +1 -0
- package/dist/services/fees/fees.schemas.d.ts +28 -0
- package/dist/services/fees/fees.schemas.d.ts.map +1 -0
- package/dist/services/fees/fees.schemas.js +25 -0
- package/dist/services/fees/fees.schemas.js.map +1 -0
- package/dist/services/fees/fees.types.d.ts +2 -0
- package/dist/services/fees/index.d.ts +3 -0
- package/dist/services/heatmap/heatmap.schemas.d.ts +13 -13
- package/dist/services/market-overview/market-overview.schemas.d.ts +3 -3
- 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-output.schemas.d.ts +12 -12
- package/dist/services/rate-limits/index.d.ts +4 -0
- package/dist/services/rate-limits/rate-limits.codecs.d.ts +6 -0
- package/dist/services/rate-limits/rate-limits.codecs.d.ts.map +1 -0
- package/dist/services/rate-limits/rate-limits.codecs.js +11 -0
- package/dist/services/rate-limits/rate-limits.codecs.js.map +1 -0
- package/dist/services/rate-limits/rate-limits.d.ts +24 -0
- package/dist/services/rate-limits/rate-limits.d.ts.map +1 -0
- package/dist/services/rate-limits/rate-limits.js +40 -0
- package/dist/services/rate-limits/rate-limits.js.map +1 -0
- package/dist/services/rate-limits/rate-limits.schemas.d.ts +58 -0
- package/dist/services/rate-limits/rate-limits.schemas.d.ts.map +1 -0
- package/dist/services/rate-limits/rate-limits.schemas.js +30 -0
- package/dist/services/rate-limits/rate-limits.schemas.js.map +1 -0
- package/dist/services/rate-limits/rate-limits.types.d.ts +3 -0
- package/dist/services/triggers/trigger-input.schemas.d.ts +1 -1
- package/dist/services/triggers/triggers-output.schemas.d.ts +1 -1
- package/dist/services/vip/index.d.ts +3 -0
- package/dist/services/vip/vip.d.ts +22 -0
- package/dist/services/vip/vip.d.ts.map +1 -0
- package/dist/services/vip/vip.js +35 -0
- package/dist/services/vip/vip.js.map +1 -0
- package/dist/services/vip/vip.schemas.d.ts +90 -0
- package/dist/services/vip/vip.schemas.d.ts.map +1 -0
- package/dist/services/vip/vip.schemas.js +47 -0
- package/dist/services/vip/vip.schemas.js.map +1 -0
- package/dist/services/vip/vip.types.d.ts +2 -0
- package/dist/wired-services.d.ts.map +1 -1
- package/dist/wired-services.js +6 -0
- package/dist/wired-services.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @polyester/sdk
|
|
2
2
|
|
|
3
|
+
## 0.4.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#60](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/60) [`f91caab`](https://github.com/Fabric-Labs/polyester-sdk-typescript/commit/f91caaba589ce689ffaa7d310f833373a8e61009) Thanks [@huntabyte](https://github.com/huntabyte)! - Declare the Multicall3 deployment (`0xF35A6AE5408fa1356064849D0BC3855f801aa6aC`, block 563457) on the Polychain testnet chain definition so viem clients can batch contract reads via multicall instead of issuing one `eth_call` per read.
|
|
8
|
+
|
|
9
|
+
## 0.4.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#58](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/58) [`c253beb`](https://github.com/Fabric-Labs/polyester-sdk-typescript/commit/c253beb9cbef0ab5d5d33cc330edc85ff585468b) Thanks [@aiiven](https://github.com/aiiven)! - feat(vip): add VIP tier catalog and status methods for public policy snapshots and authenticated caller-root qualification.
|
|
14
|
+
|
|
15
|
+
- [#58](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/58) [`c253beb`](https://github.com/Fabric-Labs/polyester-sdk-typescript/commit/c253beb9cbef0ab5d5d33cc330edc85ff585468b) Thanks [@aiiven](https://github.com/aiiven)! - feat(fees): add a spot fee rate method for authenticated effective maker and taker rates.
|
|
16
|
+
|
|
17
|
+
- [#58](https://github.com/Fabric-Labs/polyester-sdk-typescript/pull/58) [`c253beb`](https://github.com/Fabric-Labs/polyester-sdk-typescript/commit/c253beb9cbef0ab5d5d33cc330edc85ff585468b) Thanks [@aiiven](https://github.com/aiiven)! - feat(rate-limit): add trading rate-limit catalog and effective limit methods for public quota snapshots and authenticated account targets.
|
|
18
|
+
|
|
3
19
|
## 0.4.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/core-client.d.ts
CHANGED
|
@@ -55,6 +55,12 @@ import { ZipperService } from "./services/zipper/zipper.js";
|
|
|
55
55
|
import "./services/zipper/index.js";
|
|
56
56
|
import { MfaService } from "./services/mfa/mfa.js";
|
|
57
57
|
import "./services/mfa/index.js";
|
|
58
|
+
import { VipService } from "./services/vip/vip.js";
|
|
59
|
+
import "./services/vip/index.js";
|
|
60
|
+
import { FeesService } from "./services/fees/fees.js";
|
|
61
|
+
import "./services/fees/index.js";
|
|
62
|
+
import { RateLimitService } from "./services/rate-limits/rate-limits.js";
|
|
63
|
+
import "./services/rate-limits/index.js";
|
|
58
64
|
import { Interceptor } from "@connectrpc/connect";
|
|
59
65
|
//#region src/core-client.d.ts
|
|
60
66
|
type PolyesterRealtimeAuthConfig = Pick<RealtimeConfig, "getAuthHeaders" | "hasAuth">;
|
|
@@ -152,6 +158,9 @@ declare class PolyesterClient {
|
|
|
152
158
|
get whiteboard(): WhiteboardService;
|
|
153
159
|
get zipper(): ZipperService;
|
|
154
160
|
get mfa(): MfaService;
|
|
161
|
+
get vip(): VipService;
|
|
162
|
+
get fees(): FeesService;
|
|
163
|
+
get tradingRateLimits(): RateLimitService;
|
|
155
164
|
/**
|
|
156
165
|
* Override in subclasses to provide a subaccount resolver.
|
|
157
166
|
* The resolver is called lazily when service methods are invoked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.d.ts","names":[],"sources":["../src/core-client.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"core-client.d.ts","names":[],"sources":["../src/core-client.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+EY,8BAA8B,KAAK;UAErC;EACN,aAAa;EACb,eAAe;EACf,OAAO,kBAAkB;EACzB,WAAW;;;;;EAKX;;;;;;;EAOA,aAAa;;;;;;EAMb,iBAAiB;;KAGhB;;EAGK,SAAS;EACT;EACA;;EAGA;;;;;;EAMA,kBAAkB;;;;;EAKlB,cAAc;;;KAIZ,4BAA4B,8BAA8B;;KAG1D,wBAAwB;UAc1B;EACN,YAAY;EACZ,UAAU;EACV,aAAa;EACb,aAAa;;UAGP;EACN,cAAc,SAAS,8BAA8B;;;;;;;;;cAqC5C;;qBACU,YAAY;EA8CnB,YAAA,QAAQ,uBAAuB,UAAS;MAyBhD,YAAY;MAoBZ,WAAW;MAwCX,QAAQ;MAcR,YAAY;MAIZ,WAAW;MAQX,eAAe;MAQf,WAAW;MAQX,kBAAkB;MAOlB,cAAc;MAQd,kBAAkB;MAQlB,aAAa;MAQb,WAAW;MAQX,aAAa;MAIb,UAAU;MASV,UAAU;MASV,YAAY;MASZ,YAAY;MASZ,aAAa;MASb,qBAAqB;MAQrB,oBAAoB;MAapB,WAAW;MAIX,eAAe;MAQf,eAAe;MAOf,sBAAsB;MAMtB,cAAc;MAId,UAAU;MAQV,OAAO;MAIP,OAAO;MAOP,QAAQ;MAIR,qBAAqB;;;;;YAcf,4BAA4B"}
|
package/dist/core-client.js
CHANGED
|
@@ -27,6 +27,9 @@ import { SocialVerificationService } from "./services/social-verification/social
|
|
|
27
27
|
import { WhiteboardService } from "./services/whiteboard/whiteboard.js";
|
|
28
28
|
import { ZipperService } from "./services/zipper/zipper.js";
|
|
29
29
|
import { MfaService } from "./services/mfa/mfa.js";
|
|
30
|
+
import { VipService } from "./services/vip/vip.js";
|
|
31
|
+
import { FeesService } from "./services/fees/fees.js";
|
|
32
|
+
import { RateLimitService } from "./services/rate-limits/rate-limits.js";
|
|
30
33
|
import { createPolyesterCatalog } from "./catalogs/client-catalog.js";
|
|
31
34
|
import { RealtimeClient } from "./realtime/client.js";
|
|
32
35
|
//#region src/core-client.ts
|
|
@@ -118,6 +121,9 @@ var PolyesterClient = class {
|
|
|
118
121
|
#whiteboard;
|
|
119
122
|
#zipper;
|
|
120
123
|
#mfa;
|
|
124
|
+
#vip;
|
|
125
|
+
#fees;
|
|
126
|
+
#tradingRateLimits;
|
|
121
127
|
constructor(config, runtime = {}) {
|
|
122
128
|
config = parsePolyesterClientConfig(config);
|
|
123
129
|
const interceptors = config.interceptors ?? [];
|
|
@@ -272,6 +278,21 @@ var PolyesterClient = class {
|
|
|
272
278
|
get mfa() {
|
|
273
279
|
return this.#mfa ??= new MfaService(this.transports.authApi);
|
|
274
280
|
}
|
|
281
|
+
get vip() {
|
|
282
|
+
return this.#vip ??= new VipService({
|
|
283
|
+
publicApi: this.transports.publicApi,
|
|
284
|
+
authApi: this.transports.authApi
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
get fees() {
|
|
288
|
+
return this.#fees ??= new FeesService(this.transports.authApi, this.#getResolver());
|
|
289
|
+
}
|
|
290
|
+
get tradingRateLimits() {
|
|
291
|
+
return this.#tradingRateLimits ??= new RateLimitService({
|
|
292
|
+
publicApi: this.transports.publicApi,
|
|
293
|
+
authApi: this.transports.authApi
|
|
294
|
+
}, this.#getResolver());
|
|
295
|
+
}
|
|
275
296
|
/**
|
|
276
297
|
* Override in subclasses to provide a subaccount resolver.
|
|
277
298
|
* The resolver is called lazily when service methods are invoked.
|
package/dist/core-client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-client.js","names":["#environment","#authProvider","#realtimeConfig","#configRealtimeClient","#configCatalog","#configCatalogSnapshot","#configCatalogCell","#createAuth","#realtime","#catalog","#getScales","#scales","#resolverInitialized","#resolver","#auth","#accounts","#apiKeys","#getResolver","#subaccounts","#candles","#chainAnalytics","#marketData","#marketOverview","#orderbook","#heatmap","#lifecycle","#trades","#orders","#triggers","#balances","#transfers","#internalTransfers","#tradingWithdraws","#deposit","#addressBook","#guardSigner","#socialVerification","#whiteboard","#zipper","#mfa"],"sources":["../src/core-client.ts"],"sourcesContent":["import type { Interceptor } from \"@connectrpc/connect\";\nimport { ConfigurationError } from \"./shared/errors.js\";\nimport {\n createApiKeyEd25519AuthHeaders,\n createTransports,\n type Transports,\n type JwtAuthProvider,\n type ApiKeyEd25519AuthProvider,\n} from \"./shared/transports.js\";\nimport { parsePolyesterEnvironment, type PolyesterEnvironment } from \"./environment.js\";\nimport { AccountsService } from \"./services/accounts/index.js\";\nimport { ApiKeysService } from \"./services/api-keys/index.js\";\nimport { AuthService, type AuthServiceTransports } from \"./services/auth/auth.js\";\nimport { SubaccountsService } from \"./services/subaccounts/index.js\";\nimport { CandlesService } from \"./services/candles/index.js\";\nimport { ChainAnalyticsService } from \"./services/chain-analytics/index.js\";\nimport { MarketDataService } from \"./services/market-data/index.js\";\nimport { MarketOverviewService } from \"./services/market-overview/index.js\";\nimport { OrderbookService } from \"./services/orderbook/index.js\";\nimport { HeatmapService } from \"./services/heatmap/index.js\";\nimport { LifecycleService } from \"./services/lifecycle/index.js\";\nimport { TradesService } from \"./services/trades/index.js\";\nimport { OrdersService } from \"./services/orders/index.js\";\nimport { TriggersService } from \"./services/triggers/index.js\";\nimport { BalancesService } from \"./services/balances/index.js\";\nimport { TransfersService } from \"./services/transfers/index.js\";\nimport { InternalTransfersService } from \"./services/internal-transfers/index.js\";\nimport { TradingWithdrawsService } from \"./services/trading-withdraws/index.js\";\nimport { DepositService } from \"./services/deposit/index.js\";\nimport { AddressBookService } from \"./services/address-book/index.js\";\nimport { GuardSignerService } from \"./services/guard-signer/index.js\";\nimport { SocialVerificationService } from \"./services/social-verification/index.js\";\nimport { WhiteboardService } from \"./services/whiteboard/index.js\";\nimport { ZipperService } from \"./services/zipper/index.js\";\nimport { MfaService } from \"./services/mfa/index.js\";\nimport type { SubaccountResolver } from \"./services/subaccount-resolver.js\";\nimport {\n createPolyesterCatalog,\n type CatalogSnapshot,\n type CatalogSnapshotCell,\n type ClientCatalog,\n} from \"./catalogs/index.js\";\nimport { createCatalogSdkScales, type SdkScales } from \"./shared/decimal-surface.js\";\nimport { RealtimeClient, type PolyesterRealtime, type RealtimeConfig } from \"./realtime/index.js\";\n\nfunction realtimeAuthFromProvider(\n auth: JwtAuthProvider | ApiKeyEd25519AuthProvider | undefined,\n): Pick<RealtimeConfig, \"getAuthHeaders\" | \"hasAuth\"> {\n if (!auth) return {};\n if (auth.kind === \"jwt\") {\n return {\n getAuthHeaders: async () => {\n const token = await auth.getToken();\n const headers: Record<string, string> = {};\n if (token) headers.authorization = `Bearer ${token}`;\n return headers;\n },\n hasAuth: () => {\n // Only token getters that resolve synchronously can be checked here;\n // async getters are assumed authenticated and fail at token fetch.\n const token = auth.getToken();\n if (token instanceof Promise) return true;\n return typeof token === \"string\" && token.length > 0;\n },\n };\n }\n return {\n getAuthHeaders: (request) =>\n createApiKeyEd25519AuthHeaders(auth, {\n url: request.url,\n method: request.method,\n }),\n hasAuth: () => true,\n };\n}\n\nexport type PolyesterRealtimeAuthConfig = Pick<RealtimeConfig, \"getAuthHeaders\" | \"hasAuth\">;\n\ninterface PolyesterClientCommonConfig {\n environment: PolyesterEnvironment;\n interceptors?: Interceptor[];\n auth?: JwtAuthProvider | ApiKeyEd25519AuthProvider;\n realtime?: PolyesterRealtimeAuthConfig;\n /**\n * Connect wire format. Defaults to binary for production performance.\n * Use `json` for human-readable debugging.\n */\n wireFormat?: \"binary\" | \"json\";\n /**\n * Advanced: inject pre-built Connect transports (in-memory mocks, custom\n * stacks). When provided, the SDK does not build its own transports and the\n * built-in auth/error-mapping interceptors are NOT applied — the injected\n * transports own their full interceptor chain.\n */\n transports?: Transports;\n /**\n * Advanced: inject a realtime implementation (in-memory mocks, custom\n * stacks). When provided, the SDK skips constructing its Centrifuge-backed\n * realtime client and the `realtime` auth config is ignored.\n */\n realtimeClient?: PolyesterRealtime;\n}\n\ntype PolyesterCatalogConfig =\n | {\n /** Client-owned catalog store. */\n catalog: ClientCatalog;\n catalogSnapshot?: never;\n catalogCell?: never;\n }\n | {\n catalog?: never;\n /**\n * Explicit initial catalog snapshot, commonly hydrated from server-rendered data.\n * Combines with `catalogCell` as the cell's initial value without clobbering a\n * pre-populated cell.\n */\n catalogSnapshot?: CatalogSnapshot;\n /**\n * External snapshot storage for the client-built catalog. A cell backed by a\n * reactive source makes every catalog read reactive.\n */\n catalogCell?: CatalogSnapshotCell;\n };\n\n/** Configuration shared by every Polyester client. */\nexport type PolyesterClientBaseConfig = PolyesterClientCommonConfig & PolyesterCatalogConfig;\n\n/** Configuration for the base Polyester client. */\nexport type PolyesterClientConfig = PolyesterClientBaseConfig;\n\n/** Preserves the exclusive catalog configuration while projecting client config fields. */\nexport function pickPolyesterCatalogConfig(\n config: PolyesterClientBaseConfig,\n): PolyesterCatalogConfig {\n return config.catalog === undefined\n ? {\n catalogSnapshot: config.catalogSnapshot,\n catalogCell: config.catalogCell,\n }\n : { catalog: config.catalog };\n}\n\ninterface AuthServiceFactoryContext {\n transports: AuthServiceTransports;\n realtime: PolyesterRealtime;\n subaccounts: SubaccountsService;\n environment: PolyesterEnvironment;\n}\n\ninterface PolyesterClientRuntimeConfig {\n createAuth?: (context: AuthServiceFactoryContext) => AuthService;\n}\n\n/**\n * Parses the configuration shared by every public client constructor.\n */\nexport function parsePolyesterClientConfig<TConfig extends PolyesterClientBaseConfig>(\n config: TConfig,\n): TConfig {\n if (typeof config !== \"object\" || config === null || Array.isArray(config)) {\n throw new ConfigurationError(\"Client configuration must be an object.\");\n }\n const environment = parsePolyesterEnvironment(config.environment);\n if (\n config.wireFormat !== undefined &&\n config.wireFormat !== \"binary\" &&\n config.wireFormat !== \"json\"\n ) {\n throw new ConfigurationError('wireFormat must be either \"binary\" or \"json\".');\n }\n if (config.catalog && config.catalogSnapshot) {\n throw new ConfigurationError(\"Provide either catalog or catalogSnapshot, not both.\");\n }\n if (config.catalog && config.catalogCell) {\n throw new ConfigurationError(\"Provide either catalog or catalogCell, not both.\");\n }\n\n return Object.assign({}, config, { environment });\n}\n\n/**\n * Base SDK client that wires transports, realtime, catalogs, and all public service clients for a Polyester environment.\n *\n * Services are constructed lazily on first property access (and memoized) so\n * that creating a client — which happens for every SSR request in server\n * hooks — only pays for the services the caller actually touches.\n */\nexport class PolyesterClient {\n protected readonly transports: Transports;\n\n readonly #environment: PolyesterEnvironment;\n readonly #authProvider: JwtAuthProvider | ApiKeyEd25519AuthProvider | undefined;\n readonly #realtimeConfig: PolyesterRealtimeAuthConfig | undefined;\n readonly #configRealtimeClient: PolyesterRealtime | undefined;\n readonly #configCatalog: ClientCatalog | undefined;\n readonly #configCatalogSnapshot: CatalogSnapshot | undefined;\n readonly #configCatalogCell: CatalogSnapshotCell | undefined;\n readonly #createAuth: PolyesterClientRuntimeConfig[\"createAuth\"];\n\n #realtime: PolyesterRealtime | undefined;\n #catalog: ClientCatalog | undefined;\n #scales: SdkScales | undefined;\n #resolver: SubaccountResolver | undefined;\n #resolverInitialized = false;\n\n #auth: AuthService | undefined;\n #accounts: AccountsService | undefined;\n #apiKeys: ApiKeysService | undefined;\n #subaccounts: SubaccountsService | undefined;\n #candles: CandlesService | undefined;\n #chainAnalytics: ChainAnalyticsService | undefined;\n #marketData: MarketDataService | undefined;\n #marketOverview: MarketOverviewService | undefined;\n #orderbook: OrderbookService | undefined;\n #heatmap: HeatmapService | undefined;\n #lifecycle: LifecycleService | undefined;\n #trades: TradesService | undefined;\n #orders: OrdersService | undefined;\n #triggers: TriggersService | undefined;\n #balances: BalancesService | undefined;\n #transfers: TransfersService | undefined;\n #internalTransfers: InternalTransfersService | undefined;\n #tradingWithdraws: TradingWithdrawsService | undefined;\n #deposit: DepositService | undefined;\n #addressBook: AddressBookService | undefined;\n #guardSigner: GuardSignerService | undefined;\n #socialVerification: SocialVerificationService | undefined;\n #whiteboard: WhiteboardService | undefined;\n #zipper: ZipperService | undefined;\n #mfa: MfaService | undefined;\n\n constructor(config: PolyesterClientConfig, runtime: PolyesterClientRuntimeConfig = {}) {\n const parsedConfig = parsePolyesterClientConfig(config);\n config = parsedConfig;\n const interceptors = config.interceptors ?? [];\n const { environment } = config;\n\n this.transports =\n config.transports ??\n createTransports({\n apiUrl: environment.apiUrl,\n interceptors,\n auth: config.auth,\n wireFormat: config.wireFormat,\n });\n\n this.#environment = environment;\n this.#authProvider = config.auth;\n this.#realtimeConfig = config.realtime;\n this.#configRealtimeClient = config.realtimeClient;\n this.#configCatalog = config.catalog;\n this.#configCatalogSnapshot = config.catalogSnapshot;\n this.#configCatalogCell = config.catalogCell;\n this.#createAuth = runtime.createAuth;\n }\n\n get realtime(): PolyesterRealtime {\n if (!this.#realtime) {\n if (this.#configRealtimeClient) {\n this.#realtime = this.#configRealtimeClient;\n } else {\n const environment = this.#environment;\n const realtimeAuth = realtimeAuthFromProvider(this.#authProvider);\n this.#realtime = new RealtimeClient({\n wsUrl: environment.websocketUrl,\n tokenEndpoint: `${environment.apiUrl}/v1/rt/token`,\n subscribeEndpoint: `${environment.apiUrl}/v1/rt/subscribe`,\n getAuthHeaders:\n this.#realtimeConfig?.getAuthHeaders ?? realtimeAuth.getAuthHeaders,\n hasAuth: this.#realtimeConfig?.hasAuth ?? realtimeAuth.hasAuth,\n });\n }\n }\n return this.#realtime;\n }\n\n get catalog(): ClientCatalog {\n if (!this.#catalog) {\n if (this.#configCatalog) {\n this.#catalog = this.#configCatalog;\n } else {\n const catalogRefreshMarketData = new MarketDataService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n );\n const catalogRefreshZipper = new ZipperService(this.transports.publicApi);\n this.#catalog = createPolyesterCatalog({\n snapshot: this.#configCatalogSnapshot,\n cell: this.#configCatalogCell,\n refresh: {\n market: () => catalogRefreshMarketData.getSpotConfig(),\n zipper: () => catalogRefreshZipper.getDepositWithdrawConfig(),\n },\n });\n }\n }\n return this.#catalog;\n }\n\n #getScales(): SdkScales {\n // Lazy catalog binding: the resolver only dereferences `this.catalog` at\n // call time. getSpotConfig() (the catalog's own refresh source) never\n // awaits scale readiness.\n this.#scales ??= createCatalogSdkScales(() => this.catalog);\n return this.#scales;\n }\n\n #getResolver(): SubaccountResolver | undefined {\n if (!this.#resolverInitialized) {\n this.#resolverInitialized = true;\n this.#resolver = this.createSubaccountResolver();\n }\n return this.#resolver;\n }\n\n get auth(): AuthService {\n if (!this.#auth) {\n const { authApi, publicApi } = this.transports;\n this.#auth =\n this.#createAuth?.({\n transports: { publicApi, authApi },\n realtime: this.realtime,\n subaccounts: this.subaccounts,\n environment: this.#environment,\n }) ?? new AuthService({ publicApi, authApi }, this.realtime);\n }\n return this.#auth;\n }\n\n get accounts(): AccountsService {\n return (this.#accounts ??= new AccountsService(this.transports.authApi));\n }\n\n get apiKeys(): ApiKeysService {\n return (this.#apiKeys ??= new ApiKeysService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get subaccounts(): SubaccountsService {\n return (this.#subaccounts ??= new SubaccountsService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get candles(): CandlesService {\n return (this.#candles ??= new CandlesService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get chainAnalytics(): ChainAnalyticsService {\n return (this.#chainAnalytics ??= new ChainAnalyticsService(\n this.transports.publicApi,\n this.#getScales(),\n ));\n }\n\n get marketData(): MarketDataService {\n return (this.#marketData ??= new MarketDataService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get marketOverview(): MarketOverviewService {\n return (this.#marketOverview ??= new MarketOverviewService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get orderbook(): OrderbookService {\n return (this.#orderbook ??= new OrderbookService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get heatmap(): HeatmapService {\n return (this.#heatmap ??= new HeatmapService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get lifecycle(): LifecycleService {\n return (this.#lifecycle ??= new LifecycleService(this.transports.publicApi, this.realtime));\n }\n\n get trades(): TradesService {\n return (this.#trades ??= new TradesService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get orders(): OrdersService {\n return (this.#orders ??= new OrdersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get triggers(): TriggersService {\n return (this.#triggers ??= new TriggersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get balances(): BalancesService {\n return (this.#balances ??= new BalancesService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get transfers(): TransfersService {\n return (this.#transfers ??= new TransfersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get internalTransfers(): InternalTransfersService {\n return (this.#internalTransfers ??= new InternalTransfersService(\n this.transports.authApi,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get tradingWithdraws(): TradingWithdrawsService {\n return (this.#tradingWithdraws ??= new TradingWithdrawsService(\n this.transports.authApi,\n this.#getResolver(),\n {\n chainId: this.#environment.chain.id,\n tradingGatewayAddress: this.#environment.contracts.tradingGatewayAddress,\n },\n this.#getScales(),\n this.catalog,\n ));\n }\n\n get deposit(): DepositService {\n return (this.#deposit ??= new DepositService(this.transports.authApi, this.#getResolver()));\n }\n\n get addressBook(): AddressBookService {\n return (this.#addressBook ??= new AddressBookService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get guardSigner(): GuardSignerService {\n return (this.#guardSigner ??= new GuardSignerService(\n this.transports.authApi,\n this.#getResolver(),\n ));\n }\n\n get socialVerification(): SocialVerificationService {\n return (this.#socialVerification ??= new SocialVerificationService(\n this.transports.authApi,\n ));\n }\n\n get whiteboard(): WhiteboardService {\n return (this.#whiteboard ??= new WhiteboardService(this.transports.authApi));\n }\n\n get zipper(): ZipperService {\n return (this.#zipper ??= new ZipperService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get mfa(): MfaService {\n return (this.#mfa ??= new MfaService(this.transports.authApi));\n }\n\n /**\n * Override in subclasses to provide a subaccount resolver.\n * The resolver is called lazily when service methods are invoked.\n */\n protected createSubaccountResolver(): SubaccountResolver | undefined {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,SAAS,yBACL,MACkD;CAClD,IAAI,CAAC,MA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KAAKd,aAAa,GAClB,KAAKP,WAAW,CACpB;CACJ;CAEA,IAAI,mBAA4C;EAC5C,OAAQ,KAAKsB,sBAAsB,IAAI,wBACnC,KAAK,WAAW,SAChB,KAAKf,aAAa,GAClB;GACI,SAAS,KAAKjB,aAAa,MAAM;GACjC,uBAAuB,KAAKA,aAAa,UAAU;EACvD,GACA,KAAKU,WAAW,GAChB,KAAK,OACT;CACJ;CAEA,IAAI,UAA0B;EAC1B,OAAQ,KAAKuB,aAAa,IAAI,eAAe,KAAK,WAAW,SAAS,KAAKhB,aAAa,CAAC;CAC7F;CAEA,IAAI,cAAkC;EAClC,OAAQ,KAAKiB,iBAAiB,IAAI,mBAC9B,KAAK,WAAW,SAChB,KAAK,UACL,KAAKjB,aAAa,CACtB;CACJ;CAEA,IAAI,cAAkC;EAClC,OAAQ,KAAKkB,iBAAiB,IAAI,mBAC9B,KAAK,WAAW,SAChB,KAAKlB,aAAa,CACtB;CACJ;CAEA,IAAI,qBAAgD;EAChD,OAAQ,KAAKmB,wBAAwB,IAAI,0BACrC,KAAK,WAAW,OACpB;CACJ;CAEA,IAAI,aAAgC;EAChC,OAAQ,KAAKC,gBAAgB,IAAI,kBAAkB,KAAK,WAAW,OAAO;CAC9E;CAEA,IAAI,SAAwB;EACxB,OAAQ,KAAKC,YAAY,IAAI,cACzB,KAAK,WAAW,WAChB,KAAK,UACL,KAAK5B,WAAW,CACpB;CACJ;CAEA,IAAI,MAAkB;EAClB,OAAQ,KAAK6B,SAAS,IAAI,WAAW,KAAK,WAAW,OAAO;CAChE;;;;;CAMA,2BAAqE,CAErE;AACJ"}
|
|
1
|
+
{"version":3,"file":"core-client.js","names":["#environment","#authProvider","#realtimeConfig","#configRealtimeClient","#configCatalog","#configCatalogSnapshot","#configCatalogCell","#createAuth","#realtime","#catalog","#getScales","#scales","#resolverInitialized","#resolver","#auth","#accounts","#apiKeys","#getResolver","#subaccounts","#candles","#chainAnalytics","#marketData","#marketOverview","#orderbook","#heatmap","#lifecycle","#trades","#orders","#triggers","#balances","#transfers","#internalTransfers","#tradingWithdraws","#deposit","#addressBook","#guardSigner","#socialVerification","#whiteboard","#zipper","#mfa","#vip","#fees","#tradingRateLimits"],"sources":["../src/core-client.ts"],"sourcesContent":["import type { Interceptor } from \"@connectrpc/connect\";\nimport { ConfigurationError } from \"./shared/errors.js\";\nimport {\n createApiKeyEd25519AuthHeaders,\n createTransports,\n type Transports,\n type JwtAuthProvider,\n type ApiKeyEd25519AuthProvider,\n} from \"./shared/transports.js\";\nimport { parsePolyesterEnvironment, type PolyesterEnvironment } from \"./environment.js\";\nimport { AccountsService } from \"./services/accounts/index.js\";\nimport { ApiKeysService } from \"./services/api-keys/index.js\";\nimport { AuthService, type AuthServiceTransports } from \"./services/auth/auth.js\";\nimport { SubaccountsService } from \"./services/subaccounts/index.js\";\nimport { CandlesService } from \"./services/candles/index.js\";\nimport { ChainAnalyticsService } from \"./services/chain-analytics/index.js\";\nimport { MarketDataService } from \"./services/market-data/index.js\";\nimport { MarketOverviewService } from \"./services/market-overview/index.js\";\nimport { OrderbookService } from \"./services/orderbook/index.js\";\nimport { HeatmapService } from \"./services/heatmap/index.js\";\nimport { LifecycleService } from \"./services/lifecycle/index.js\";\nimport { TradesService } from \"./services/trades/index.js\";\nimport { OrdersService } from \"./services/orders/index.js\";\nimport { TriggersService } from \"./services/triggers/index.js\";\nimport { BalancesService } from \"./services/balances/index.js\";\nimport { TransfersService } from \"./services/transfers/index.js\";\nimport { InternalTransfersService } from \"./services/internal-transfers/index.js\";\nimport { TradingWithdrawsService } from \"./services/trading-withdraws/index.js\";\nimport { DepositService } from \"./services/deposit/index.js\";\nimport { AddressBookService } from \"./services/address-book/index.js\";\nimport { GuardSignerService } from \"./services/guard-signer/index.js\";\nimport { SocialVerificationService } from \"./services/social-verification/index.js\";\nimport { WhiteboardService } from \"./services/whiteboard/index.js\";\nimport { ZipperService } from \"./services/zipper/index.js\";\nimport { MfaService } from \"./services/mfa/index.js\";\nimport { VipService } from \"./services/vip/index.js\";\nimport { FeesService } from \"./services/fees/index.js\";\nimport { RateLimitService } from \"./services/rate-limits/index.js\";\nimport type { SubaccountResolver } from \"./services/subaccount-resolver.js\";\nimport {\n createPolyesterCatalog,\n type CatalogSnapshot,\n type CatalogSnapshotCell,\n type ClientCatalog,\n} from \"./catalogs/index.js\";\nimport { createCatalogSdkScales, type SdkScales } from \"./shared/decimal-surface.js\";\nimport { RealtimeClient, type PolyesterRealtime, type RealtimeConfig } from \"./realtime/index.js\";\n\nfunction realtimeAuthFromProvider(\n auth: JwtAuthProvider | ApiKeyEd25519AuthProvider | undefined,\n): Pick<RealtimeConfig, \"getAuthHeaders\" | \"hasAuth\"> {\n if (!auth) return {};\n if (auth.kind === \"jwt\") {\n return {\n getAuthHeaders: async () => {\n const token = await auth.getToken();\n const headers: Record<string, string> = {};\n if (token) headers.authorization = `Bearer ${token}`;\n return headers;\n },\n hasAuth: () => {\n // Only token getters that resolve synchronously can be checked here;\n // async getters are assumed authenticated and fail at token fetch.\n const token = auth.getToken();\n if (token instanceof Promise) return true;\n return typeof token === \"string\" && token.length > 0;\n },\n };\n }\n return {\n getAuthHeaders: (request) =>\n createApiKeyEd25519AuthHeaders(auth, {\n url: request.url,\n method: request.method,\n }),\n hasAuth: () => true,\n };\n}\n\nexport type PolyesterRealtimeAuthConfig = Pick<RealtimeConfig, \"getAuthHeaders\" | \"hasAuth\">;\n\ninterface PolyesterClientCommonConfig {\n environment: PolyesterEnvironment;\n interceptors?: Interceptor[];\n auth?: JwtAuthProvider | ApiKeyEd25519AuthProvider;\n realtime?: PolyesterRealtimeAuthConfig;\n /**\n * Connect wire format. Defaults to binary for production performance.\n * Use `json` for human-readable debugging.\n */\n wireFormat?: \"binary\" | \"json\";\n /**\n * Advanced: inject pre-built Connect transports (in-memory mocks, custom\n * stacks). When provided, the SDK does not build its own transports and the\n * built-in auth/error-mapping interceptors are NOT applied — the injected\n * transports own their full interceptor chain.\n */\n transports?: Transports;\n /**\n * Advanced: inject a realtime implementation (in-memory mocks, custom\n * stacks). When provided, the SDK skips constructing its Centrifuge-backed\n * realtime client and the `realtime` auth config is ignored.\n */\n realtimeClient?: PolyesterRealtime;\n}\n\ntype PolyesterCatalogConfig =\n | {\n /** Client-owned catalog store. */\n catalog: ClientCatalog;\n catalogSnapshot?: never;\n catalogCell?: never;\n }\n | {\n catalog?: never;\n /**\n * Explicit initial catalog snapshot, commonly hydrated from server-rendered data.\n * Combines with `catalogCell` as the cell's initial value without clobbering a\n * pre-populated cell.\n */\n catalogSnapshot?: CatalogSnapshot;\n /**\n * External snapshot storage for the client-built catalog. A cell backed by a\n * reactive source makes every catalog read reactive.\n */\n catalogCell?: CatalogSnapshotCell;\n };\n\n/** Configuration shared by every Polyester client. */\nexport type PolyesterClientBaseConfig = PolyesterClientCommonConfig & PolyesterCatalogConfig;\n\n/** Configuration for the base Polyester client. */\nexport type PolyesterClientConfig = PolyesterClientBaseConfig;\n\n/** Preserves the exclusive catalog configuration while projecting client config fields. */\nexport function pickPolyesterCatalogConfig(\n config: PolyesterClientBaseConfig,\n): PolyesterCatalogConfig {\n return config.catalog === undefined\n ? {\n catalogSnapshot: config.catalogSnapshot,\n catalogCell: config.catalogCell,\n }\n : { catalog: config.catalog };\n}\n\ninterface AuthServiceFactoryContext {\n transports: AuthServiceTransports;\n realtime: PolyesterRealtime;\n subaccounts: SubaccountsService;\n environment: PolyesterEnvironment;\n}\n\ninterface PolyesterClientRuntimeConfig {\n createAuth?: (context: AuthServiceFactoryContext) => AuthService;\n}\n\n/**\n * Parses the configuration shared by every public client constructor.\n */\nexport function parsePolyesterClientConfig<TConfig extends PolyesterClientBaseConfig>(\n config: TConfig,\n): TConfig {\n if (typeof config !== \"object\" || config === null || Array.isArray(config)) {\n throw new ConfigurationError(\"Client configuration must be an object.\");\n }\n const environment = parsePolyesterEnvironment(config.environment);\n if (\n config.wireFormat !== undefined &&\n config.wireFormat !== \"binary\" &&\n config.wireFormat !== \"json\"\n ) {\n throw new ConfigurationError('wireFormat must be either \"binary\" or \"json\".');\n }\n if (config.catalog && config.catalogSnapshot) {\n throw new ConfigurationError(\"Provide either catalog or catalogSnapshot, not both.\");\n }\n if (config.catalog && config.catalogCell) {\n throw new ConfigurationError(\"Provide either catalog or catalogCell, not both.\");\n }\n\n return Object.assign({}, config, { environment });\n}\n\n/**\n * Base SDK client that wires transports, realtime, catalogs, and all public service clients for a Polyester environment.\n *\n * Services are constructed lazily on first property access (and memoized) so\n * that creating a client — which happens for every SSR request in server\n * hooks — only pays for the services the caller actually touches.\n */\nexport class PolyesterClient {\n protected readonly transports: Transports;\n\n readonly #environment: PolyesterEnvironment;\n readonly #authProvider: JwtAuthProvider | ApiKeyEd25519AuthProvider | undefined;\n readonly #realtimeConfig: PolyesterRealtimeAuthConfig | undefined;\n readonly #configRealtimeClient: PolyesterRealtime | undefined;\n readonly #configCatalog: ClientCatalog | undefined;\n readonly #configCatalogSnapshot: CatalogSnapshot | undefined;\n readonly #configCatalogCell: CatalogSnapshotCell | undefined;\n readonly #createAuth: PolyesterClientRuntimeConfig[\"createAuth\"];\n\n #realtime: PolyesterRealtime | undefined;\n #catalog: ClientCatalog | undefined;\n #scales: SdkScales | undefined;\n #resolver: SubaccountResolver | undefined;\n #resolverInitialized = false;\n\n #auth: AuthService | undefined;\n #accounts: AccountsService | undefined;\n #apiKeys: ApiKeysService | undefined;\n #subaccounts: SubaccountsService | undefined;\n #candles: CandlesService | undefined;\n #chainAnalytics: ChainAnalyticsService | undefined;\n #marketData: MarketDataService | undefined;\n #marketOverview: MarketOverviewService | undefined;\n #orderbook: OrderbookService | undefined;\n #heatmap: HeatmapService | undefined;\n #lifecycle: LifecycleService | undefined;\n #trades: TradesService | undefined;\n #orders: OrdersService | undefined;\n #triggers: TriggersService | undefined;\n #balances: BalancesService | undefined;\n #transfers: TransfersService | undefined;\n #internalTransfers: InternalTransfersService | undefined;\n #tradingWithdraws: TradingWithdrawsService | undefined;\n #deposit: DepositService | undefined;\n #addressBook: AddressBookService | undefined;\n #guardSigner: GuardSignerService | undefined;\n #socialVerification: SocialVerificationService | undefined;\n #whiteboard: WhiteboardService | undefined;\n #zipper: ZipperService | undefined;\n #mfa: MfaService | undefined;\n #vip: VipService | undefined;\n #fees: FeesService | undefined;\n #tradingRateLimits: RateLimitService | undefined;\n\n constructor(config: PolyesterClientConfig, runtime: PolyesterClientRuntimeConfig = {}) {\n const parsedConfig = parsePolyesterClientConfig(config);\n config = parsedConfig;\n const interceptors = config.interceptors ?? [];\n const { environment } = config;\n\n this.transports =\n config.transports ??\n createTransports({\n apiUrl: environment.apiUrl,\n interceptors,\n auth: config.auth,\n wireFormat: config.wireFormat,\n });\n\n this.#environment = environment;\n this.#authProvider = config.auth;\n this.#realtimeConfig = config.realtime;\n this.#configRealtimeClient = config.realtimeClient;\n this.#configCatalog = config.catalog;\n this.#configCatalogSnapshot = config.catalogSnapshot;\n this.#configCatalogCell = config.catalogCell;\n this.#createAuth = runtime.createAuth;\n }\n\n get realtime(): PolyesterRealtime {\n if (!this.#realtime) {\n if (this.#configRealtimeClient) {\n this.#realtime = this.#configRealtimeClient;\n } else {\n const environment = this.#environment;\n const realtimeAuth = realtimeAuthFromProvider(this.#authProvider);\n this.#realtime = new RealtimeClient({\n wsUrl: environment.websocketUrl,\n tokenEndpoint: `${environment.apiUrl}/v1/rt/token`,\n subscribeEndpoint: `${environment.apiUrl}/v1/rt/subscribe`,\n getAuthHeaders:\n this.#realtimeConfig?.getAuthHeaders ?? realtimeAuth.getAuthHeaders,\n hasAuth: this.#realtimeConfig?.hasAuth ?? realtimeAuth.hasAuth,\n });\n }\n }\n return this.#realtime;\n }\n\n get catalog(): ClientCatalog {\n if (!this.#catalog) {\n if (this.#configCatalog) {\n this.#catalog = this.#configCatalog;\n } else {\n const catalogRefreshMarketData = new MarketDataService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n );\n const catalogRefreshZipper = new ZipperService(this.transports.publicApi);\n this.#catalog = createPolyesterCatalog({\n snapshot: this.#configCatalogSnapshot,\n cell: this.#configCatalogCell,\n refresh: {\n market: () => catalogRefreshMarketData.getSpotConfig(),\n zipper: () => catalogRefreshZipper.getDepositWithdrawConfig(),\n },\n });\n }\n }\n return this.#catalog;\n }\n\n #getScales(): SdkScales {\n // Lazy catalog binding: the resolver only dereferences `this.catalog` at\n // call time. getSpotConfig() (the catalog's own refresh source) never\n // awaits scale readiness.\n this.#scales ??= createCatalogSdkScales(() => this.catalog);\n return this.#scales;\n }\n\n #getResolver(): SubaccountResolver | undefined {\n if (!this.#resolverInitialized) {\n this.#resolverInitialized = true;\n this.#resolver = this.createSubaccountResolver();\n }\n return this.#resolver;\n }\n\n get auth(): AuthService {\n if (!this.#auth) {\n const { authApi, publicApi } = this.transports;\n this.#auth =\n this.#createAuth?.({\n transports: { publicApi, authApi },\n realtime: this.realtime,\n subaccounts: this.subaccounts,\n environment: this.#environment,\n }) ?? new AuthService({ publicApi, authApi }, this.realtime);\n }\n return this.#auth;\n }\n\n get accounts(): AccountsService {\n return (this.#accounts ??= new AccountsService(this.transports.authApi));\n }\n\n get apiKeys(): ApiKeysService {\n return (this.#apiKeys ??= new ApiKeysService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get subaccounts(): SubaccountsService {\n return (this.#subaccounts ??= new SubaccountsService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get candles(): CandlesService {\n return (this.#candles ??= new CandlesService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get chainAnalytics(): ChainAnalyticsService {\n return (this.#chainAnalytics ??= new ChainAnalyticsService(\n this.transports.publicApi,\n this.#getScales(),\n ));\n }\n\n get marketData(): MarketDataService {\n return (this.#marketData ??= new MarketDataService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get marketOverview(): MarketOverviewService {\n return (this.#marketOverview ??= new MarketOverviewService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get orderbook(): OrderbookService {\n return (this.#orderbook ??= new OrderbookService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get heatmap(): HeatmapService {\n return (this.#heatmap ??= new HeatmapService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get lifecycle(): LifecycleService {\n return (this.#lifecycle ??= new LifecycleService(this.transports.publicApi, this.realtime));\n }\n\n get trades(): TradesService {\n return (this.#trades ??= new TradesService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get orders(): OrdersService {\n return (this.#orders ??= new OrdersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get triggers(): TriggersService {\n return (this.#triggers ??= new TriggersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get balances(): BalancesService {\n return (this.#balances ??= new BalancesService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get transfers(): TransfersService {\n return (this.#transfers ??= new TransfersService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get internalTransfers(): InternalTransfersService {\n return (this.#internalTransfers ??= new InternalTransfersService(\n this.transports.authApi,\n this.#getResolver(),\n this.#getScales(),\n ));\n }\n\n get tradingWithdraws(): TradingWithdrawsService {\n return (this.#tradingWithdraws ??= new TradingWithdrawsService(\n this.transports.authApi,\n this.#getResolver(),\n {\n chainId: this.#environment.chain.id,\n tradingGatewayAddress: this.#environment.contracts.tradingGatewayAddress,\n },\n this.#getScales(),\n this.catalog,\n ));\n }\n\n get deposit(): DepositService {\n return (this.#deposit ??= new DepositService(this.transports.authApi, this.#getResolver()));\n }\n\n get addressBook(): AddressBookService {\n return (this.#addressBook ??= new AddressBookService(\n this.transports.authApi,\n this.realtime,\n this.#getResolver(),\n ));\n }\n\n get guardSigner(): GuardSignerService {\n return (this.#guardSigner ??= new GuardSignerService(\n this.transports.authApi,\n this.#getResolver(),\n ));\n }\n\n get socialVerification(): SocialVerificationService {\n return (this.#socialVerification ??= new SocialVerificationService(\n this.transports.authApi,\n ));\n }\n\n get whiteboard(): WhiteboardService {\n return (this.#whiteboard ??= new WhiteboardService(this.transports.authApi));\n }\n\n get zipper(): ZipperService {\n return (this.#zipper ??= new ZipperService(\n this.transports.publicApi,\n this.realtime,\n this.#getScales(),\n ));\n }\n\n get mfa(): MfaService {\n return (this.#mfa ??= new MfaService(this.transports.authApi));\n }\n\n get vip(): VipService {\n return (this.#vip ??= new VipService({\n publicApi: this.transports.publicApi,\n authApi: this.transports.authApi,\n }));\n }\n\n get fees(): FeesService {\n return (this.#fees ??= new FeesService(this.transports.authApi, this.#getResolver()));\n }\n\n get tradingRateLimits(): RateLimitService {\n return (this.#tradingRateLimits ??= new RateLimitService(\n {\n publicApi: this.transports.publicApi,\n authApi: this.transports.authApi,\n },\n this.#getResolver(),\n ));\n }\n\n /**\n * Override in subclasses to provide a subaccount resolver.\n * The resolver is called lazily when service methods are invoked.\n */\n protected createSubaccountResolver(): SubaccountResolver | undefined {\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDA,SAAS,yBACL,MACkD;CAClD,IAAI,CAAC,MAAM,OAAO,CAAC;CACnB,IAAI,KAAK,SAAS,OACd,OAAO;EACH,gBAAgB,YAAY;GACxB,MAAM,QAAQ,MAAM,KAAK,SAAS;GAClC,MAAM,UAAkC,CAAC;GACzC,IAAI,OAAO,QAAQ,gBAAgB,UAAU;GAC7C,OAAO;EACX;EACA,eAAe;GAGX,MAAM,QAAQ,KAAK,SAAS;GAC5B,IAAI,iBAAiB,SAAS,OAAO;GACrC,OAAO,OAAO,UAAU,YAAY,MAAM,SAAS;EACvD;CACJ;CAEJ,OAAO;EACH,iBAAiB,YACb,+BAA+B,MAAM;GACjC,KAAK,QAAQ;GACb,QAAQ,Q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EAClC,OAAQ,KAAKiB,iBAAiB,IAAI,mBAC9B,KAAK,WAAW,SAChB,KAAK,UACL,KAAKjB,aAAa,CACtB;CACJ;CAEA,IAAI,cAAkC;EAClC,OAAQ,KAAKkB,iBAAiB,IAAI,mBAC9B,KAAK,WAAW,SAChB,KAAKlB,aAAa,CACtB;CACJ;CAEA,IAAI,qBAAgD;EAChD,OAAQ,KAAKmB,wBAAwB,IAAI,0BACrC,KAAK,WAAW,OACpB;CACJ;CAEA,IAAI,aAAgC;EAChC,OAAQ,KAAKC,gBAAgB,IAAI,kBAAkB,KAAK,WAAW,OAAO;CAC9E;CAEA,IAAI,SAAwB;EACxB,OAAQ,KAAKC,YAAY,IAAI,cACzB,KAAK,WAAW,WAChB,KAAK,UACL,KAAK5B,WAAW,CACpB;CACJ;CAEA,IAAI,MAAkB;EAClB,OAAQ,KAAK6B,SAAS,IAAI,WAAW,KAAK,WAAW,OAAO;CAChE;CAEA,IAAI,MAAkB;EAClB,OAAQ,KAAKC,SAAS,IAAI,WAAW;GACjC,WAAW,KAAK,WAAW;GAC3B,SAAS,KAAK,WAAW;EAC7B,CAAC;CACL;CAEA,IAAI,OAAoB;EACpB,OAAQ,KAAKC,UAAU,IAAI,YAAY,KAAK,WAAW,SAAS,KAAKxB,aAAa,CAAC;CACvF;CAEA,IAAI,oBAAsC;EACtC,OAAQ,KAAKyB,uBAAuB,IAAI,iBACpC;GACI,WAAW,KAAK,WAAW;GAC3B,SAAS,KAAK,WAAW;EAC7B,GACA,KAAKzB,aAAa,CACtB;CACJ;;;;;CAMA,2BAAqE,CAErE;AACJ"}
|
package/dist/environment.js
CHANGED
|
@@ -157,6 +157,10 @@ const POLYESTER_TESTNET_ENVIRONMENT = createPolyesterEnvironment({
|
|
|
157
157
|
blockExplorers: { default: {
|
|
158
158
|
name: "Polyester Scan",
|
|
159
159
|
url: "https://polyesterscan.com"
|
|
160
|
+
} },
|
|
161
|
+
contracts: { multicall3: {
|
|
162
|
+
address: "0xF35A6AE5408fa1356064849D0BC3855f801aa6aC",
|
|
163
|
+
blockCreated: 563457
|
|
160
164
|
} }
|
|
161
165
|
},
|
|
162
166
|
accountAbstraction: {
|
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(value: string, label: string, allowedProtocols: readonly string[]): 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 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 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_TESTNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-testnet\",\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 Testnet\",\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://polyesterscan.com\",\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"],"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,aAAa,OAAe,OAAe,kBAA6C;CAC7F,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,OAAO;CACX,OAAO,IAAI,SAAS,CAAC,CAAC,QAAQ,SAAS,EAA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O,OAAO;EACrC;EACA;EACA,YAAY,oBAAoB,OAAO,mBAAmB,UAAU;EACpE,MAAM,oBAAoB,OAAO,mBAAmB,IAAI;CAC5D,CAAC;CACD,MAAM,YAAY,OAAO,OAAO,EAC5B,uBAAuB,iBACnB,OAAO,UAAU,uBACjB,iCACJ,EACJ,CAAC;CACD,MAAM,cAAc,uBAAuB;EACvC;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACJ,CAAC;CAED,OAAO,OAAO,OAAO;EACjB,MAAM,OAAO;EACb;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;AAKA,SAAgB,0BAA0B,aAAyD;CAC/F,cAAc,aAAa,aAAa;CACxC,MAAM,SAAS,2BAA2B,WAAW;CACrD,IAAI,YAAY,gBAAgB,OAAO,aACnC,MAAM,IAAI,mBACN,mEACJ;CAEJ,OAAO;AACX;AAEA,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;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(value: string, label: string, allowedProtocols: readonly string[]): 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 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 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_TESTNET_ENVIRONMENT = createPolyesterEnvironment({\n name: \"polyester-testnet\",\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 Testnet\",\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://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: \"0x375C86a08DA98d1944D7B3c736307A72186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AAuB;EACvC;EACA;EACA;EACA,SAAS,MAAM;EACf;EACA;CACJ,CAAC;CAED,OAAO,OAAO,OAAO;EACjB,MAAM,OAAO;EACb;EACA;EACA;EACA;EACA;EACA;EACA;CACJ,CAAC;AACL;;;;AAKA,SAAgB,0BAA0B,aAAyD;CAC/F,cAAc,aAAa,aAAa;CACxC,MAAM,SAAS,2BAA2B,WAAW;CACrD,IAAI,YAAY,gBAAgB,OAAO,aACnC,MAAM,IAAI,mBACN,mEACJ;CAEJ,OAAO;AACX;AAEA,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"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { Message } from "@bufbuild/protobuf";
|
|
2
|
+
import { GenFile, GenMessage, GenService } from "@bufbuild/protobuf/codegenv2";
|
|
3
|
+
declare namespace fees_pb_d_exports {
|
|
4
|
+
export { FeeService, GetSpotFeeRatesRequest, GetSpotFeeRatesRequestSchema, GetSpotFeeRatesResponse, GetSpotFeeRatesResponseSchema, SpotFeeRate, SpotFeeRateSchema, file_fees_v1_fees };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Describes the file fees/v1/fees.proto.
|
|
8
|
+
*/
|
|
9
|
+
declare const file_fees_v1_fees: GenFile;
|
|
10
|
+
/**
|
|
11
|
+
* SpotFeeRate describes the effective maker and taker rates for one spot
|
|
12
|
+
* market and account target.
|
|
13
|
+
*
|
|
14
|
+
* @generated from message fees.v1.SpotFeeRate
|
|
15
|
+
*/
|
|
16
|
+
type SpotFeeRate = Message<"fees.v1.SpotFeeRate"> & {
|
|
17
|
+
/**
|
|
18
|
+
* Stable numeric spot market identifier.
|
|
19
|
+
*
|
|
20
|
+
* @generated from field: uint32 symbol_id = 1;
|
|
21
|
+
*/
|
|
22
|
+
symbolId: number;
|
|
23
|
+
/**
|
|
24
|
+
* Canonical spot market symbol, for example "BTC-USDT".
|
|
25
|
+
*
|
|
26
|
+
* @generated from field: string symbol = 2;
|
|
27
|
+
*/
|
|
28
|
+
symbol: string;
|
|
29
|
+
/**
|
|
30
|
+
* Effective maker fee rate encoded as a base-10 percentage string without a
|
|
31
|
+
* percent sign. Values are between -100 and 100 inclusive.
|
|
32
|
+
*
|
|
33
|
+
* @generated from field: string maker_fee_rate_percent = 3;
|
|
34
|
+
*/
|
|
35
|
+
makerFeeRatePercent: string;
|
|
36
|
+
/**
|
|
37
|
+
* Effective taker fee rate encoded as a non-negative base-10 percentage
|
|
38
|
+
* string without a percent sign. Values are between 0 and 100 inclusive.
|
|
39
|
+
*
|
|
40
|
+
* @generated from field: string taker_fee_rate_percent = 4;
|
|
41
|
+
*/
|
|
42
|
+
takerFeeRatePercent: string;
|
|
43
|
+
/**
|
|
44
|
+
* VIP tier used to resolve these rates, in the inclusive range 0 through 10.
|
|
45
|
+
*
|
|
46
|
+
* @generated from field: uint32 vip_tier = 5;
|
|
47
|
+
*/
|
|
48
|
+
vipTier: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Describes the message fees.v1.SpotFeeRate.
|
|
52
|
+
* Use `create(SpotFeeRateSchema)` to create a new message.
|
|
53
|
+
*/
|
|
54
|
+
declare const SpotFeeRateSchema: GenMessage<SpotFeeRate>;
|
|
55
|
+
/**
|
|
56
|
+
* GetSpotFeeRatesRequest requests effective spot fee rates for one account
|
|
57
|
+
* target and an optional set of markets.
|
|
58
|
+
*
|
|
59
|
+
* @generated from message fees.v1.GetSpotFeeRatesRequest
|
|
60
|
+
*/
|
|
61
|
+
type GetSpotFeeRatesRequest = Message<"fees.v1.GetSpotFeeRatesRequest"> & {
|
|
62
|
+
/**
|
|
63
|
+
* Optional subaccount public identifier. When omitted, the authenticated
|
|
64
|
+
* caller's root account is used.
|
|
65
|
+
*
|
|
66
|
+
* @generated from field: optional fixed64 subaccount_id = 1;
|
|
67
|
+
*/
|
|
68
|
+
subaccountId?: bigint | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* Optional unique spot market identifier filter. When empty, all currently
|
|
71
|
+
* listed, non-disabled spot markets are returned. At most 100 identifiers
|
|
72
|
+
* may be requested.
|
|
73
|
+
*
|
|
74
|
+
* @generated from field: repeated uint32 symbol_id = 2;
|
|
75
|
+
*/
|
|
76
|
+
symbolId: number[];
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Describes the message fees.v1.GetSpotFeeRatesRequest.
|
|
80
|
+
* Use `create(GetSpotFeeRatesRequestSchema)` to create a new message.
|
|
81
|
+
*/
|
|
82
|
+
declare const GetSpotFeeRatesRequestSchema: GenMessage<GetSpotFeeRatesRequest>;
|
|
83
|
+
/**
|
|
84
|
+
* GetSpotFeeRatesResponse contains effective spot fee rates ordered by numeric
|
|
85
|
+
* market identifier ascending.
|
|
86
|
+
*
|
|
87
|
+
* @generated from message fees.v1.GetSpotFeeRatesResponse
|
|
88
|
+
*/
|
|
89
|
+
type GetSpotFeeRatesResponse = Message<"fees.v1.GetSpotFeeRatesResponse"> & {
|
|
90
|
+
/**
|
|
91
|
+
* Effective spot fee rows ordered by symbol_id ascending. The result is a
|
|
92
|
+
* finite snapshot of the requested or currently listed, non-disabled spot
|
|
93
|
+
* market catalog and is not paginated.
|
|
94
|
+
*
|
|
95
|
+
* @generated from field: repeated fees.v1.SpotFeeRate fee_rates = 1;
|
|
96
|
+
*/
|
|
97
|
+
feeRates: SpotFeeRate[];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Describes the message fees.v1.GetSpotFeeRatesResponse.
|
|
101
|
+
* Use `create(GetSpotFeeRatesResponseSchema)` to create a new message.
|
|
102
|
+
*/
|
|
103
|
+
declare const GetSpotFeeRatesResponseSchema: GenMessage<GetSpotFeeRatesResponse>;
|
|
104
|
+
/**
|
|
105
|
+
* FeeService serves authenticated effective spot trading fee rates.
|
|
106
|
+
*
|
|
107
|
+
* @generated from service fees.v1.FeeService
|
|
108
|
+
*/
|
|
109
|
+
declare const FeeService: GenService<{
|
|
110
|
+
/**
|
|
111
|
+
* Get effective maker and taker fee rates for the authenticated caller's
|
|
112
|
+
* root account or selected subaccount.
|
|
113
|
+
*
|
|
114
|
+
* @generated from rpc fees.v1.FeeService.GetSpotFeeRates
|
|
115
|
+
*/
|
|
116
|
+
getSpotFeeRates: {
|
|
117
|
+
methodKind: "unary";
|
|
118
|
+
input: typeof GetSpotFeeRatesRequestSchema;
|
|
119
|
+
output: typeof GetSpotFeeRatesResponseSchema;
|
|
120
|
+
};
|
|
121
|
+
}>;
|
|
122
|
+
//#endregion
|
|
123
|
+
export { FeeService, GetSpotFeeRatesRequest, GetSpotFeeRatesRequestSchema, GetSpotFeeRatesResponse, GetSpotFeeRatesResponseSchema, SpotFeeRate, SpotFeeRateSchema, fees_pb_d_exports, file_fees_v1_fees };
|
|
124
|
+
//# sourceMappingURL=fees_pb.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fees_pb.d.ts","names":[],"sources":["../../../../src/gen/fees/v1/fees_pb.ts"],"mappings":";;;;;;;;cAWa,mBAAmB;;;;;;;KASpB,cAAc;;;;;;EAMxB;;;;;;EAOA;;;;;;;EAQA;;;;;;;EAQA;;;;;;EAOA;;;;;;cAOW,mBAAmB,WAAW;;;;;;;KAS/B,yBAAyB;;;;;;;EAOnC;;;;;;;;EASA;;;;;;cAOW,8BAA8B,WAAW;;;;;;;KAS1C,0BAA0B;;;;;;;;EAQpC,UAAU;;;;;;cAOC,+BAA+B,WAAW;;;;;;cAQ1C,YAAY;;;;;;;EAOvB;IACE;IACA,cAAc;IACd,eAAe"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { __exportAll } from "../../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { fileDesc, messageDesc, serviceDesc } from "@bufbuild/protobuf/codegenv2";
|
|
3
|
+
//#region src/gen/fees/v1/fees_pb.ts
|
|
4
|
+
var fees_pb_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
FeeService: () => FeeService,
|
|
6
|
+
GetSpotFeeRatesRequestSchema: () => GetSpotFeeRatesRequestSchema,
|
|
7
|
+
GetSpotFeeRatesResponseSchema: () => GetSpotFeeRatesResponseSchema,
|
|
8
|
+
SpotFeeRateSchema: () => SpotFeeRateSchema,
|
|
9
|
+
file_fees_v1_fees: () => file_fees_v1_fees
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Describes the file fees/v1/fees.proto.
|
|
13
|
+
*/
|
|
14
|
+
const file_fees_v1_fees = /*@__PURE__*/ fileDesc("ChJmZWVzL3YxL2ZlZXMucHJvdG8SB2ZlZXMudjEijAEKC1Nwb3RGZWVSYXRlEhMKCXN5bWJvbF9pZBgBIAEoDUIAEhAKBnN5bWJvbBgCIAEoCUIAEiAKFm1ha2VyX2ZlZV9yYXRlX3BlcmNlbnQYAyABKAlCABIgChZ0YWtlcl9mZWVfcmF0ZV9wZXJjZW50GAQgASgJQgASEgoIdmlwX3RpZXIYBSABKA1CACJdChZHZXRTcG90RmVlUmF0ZXNSZXF1ZXN0EhwKDXN1YmFjY291bnRfaWQYASABKAZCAEgAiAEBEhMKCXN5bWJvbF9pZBgCIAMoDUIAQhAKDl9zdWJhY2NvdW50X2lkIkIKF0dldFNwb3RGZWVSYXRlc1Jlc3BvbnNlEicKCWZlZV9yYXRlcxgBIAMoCzIULmZlZXMudjEuU3BvdEZlZVJhdGUyZAoKRmVlU2VydmljZRJWCg9HZXRTcG90RmVlUmF0ZXMSHy5mZWVzLnYxLkdldFNwb3RGZWVSYXRlc1JlcXVlc3QaIC5mZWVzLnYxLkdldFNwb3RGZWVSYXRlc1Jlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9mZWVzL3YxO2ZlZXN2MWIGcHJvdG8z");
|
|
15
|
+
/**
|
|
16
|
+
* Describes the message fees.v1.SpotFeeRate.
|
|
17
|
+
* Use `create(SpotFeeRateSchema)` to create a new message.
|
|
18
|
+
*/
|
|
19
|
+
const SpotFeeRateSchema = /*@__PURE__*/ messageDesc(file_fees_v1_fees, 0);
|
|
20
|
+
/**
|
|
21
|
+
* Describes the message fees.v1.GetSpotFeeRatesRequest.
|
|
22
|
+
* Use `create(GetSpotFeeRatesRequestSchema)` to create a new message.
|
|
23
|
+
*/
|
|
24
|
+
const GetSpotFeeRatesRequestSchema = /*@__PURE__*/ messageDesc(file_fees_v1_fees, 1);
|
|
25
|
+
/**
|
|
26
|
+
* Describes the message fees.v1.GetSpotFeeRatesResponse.
|
|
27
|
+
* Use `create(GetSpotFeeRatesResponseSchema)` to create a new message.
|
|
28
|
+
*/
|
|
29
|
+
const GetSpotFeeRatesResponseSchema = /*@__PURE__*/ messageDesc(file_fees_v1_fees, 2);
|
|
30
|
+
/**
|
|
31
|
+
* FeeService serves authenticated effective spot trading fee rates.
|
|
32
|
+
*
|
|
33
|
+
* @generated from service fees.v1.FeeService
|
|
34
|
+
*/
|
|
35
|
+
const FeeService = /*@__PURE__*/ serviceDesc(file_fees_v1_fees, 0);
|
|
36
|
+
//#endregion
|
|
37
|
+
export { FeeService, GetSpotFeeRatesRequestSchema, GetSpotFeeRatesResponseSchema, SpotFeeRateSchema, fees_pb_exports, file_fees_v1_fees };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=fees_pb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fees_pb.js","names":[],"sources":["../../../../src/gen/fees/v1/fees_pb.ts"],"sourcesContent":["// @generated by protoc-gen-es v2.13.0 with parameter \"target=ts,import_extension=js\"\n// @generated from file fees/v1/fees.proto (package fees.v1, syntax proto3)\n/* eslint-disable */\n\nimport type { GenFile, GenMessage, GenService } from \"@bufbuild/protobuf/codegenv2\";\nimport { fileDesc, messageDesc, serviceDesc } from \"@bufbuild/protobuf/codegenv2\";\nimport type { Message } from \"@bufbuild/protobuf\";\n\n/**\n * Describes the file fees/v1/fees.proto.\n */\nexport const file_fees_v1_fees: GenFile = /*@__PURE__*/\n fileDesc(\"ChJmZWVzL3YxL2ZlZXMucHJvdG8SB2ZlZXMudjEijAEKC1Nwb3RGZWVSYXRlEhMKCXN5bWJvbF9pZBgBIAEoDUIAEhAKBnN5bWJvbBgCIAEoCUIAEiAKFm1ha2VyX2ZlZV9yYXRlX3BlcmNlbnQYAyABKAlCABIgChZ0YWtlcl9mZWVfcmF0ZV9wZXJjZW50GAQgASgJQgASEgoIdmlwX3RpZXIYBSABKA1CACJdChZHZXRTcG90RmVlUmF0ZXNSZXF1ZXN0EhwKDXN1YmFjY291bnRfaWQYASABKAZCAEgAiAEBEhMKCXN5bWJvbF9pZBgCIAMoDUIAQhAKDl9zdWJhY2NvdW50X2lkIkIKF0dldFNwb3RGZWVSYXRlc1Jlc3BvbnNlEicKCWZlZV9yYXRlcxgBIAMoCzIULmZlZXMudjEuU3BvdEZlZVJhdGUyZAoKRmVlU2VydmljZRJWCg9HZXRTcG90RmVlUmF0ZXMSHy5mZWVzLnYxLkdldFNwb3RGZWVSYXRlc1JlcXVlc3QaIC5mZWVzLnYxLkdldFNwb3RGZWVSYXRlc1Jlc3BvbnNlIgBCPFo6Z2l0aHViLmNvbS9GYWJyaWMtTGFicy9wb2x5ZXN0ZXItc2RrLWdvL2dlbi9mZWVzL3YxO2ZlZXN2MWIGcHJvdG8z\");\n\n/**\n * SpotFeeRate describes the effective maker and taker rates for one spot\n * market and account target.\n *\n * @generated from message fees.v1.SpotFeeRate\n */\nexport type SpotFeeRate = Message<\"fees.v1.SpotFeeRate\"> & {\n /**\n * Stable numeric spot market identifier.\n *\n * @generated from field: uint32 symbol_id = 1;\n */\n symbolId: number;\n\n /**\n * Canonical spot market symbol, for example \"BTC-USDT\".\n *\n * @generated from field: string symbol = 2;\n */\n symbol: string;\n\n /**\n * Effective maker fee rate encoded as a base-10 percentage string without a\n * percent sign. Values are between -100 and 100 inclusive.\n *\n * @generated from field: string maker_fee_rate_percent = 3;\n */\n makerFeeRatePercent: string;\n\n /**\n * Effective taker fee rate encoded as a non-negative base-10 percentage\n * string without a percent sign. Values are between 0 and 100 inclusive.\n *\n * @generated from field: string taker_fee_rate_percent = 4;\n */\n takerFeeRatePercent: string;\n\n /**\n * VIP tier used to resolve these rates, in the inclusive range 0 through 10.\n *\n * @generated from field: uint32 vip_tier = 5;\n */\n vipTier: number;\n};\n\n/**\n * Describes the message fees.v1.SpotFeeRate.\n * Use `create(SpotFeeRateSchema)` to create a new message.\n */\nexport const SpotFeeRateSchema: GenMessage<SpotFeeRate> = /*@__PURE__*/\n messageDesc(file_fees_v1_fees, 0);\n\n/**\n * GetSpotFeeRatesRequest requests effective spot fee rates for one account\n * target and an optional set of markets.\n *\n * @generated from message fees.v1.GetSpotFeeRatesRequest\n */\nexport type GetSpotFeeRatesRequest = Message<\"fees.v1.GetSpotFeeRatesRequest\"> & {\n /**\n * Optional subaccount public identifier. When omitted, the authenticated\n * caller's root account is used.\n *\n * @generated from field: optional fixed64 subaccount_id = 1;\n */\n subaccountId?: bigint | undefined;\n\n /**\n * Optional unique spot market identifier filter. When empty, all currently\n * listed, non-disabled spot markets are returned. At most 100 identifiers\n * may be requested.\n *\n * @generated from field: repeated uint32 symbol_id = 2;\n */\n symbolId: number[];\n};\n\n/**\n * Describes the message fees.v1.GetSpotFeeRatesRequest.\n * Use `create(GetSpotFeeRatesRequestSchema)` to create a new message.\n */\nexport const GetSpotFeeRatesRequestSchema: GenMessage<GetSpotFeeRatesRequest> = /*@__PURE__*/\n messageDesc(file_fees_v1_fees, 1);\n\n/**\n * GetSpotFeeRatesResponse contains effective spot fee rates ordered by numeric\n * market identifier ascending.\n *\n * @generated from message fees.v1.GetSpotFeeRatesResponse\n */\nexport type GetSpotFeeRatesResponse = Message<\"fees.v1.GetSpotFeeRatesResponse\"> & {\n /**\n * Effective spot fee rows ordered by symbol_id ascending. The result is a\n * finite snapshot of the requested or currently listed, non-disabled spot\n * market catalog and is not paginated.\n *\n * @generated from field: repeated fees.v1.SpotFeeRate fee_rates = 1;\n */\n feeRates: SpotFeeRate[];\n};\n\n/**\n * Describes the message fees.v1.GetSpotFeeRatesResponse.\n * Use `create(GetSpotFeeRatesResponseSchema)` to create a new message.\n */\nexport const GetSpotFeeRatesResponseSchema: GenMessage<GetSpotFeeRatesResponse> = /*@__PURE__*/\n messageDesc(file_fees_v1_fees, 2);\n\n/**\n * FeeService serves authenticated effective spot trading fee rates.\n *\n * @generated from service fees.v1.FeeService\n */\nexport const FeeService: GenService<{\n /**\n * Get effective maker and taker fee rates for the authenticated caller's\n * root account or selected subaccount.\n *\n * @generated from rpc fees.v1.FeeService.GetSpotFeeRates\n */\n getSpotFeeRates: {\n methodKind: \"unary\";\n input: typeof GetSpotFeeRatesRequestSchema;\n output: typeof GetSpotFeeRatesResponseSchema;\n },\n}> = /*@__PURE__*/\n serviceDesc(file_fees_v1_fees, 0);\n\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,oBACX,uBAAS,sqBAAsqB;;;;;AAmDjrB,MAAa,oBACX,0BAAY,mBAAmB,CAAC;;;;;AA+BlC,MAAa,+BACX,0BAAY,mBAAmB,CAAC;;;;;AAuBlC,MAAa,gCACX,0BAAY,mBAAmB,CAAC;;;;;;AAOlC,MAAa,aAaX,0BAAY,mBAAmB,CAAC"}
|
package/dist/gen/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { lifecycle_read_pb_d_exports } from "./chain/lifecycle/v1/lifecycle_read
|
|
|
20
20
|
import { withdraw_pb_d_exports } from "./chain/withdraw/v1/withdraw_pb.js";
|
|
21
21
|
import { zipper_pb_d_exports } from "./chain/zipper/v1/zipper_pb.js";
|
|
22
22
|
import { whiteboard_pb_d_exports } from "./collab/v1/whiteboard_pb.js";
|
|
23
|
+
import { fees_pb_d_exports } from "./fees/v1/fees_pb.js";
|
|
23
24
|
import { polychart_pb_d_exports } from "./polychart/v1/polychart_pb.js";
|
|
24
25
|
import { layout_pb_d_exports } from "./layout/v1/layout_pb.js";
|
|
25
26
|
import { heatmap_pb_d_exports } from "./marketdata/v1/heatmap_pb.js";
|
|
@@ -30,7 +31,9 @@ import { orders_pb_d_exports } from "./orders/v1/orders_pb.js";
|
|
|
30
31
|
import { orders_read_pb_d_exports } from "./orders/v1/orders_read_pb.js";
|
|
31
32
|
import { polychart_events_pb_d_exports } from "./polychart/events/v1/polychart_events_pb.js";
|
|
32
33
|
import { options_pb_d_exports } from "./polyester/api/options_pb.js";
|
|
34
|
+
import { ratelimit_pb_d_exports } from "./ratelimit/v1/ratelimit_pb.js";
|
|
33
35
|
import { trade_ws_pb_d_exports } from "./tradews/v1/trade_ws_pb.js";
|
|
34
36
|
import { internal_transfer_pb_d_exports } from "./transfer/v1/internal_transfer_pb.js";
|
|
35
37
|
import { triggers_pb_d_exports } from "./triggers/v1/triggers_pb.js";
|
|
36
|
-
|
|
38
|
+
import { vip_pb_d_exports } from "./vip/v1/vip_pb.js";
|
|
39
|
+
export { address_book_pb_d_exports as addressBookPb, analytics_read_pb_d_exports as analyticsReadPb, api_keys_pb_d_exports as apiKeysPb, auth_pb_d_exports as authPb, deposit_pb_d_exports as depositPb, fees_pb_d_exports as feesPb, guard_signer_pb_d_exports as guardSignerPb, heatmap_pb_d_exports as heatmapPb, internal_transfer_pb_d_exports as internalTransferPb, layout_pb_d_exports as layoutPb, catalog_pb_d_exports as ledgerCatalogPb, ledger_read_pb_d_exports as ledgerReadPb, lifecycle_read_pb_d_exports as lifecycleReadPb, types_pb_d_exports as lifecycleTypesPb, marketdata_pb_d_exports as marketdataPb, marketoverview_pb_d_exports as marketoverviewPb, mfa_pb_d_exports as mfaPb, orderbook_pb_d_exports as orderbookPb, orders_pb_d_exports as ordersPb, orders_read_pb_d_exports as ordersReadPb, policies_pb_d_exports as policiesPb, polychart_events_pb_d_exports as polychartEventsPb, polychart_pb_d_exports as polychartPb, options_pb_d_exports as polyesterOptionsPb, profile_pb_d_exports as profilePb, types_pb_d_exports$1 as rateLimitPb, resolve_pb_d_exports as resolvePb, social_verification_pb_d_exports as socialVerificationPb, subaccounts_pb_d_exports as subaccountsPb, trade_ws_pb_d_exports as tradeWsPb, ratelimit_pb_d_exports as tradingRateLimitPb, triggers_pb_d_exports as triggersPb, u128_pb_d_exports as u128Pb, vip_pb_d_exports as vipPb, whiteboard_pb_d_exports as whiteboardPb, withdraw_pb_d_exports as withdrawPb, zipper_pb_d_exports as zipperPb, reason_pb_d_exports as zipperReasonPb };
|
package/dist/gen/index.js
CHANGED
|
@@ -29,8 +29,11 @@ import { guard_signer_pb_exports } from "./chain/guard/v1/guard_signer_pb.js";
|
|
|
29
29
|
import { social_verification_pb_exports } from "./auth/v1/social_verification_pb.js";
|
|
30
30
|
import { whiteboard_pb_exports } from "./collab/v1/whiteboard_pb.js";
|
|
31
31
|
import { zipper_pb_exports } from "./chain/zipper/v1/zipper_pb.js";
|
|
32
|
+
import { vip_pb_exports } from "./vip/v1/vip_pb.js";
|
|
33
|
+
import { fees_pb_exports } from "./fees/v1/fees_pb.js";
|
|
34
|
+
import { ratelimit_pb_exports } from "./ratelimit/v1/ratelimit_pb.js";
|
|
32
35
|
import { polychart_pb_exports } from "./polychart/v1/polychart_pb.js";
|
|
33
36
|
import { layout_pb_exports } from "./layout/v1/layout_pb.js";
|
|
34
37
|
import { polychart_events_pb_exports } from "./polychart/events/v1/polychart_events_pb.js";
|
|
35
38
|
import { trade_ws_pb_exports } from "./tradews/v1/trade_ws_pb.js";
|
|
36
|
-
export { address_book_pb_exports as addressBookPb, analytics_read_pb_exports as analyticsReadPb, api_keys_pb_exports as apiKeysPb, auth_pb_exports as authPb, deposit_pb_exports as depositPb, guard_signer_pb_exports as guardSignerPb, heatmap_pb_exports as heatmapPb, internal_transfer_pb_exports as internalTransferPb, layout_pb_exports as layoutPb, catalog_pb_exports as ledgerCatalogPb, ledger_read_pb_exports as ledgerReadPb, lifecycle_read_pb_exports as lifecycleReadPb, types_pb_exports as lifecycleTypesPb, marketdata_pb_exports as marketdataPb, marketoverview_pb_exports as marketoverviewPb, mfa_pb_exports as mfaPb, orderbook_pb_exports as orderbookPb, orders_pb_exports as ordersPb, orders_read_pb_exports as ordersReadPb, policies_pb_exports as policiesPb, polychart_events_pb_exports as polychartEventsPb, polychart_pb_exports as polychartPb, options_pb_exports as polyesterOptionsPb, profile_pb_exports as profilePb, types_pb_exports$1 as rateLimitPb, resolve_pb_exports as resolvePb, social_verification_pb_exports as socialVerificationPb, subaccounts_pb_exports as subaccountsPb, trade_ws_pb_exports as tradeWsPb, triggers_pb_exports as triggersPb, u128_pb_exports as u128Pb, whiteboard_pb_exports as whiteboardPb, withdraw_pb_exports as withdrawPb, zipper_pb_exports as zipperPb, reason_pb_exports as zipperReasonPb };
|
|
39
|
+
export { address_book_pb_exports as addressBookPb, analytics_read_pb_exports as analyticsReadPb, api_keys_pb_exports as apiKeysPb, auth_pb_exports as authPb, deposit_pb_exports as depositPb, fees_pb_exports as feesPb, guard_signer_pb_exports as guardSignerPb, heatmap_pb_exports as heatmapPb, internal_transfer_pb_exports as internalTransferPb, layout_pb_exports as layoutPb, catalog_pb_exports as ledgerCatalogPb, ledger_read_pb_exports as ledgerReadPb, lifecycle_read_pb_exports as lifecycleReadPb, types_pb_exports as lifecycleTypesPb, marketdata_pb_exports as marketdataPb, marketoverview_pb_exports as marketoverviewPb, mfa_pb_exports as mfaPb, orderbook_pb_exports as orderbookPb, orders_pb_exports as ordersPb, orders_read_pb_exports as ordersReadPb, policies_pb_exports as policiesPb, polychart_events_pb_exports as polychartEventsPb, polychart_pb_exports as polychartPb, options_pb_exports as polyesterOptionsPb, profile_pb_exports as profilePb, types_pb_exports$1 as rateLimitPb, resolve_pb_exports as resolvePb, social_verification_pb_exports as socialVerificationPb, subaccounts_pb_exports as subaccountsPb, trade_ws_pb_exports as tradeWsPb, ratelimit_pb_exports as tradingRateLimitPb, triggers_pb_exports as triggersPb, u128_pb_exports as u128Pb, vip_pb_exports as vipPb, whiteboard_pb_exports as whiteboardPb, withdraw_pb_exports as withdrawPb, zipper_pb_exports as zipperPb, reason_pb_exports as zipperReasonPb };
|