cantonjs-splice-validator 0.3.0 → 0.4.0

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/README.md CHANGED
@@ -2,19 +2,16 @@
2
2
 
3
3
  Validator-facing Splice clients layered on top of `cantonjs`.
4
4
 
5
- This package ships three surfaces:
5
+ This package now ships only the GA external-validator surface that fits the repo's app-side story:
6
6
 
7
- - `createAnsClient()` for the GA `ans-external` API.
8
- - `createScanProxyClient()` for a carefully filtered GA subset of `scan-proxy` whose underlying Scan semantics are tagged `external` in the vendored Scan spec.
9
- - `createLegacyWalletClient()` for `wallet-external` compatibility flows that remain useful for existing transfer-offer and buy-traffic integrations.
10
-
11
- `validator-internal` is intentionally excluded from this package.
7
+ - `createAnsClient()` for the published `ans-external` API
8
+ - `createScanProxyClient()` for the filtered public subset of `scan-proxy` whose backing Scan semantics are tagged `external` in the vendored Scan spec
12
9
 
13
10
  ## Status
14
11
 
15
12
  - **GA:** `createAnsClient()` and the filtered `createScanProxyClient()` surface on the Splice `0.5.x` line
16
- - **Legacy compatibility:** `createLegacyWalletClient()` for existing `wallet-external` integrations only
17
- - **Experimental:** `cantonjs-splice-validator/experimental`, pinned to `vendor/splice/0.5.17` and outside the GA promise
13
+ - **Vendored upstream inputs:** pinned to `0.5.17`
14
+ - **Boundary:** selected stable external Validator support only
18
15
 
19
16
  ## Install
20
17
 
@@ -25,46 +22,11 @@ npm install cantonjs cantonjs-splice-validator
25
22
  ## Package Policy
26
23
 
27
24
  - Generated low-level types are committed in `src/generated/*.types.ts`.
28
- - The GA validator surface is limited to ANS external plus the filtered Scan Proxy wrapper.
29
- - Proxy operations backed by internal, deprecated, or pre-alpha Scan semantics are intentionally excluded from the main client.
30
- - `legacyWallet` is a legacy compatibility surface. For new transfer flows, prefer Token Standard integrations instead of `wallet-external`.
25
+ - The public validator surface is limited to `ans-external` plus the filtered Scan Proxy wrapper.
26
+ - Proxy operations backed by internal, deprecated, or pre-alpha Scan semantics are intentionally excluded.
27
+ - Older wallet-oriented or private validator flows are no longer part of this package.
31
28
  - The package is documented against the Splice `0.5.x` line, with vendored inputs currently pinned to `0.5.17`.
32
29
 
33
- ## Experimental APIs
34
-
35
- > [!WARNING]
36
- > Experimental Validator imports are pinned to `vendor/splice/0.5.17`.
37
- > They may break on any upstream release. Import them only from `cantonjs-splice-validator/experimental`.
38
-
39
- The experimental subpath isolates two unstable upstream surfaces:
40
-
41
- - `createExperimentalValidatorInternalClient()` for the vendored `validator-internal.yaml` surface.
42
- - `createExperimentalScanProxyClient()` for `scan-proxy` routes whose backing Scan semantics are tagged `internal` in the vendored `scan.yaml`.
43
-
44
- ```ts
45
- import {
46
- createExperimentalScanProxyClient,
47
- createExperimentalValidatorInternalClient,
48
- } from 'cantonjs-splice-validator/experimental'
49
-
50
- const validatorInternal = createExperimentalValidatorInternalClient({
51
- url: 'https://example.com/api/validator',
52
- token: process.env.SPLICE_VALIDATOR_JWT,
53
- })
54
-
55
- const experimentalScanProxy = createExperimentalScanProxyClient({
56
- url: 'https://example.com/api/validator',
57
- token: process.env.SPLICE_VALIDATOR_JWT,
58
- })
59
-
60
- const operator = await validatorInternal.getValidatorUserInfo()
61
- const featured = await experimentalScanProxy.lookupFeaturedAppRight({
62
- provider_party_id: 'Alice::validator',
63
- })
64
- ```
65
-
66
- The stable `cantonjs-splice-validator` entrypoint intentionally continues to omit these APIs.
67
-
68
30
  ## Quick Start
69
31
 
70
32
  ```ts
@@ -109,34 +71,9 @@ const namedEntry = await scanProxy.lookupAnsEntryByName({ name: 'app.ans' })
109
71
 
110
72
  Validator-local proxy methods backed by internal Scan semantics, such as featured-app lookups, amulet rules, ANS rules, and transfer-command proxying, are intentionally left out.
111
73
 
112
- ## Legacy Wallet Compatibility
113
-
114
- `createLegacyWalletClient()` is a legacy/deprecated-oriented compatibility wrapper for `wallet-external`, especially the transfer-offer flow that predates Token Standard-first integration.
115
-
116
- Use a clearly named `legacyWallet` client so the callsites stay obviously separate from the GA validator surface:
117
-
118
- ```ts
119
- import { createLegacyWalletClient } from 'cantonjs-splice-validator'
120
-
121
- const legacyWallet = createLegacyWalletClient({
122
- url: 'https://example.com/api/validator',
123
- token: process.env.SPLICE_VALIDATOR_JWT,
124
- })
125
-
126
- const offer = await legacyWallet.createTransferOffer({
127
- receiver_party_id: 'Receiver::validator',
128
- amount: '10.0',
129
- description: 'Legacy transfer offer',
130
- expires_at: 1_780_000_000_000_000,
131
- tracking_id: 'offer-123',
132
- })
133
-
134
- const status = await legacyWallet.lookupTransferOfferStatus({
135
- tracking_id: 'offer-123',
136
- })
137
- ```
74
+ ## Migration Note
138
75
 
139
- For new transfer flows, prefer Token Standard surfaces. Reach for `legacyWallet` only when you need compatibility with existing `wallet-external` workflows.
76
+ If you still depend on older wallet-oriented Validator routes, stay on the last pre-prune release while you migrate. For new transfer and allocation flows, use Token Standard surfaces instead of older wallet-style APIs.
140
77
 
141
78
  ## License
142
79
 
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export { createAnsClient, type AnsClient, type AnsClientConfig, type AnsRequestOptions, type AnsEntry, type AnsCreateEntryRequest, type AnsCreateEntryResponse, type AnsListEntriesResponse, } from './createAnsClient.js';
2
2
  export { createScanProxyClient, type ScanProxyClient, type ScanProxyClientConfig, type ScanProxyRequestOptions, type ScanProxyAnsEntry, type ScanProxyDsoPartyIdResponse, type ScanProxyDsoInfoResponse, type ScanProxyOpenAndIssuingMiningRoundsResponse, type ScanProxyListAnsEntriesRequest, type ScanProxyListAnsEntriesResponse, type ScanProxyLookupAnsEntryByPartyRequest, type ScanProxyLookupAnsEntryByPartyResponse, type ScanProxyLookupAnsEntryByNameRequest, type ScanProxyLookupAnsEntryByNameResponse, type ScanProxyHoldingsSummaryRequest, type ScanProxyHoldingsSummaryResponse, type ScanProxyUnclaimedDevelopmentFundCouponsResponse, } from './createScanProxyClient.js';
3
- export { createLegacyWalletClient, type LegacyWalletClient, type LegacyWalletClientConfig, type LegacyWalletRequestOptions, type LegacyWalletTransferOffer, type LegacyWalletCreateTransferOfferRequest, type LegacyWalletCreateTransferOfferResponse, type LegacyWalletListTransferOffersResponse, type LegacyWalletGetTransferOfferStatusRequest, type LegacyWalletTransferOfferStatusResponse, type LegacyWalletTransferOfferStatus, type LegacyWalletCreateBuyTrafficRequest, type LegacyWalletCreateBuyTrafficRequestResponse, type LegacyWalletGetBuyTrafficRequestStatusRequest, type LegacyWalletBuyTrafficRequestStatusResponse, type LegacyWalletBuyTrafficRequestStatus, } from './createLegacyWalletClient.js';
4
3
  export { CantonjsError, AuthProviderError, ConnectionError, HttpError, TimeoutError, } from 'cantonjs';
5
4
  export type { ErrorCode, CantonjsErrorOptions } from 'cantonjs';
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export { createAnsClient, } from './createAnsClient.js';
2
2
  export { createScanProxyClient, } from './createScanProxyClient.js';
3
- export { createLegacyWalletClient, } from './createLegacyWalletClient.js';
4
3
  export { CantonjsError, AuthProviderError, ConnectionError, HttpError, TimeoutError, } from 'cantonjs';
5
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAQhB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,qBAAqB,GAiBtB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,wBAAwB,GAgBzB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,YAAY,GACb,MAAM,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,GAQhB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACL,qBAAqB,GAiBtB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,YAAY,GACb,MAAM,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cantonjs-splice-validator",
3
- "version": "0.3.0",
4
- "description": "Validator-facing Splice clients for ANS, filtered Scan Proxy, and legacy wallet compatibility",
3
+ "version": "0.4.0",
4
+ "description": "Selected stable external validator clients for ANS and filtered Scan Proxy reads",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
@@ -10,11 +10,6 @@
10
10
  "types": "./dist/index.d.ts",
11
11
  "import": "./dist/index.js",
12
12
  "default": "./dist/index.js"
13
- },
14
- "./experimental": {
15
- "types": "./dist/experimental/index.d.ts",
16
- "import": "./dist/experimental/index.js",
17
- "default": "./dist/experimental/index.js"
18
13
  }
19
14
  },
20
15
  "sideEffects": false,
@@ -25,10 +20,9 @@
25
20
  "test:watch": "vitest",
26
21
  "test:coverage": "node ../../scripts/verify-coverage-exclusions.mjs && vitest run --coverage",
27
22
  "clean": "rm -rf dist",
28
- "generate:types": "npm run generate:types:ans && npm run generate:types:scan-proxy && npm run generate:types:wallet",
23
+ "generate:types": "npm run generate:types:ans && npm run generate:types:scan-proxy",
29
24
  "generate:types:ans": "SPLICE_TAG=\"$(find ../../vendor/splice -mindepth 1 -maxdepth 1 -type d -exec basename {} \\; | sort -V | tail -n1)\" && mkdir -p ./src/generated && npx openapi-typescript \"../../vendor/splice/${SPLICE_TAG}/openapi/ans-external.yaml\" -o \"./src/generated/ans.types.ts\"",
30
25
  "generate:types:scan-proxy": "SPLICE_TAG=\"$(find ../../vendor/splice -mindepth 1 -maxdepth 1 -type d -exec basename {} \\; | sort -V | tail -n1)\" && mkdir -p ./src/generated ../../scan/src/main/openapi && ln -sf \"$PWD/../../vendor/splice/${SPLICE_TAG}/openapi/scan.yaml\" ../../scan/src/main/openapi/scan.yaml && npx openapi-typescript \"../../vendor/splice/${SPLICE_TAG}/openapi/scan-proxy.yaml\" -o \"./src/generated/scanProxy.types.ts\" && rm -f ../../scan/src/main/openapi/scan.yaml && rmdir ../../scan/src/main/openapi ../../scan/src/main ../../scan/src 2>/dev/null || true",
31
- "generate:types:wallet": "SPLICE_TAG=\"$(find ../../vendor/splice -mindepth 1 -maxdepth 1 -type d -exec basename {} \\; | sort -V | tail -n1)\" && mkdir -p ./src/generated && npx openapi-typescript \"../../vendor/splice/${SPLICE_TAG}/openapi/wallet-external.yaml\" -o \"./src/generated/walletExternal.types.ts\"",
32
26
  "prepublishOnly": "npm run clean && npm run build"
33
27
  },
34
28
  "files": [
@@ -50,7 +44,7 @@
50
44
  "directory": "packages/cantonjs-splice-validator"
51
45
  },
52
46
  "peerDependencies": {
53
- "cantonjs": "^0.3.0"
47
+ "cantonjs": "^0.4.0"
54
48
  },
55
49
  "devDependencies": {
56
50
  "@types/node": "^24.5.2",
@@ -1,51 +0,0 @@
1
- import { type TransportConfig } from 'cantonjs';
2
- import type { components, operations } from './generated/walletExternal.types.js';
3
- type OperationName = keyof operations;
4
- type JsonResponse<TName extends OperationName> = operations[TName] extends {
5
- responses: {
6
- 200: {
7
- content: {
8
- 'application/json': infer T;
9
- };
10
- };
11
- };
12
- } ? T : never;
13
- type JsonRequestBody<TName extends OperationName> = operations[TName] extends {
14
- requestBody: {
15
- content: {
16
- 'application/json': infer T;
17
- };
18
- };
19
- } ? T : never;
20
- type PathParameters<TName extends OperationName> = operations[TName] extends {
21
- parameters: {
22
- path?: infer T;
23
- };
24
- } ? T : never;
25
- export type LegacyWalletClientConfig = TransportConfig;
26
- export type LegacyWalletRequestOptions = {
27
- readonly signal?: AbortSignal;
28
- };
29
- export type LegacyWalletTransferOffer = components['schemas']['Contract'];
30
- export type LegacyWalletCreateTransferOfferRequest = JsonRequestBody<'createTransferOffer'>;
31
- export type LegacyWalletCreateTransferOfferResponse = JsonResponse<'createTransferOffer'>;
32
- export type LegacyWalletListTransferOffersResponse = JsonResponse<'listTransferOffers'>;
33
- export type LegacyWalletGetTransferOfferStatusRequest = PathParameters<'getTransferOfferStatus'>;
34
- export type LegacyWalletTransferOfferStatusResponse = JsonResponse<'getTransferOfferStatus'>;
35
- export type LegacyWalletTransferOfferStatus = LegacyWalletTransferOfferStatusResponse['status'];
36
- export type LegacyWalletCreateBuyTrafficRequest = JsonRequestBody<'createBuyTrafficRequest'>;
37
- export type LegacyWalletCreateBuyTrafficRequestResponse = JsonResponse<'createBuyTrafficRequest'>;
38
- export type LegacyWalletGetBuyTrafficRequestStatusRequest = PathParameters<'getBuyTrafficRequestStatus'>;
39
- export type LegacyWalletBuyTrafficRequestStatusResponse = JsonResponse<'getBuyTrafficRequestStatus'>;
40
- export type LegacyWalletBuyTrafficRequestStatus = LegacyWalletBuyTrafficRequestStatusResponse['status'];
41
- export type LegacyWalletClient = {
42
- createTransferOffer: (request: LegacyWalletCreateTransferOfferRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletCreateTransferOfferResponse>;
43
- listTransferOffers: (options?: LegacyWalletRequestOptions) => Promise<LegacyWalletListTransferOffersResponse>;
44
- getTransferOfferStatus: (request: LegacyWalletGetTransferOfferStatusRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletTransferOfferStatusResponse>;
45
- lookupTransferOfferStatus: (request: LegacyWalletGetTransferOfferStatusRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletTransferOfferStatusResponse | undefined>;
46
- createBuyTrafficRequest: (request: LegacyWalletCreateBuyTrafficRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletCreateBuyTrafficRequestResponse>;
47
- getBuyTrafficRequestStatus: (request: LegacyWalletGetBuyTrafficRequestStatusRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletBuyTrafficRequestStatusResponse>;
48
- lookupBuyTrafficRequestStatus: (request: LegacyWalletGetBuyTrafficRequestStatusRequest, options?: LegacyWalletRequestOptions) => Promise<LegacyWalletBuyTrafficRequestStatusResponse | undefined>;
49
- };
50
- export declare function createLegacyWalletClient(config: LegacyWalletClientConfig): LegacyWalletClient;
51
- export {};
@@ -1,81 +0,0 @@
1
- import { jsonApi } from 'cantonjs';
2
- export function createLegacyWalletClient(config) {
3
- const transport = jsonApi(config);
4
- return {
5
- async createTransferOffer(request, options) {
6
- return await transport.request({
7
- method: 'POST',
8
- path: '/v0/wallet/transfer-offers',
9
- body: request,
10
- signal: options?.signal,
11
- });
12
- },
13
- async listTransferOffers(options) {
14
- return await transport.request({
15
- method: 'GET',
16
- path: '/v0/wallet/transfer-offers',
17
- signal: options?.signal,
18
- });
19
- },
20
- async getTransferOfferStatus(request, options) {
21
- return await transport.request({
22
- method: 'POST',
23
- path: buildPath('/v0/wallet/transfer-offers/{tracking_id}/status', request),
24
- signal: options?.signal,
25
- });
26
- },
27
- async lookupTransferOfferStatus(request, options) {
28
- try {
29
- return await this.getTransferOfferStatus(request, options);
30
- }
31
- catch (error) {
32
- if (isNotFoundHttpError(error)) {
33
- return undefined;
34
- }
35
- throw error;
36
- }
37
- },
38
- async createBuyTrafficRequest(request, options) {
39
- return await transport.request({
40
- method: 'POST',
41
- path: '/v0/wallet/buy-traffic-requests',
42
- body: request,
43
- signal: options?.signal,
44
- });
45
- },
46
- async getBuyTrafficRequestStatus(request, options) {
47
- return await transport.request({
48
- method: 'POST',
49
- path: buildPath('/v0/wallet/buy-traffic-requests/{tracking_id}/status', request),
50
- signal: options?.signal,
51
- });
52
- },
53
- async lookupBuyTrafficRequestStatus(request, options) {
54
- try {
55
- return await this.getBuyTrafficRequestStatus(request, options);
56
- }
57
- catch (error) {
58
- if (isNotFoundHttpError(error)) {
59
- return undefined;
60
- }
61
- throw error;
62
- }
63
- },
64
- };
65
- }
66
- function buildPath(pathTemplate, pathParams) {
67
- return pathTemplate.replace(/\{([^}]+)\}/g, (_match, key) => {
68
- const value = pathParams[key];
69
- if (value === undefined) {
70
- throw new Error(`Missing required legacy wallet path parameter: ${key}`);
71
- }
72
- return encodeURIComponent(String(value));
73
- });
74
- }
75
- function isNotFoundHttpError(error) {
76
- const candidate = typeof error === 'object' && error !== null
77
- ? error
78
- : undefined;
79
- return candidate?.name === 'HttpError' && candidate.status === 404;
80
- }
81
- //# sourceMappingURL=createLegacyWalletClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createLegacyWalletClient.js","sourceRoot":"","sources":["../src/createLegacyWalletClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,UAAU,CAAA;AAwExD,MAAM,UAAU,wBAAwB,CACtC,MAAgC;IAEhC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;IAEjC,OAAO;QACL,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,OAAO;YACxC,OAAO,MAAM,SAAS,CAAC,OAAO,CAA0C;gBACtE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,4BAA4B;gBAClC,IAAI,EAAE,OAAO;gBACb,MAAM,EAAE,OAAO,EAAE,MAAM;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,CAAC,kBAAkB,CAAC,OAAO;YAC9B,OAAO,MAAM,SAAS,CAAC,OAAO,CAAyC;gBACrE,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,4BAA4B;gBAClC,MAAM,EAAE,OAAO,EAAE,MAAM;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,CAAC,sBAAsB,CAAC,OAAO,EAAE,OAAO;YAC3C,OAAO,MAAM,SAAS,CAAC,OAAO,CAA0C;gBACtE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,SAAS,CAAC,iDAAiD,EAAE,OAAO,CAAC;gBAC3E,MAAM,EAAE,OAAO,EAAE,MAAM;aACxB,CAAC,CAAA;QACJ,CAAC;QAED,KAAK,CAAC,yBAAyB,CAAC,OAAO,EAAE,OAAO;YAC9C,IAAI,CAAC;gBACH,OAAO,MAAM,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YAC5D,CAAC;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,KAAK,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAA;QAC1E,CAAC;QACD,OAAO,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;IAC1C,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAc;IACzC,MAAM,SAAS,GACb,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QACzC,CAAC,CAAE,KAA8C;QACjD,CAAC,CAAC,SAAS,CAAA;IAEf,OAAO,SAAS,EAAE,IAAI,KAAK,WAAW,IAAI,SAAS,CAAC,MAAM,KAAK,GAAG,CAAA;AACpE,CAAC"}
@@ -1,81 +0,0 @@
1
- import { type TransportConfig } from 'cantonjs';
2
- import type { operations } from '../generated/scanProxy.types.js';
3
- type OperationName = keyof operations;
4
- type JsonResponse<TName extends OperationName> = operations[TName] extends {
5
- responses: {
6
- 200: {
7
- content: {
8
- 'application/json': infer T;
9
- };
10
- };
11
- };
12
- } ? T : never;
13
- type JsonRequestBody<TName extends OperationName> = operations[TName] extends {
14
- requestBody: {
15
- content: {
16
- 'application/json': infer T;
17
- };
18
- };
19
- } ? T : never;
20
- type QueryParameters<TName extends OperationName> = operations[TName] extends {
21
- parameters: {
22
- query?: infer T;
23
- };
24
- } ? T : never;
25
- type PathParameters<TName extends OperationName> = operations[TName] extends {
26
- parameters: {
27
- path?: infer T;
28
- };
29
- } ? T : never;
30
- export type ExperimentalScanProxyClientConfig = TransportConfig;
31
- export type ExperimentalScanProxyRequestOptions = {
32
- readonly signal?: AbortSignal;
33
- };
34
- export declare const EXPERIMENTAL_SCAN_PROXY_OPERATIONS: readonly [{
35
- readonly clientMethod: "lookupFeaturedAppRight";
36
- readonly proxyOperationId: "lookupFeaturedAppRight";
37
- readonly scanOperationId: "lookupFeaturedAppRight";
38
- readonly method: "GET";
39
- readonly path: "/v0/scan-proxy/featured-apps/{provider_party_id}";
40
- }, {
41
- readonly clientMethod: "getAmuletRules";
42
- readonly proxyOperationId: "getAmuletRules";
43
- readonly scanOperationId: "getAmuletRules";
44
- readonly method: "GET";
45
- readonly path: "/v0/scan-proxy/amulet-rules";
46
- }, {
47
- readonly clientMethod: "getAnsRules";
48
- readonly proxyOperationId: "getAnsRules";
49
- readonly scanOperationId: "getAnsRules";
50
- readonly method: "POST";
51
- readonly path: "/v0/scan-proxy/ans-rules";
52
- }, {
53
- readonly clientMethod: "lookupTransferPreapprovalByParty";
54
- readonly proxyOperationId: "lookupTransferPreapprovalByParty";
55
- readonly scanOperationId: "lookupTransferPreapprovalByParty";
56
- readonly method: "GET";
57
- readonly path: "/v0/scan-proxy/transfer-preapprovals/by-party/{party}";
58
- }, {
59
- readonly clientMethod: "lookupTransferCommandCounterByParty";
60
- readonly proxyOperationId: "lookupTransferCommandCounterByParty";
61
- readonly scanOperationId: "lookupTransferCommandCounterByParty";
62
- readonly method: "GET";
63
- readonly path: "/v0/scan-proxy/transfer-command-counter/{party}";
64
- }, {
65
- readonly clientMethod: "lookupTransferCommandStatus";
66
- readonly proxyOperationId: "lookupTransferCommandStatus";
67
- readonly scanOperationId: "lookupTransferCommandStatus";
68
- readonly method: "GET";
69
- readonly path: "/v0/scan-proxy/transfer-command/status";
70
- }];
71
- export type ExperimentalScanProxyOperation = (typeof EXPERIMENTAL_SCAN_PROXY_OPERATIONS)[number];
72
- export type ExperimentalScanProxyClient = {
73
- lookupFeaturedAppRight: (request: PathParameters<'lookupFeaturedAppRight'>, options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'lookupFeaturedAppRight'>>;
74
- getAmuletRules: (options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'getAmuletRules'>>;
75
- getAnsRules: (request: JsonRequestBody<'getAnsRules'>, options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'getAnsRules'>>;
76
- lookupTransferPreapprovalByParty: (request: PathParameters<'lookupTransferPreapprovalByParty'>, options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'lookupTransferPreapprovalByParty'>>;
77
- lookupTransferCommandCounterByParty: (request: PathParameters<'lookupTransferCommandCounterByParty'>, options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'lookupTransferCommandCounterByParty'>>;
78
- lookupTransferCommandStatus: (request: QueryParameters<'lookupTransferCommandStatus'>, options?: ExperimentalScanProxyRequestOptions) => Promise<JsonResponse<'lookupTransferCommandStatus'>>;
79
- };
80
- export declare function createExperimentalScanProxyClient(config: ExperimentalScanProxyClientConfig): ExperimentalScanProxyClient;
81
- export {};
@@ -1,135 +0,0 @@
1
- import { jsonApi } from 'cantonjs';
2
- export const EXPERIMENTAL_SCAN_PROXY_OPERATIONS = [
3
- {
4
- clientMethod: 'lookupFeaturedAppRight',
5
- proxyOperationId: 'lookupFeaturedAppRight',
6
- scanOperationId: 'lookupFeaturedAppRight',
7
- method: 'GET',
8
- path: '/v0/scan-proxy/featured-apps/{provider_party_id}',
9
- },
10
- {
11
- clientMethod: 'getAmuletRules',
12
- proxyOperationId: 'getAmuletRules',
13
- scanOperationId: 'getAmuletRules',
14
- method: 'GET',
15
- path: '/v0/scan-proxy/amulet-rules',
16
- },
17
- {
18
- clientMethod: 'getAnsRules',
19
- proxyOperationId: 'getAnsRules',
20
- scanOperationId: 'getAnsRules',
21
- method: 'POST',
22
- path: '/v0/scan-proxy/ans-rules',
23
- },
24
- {
25
- clientMethod: 'lookupTransferPreapprovalByParty',
26
- proxyOperationId: 'lookupTransferPreapprovalByParty',
27
- scanOperationId: 'lookupTransferPreapprovalByParty',
28
- method: 'GET',
29
- path: '/v0/scan-proxy/transfer-preapprovals/by-party/{party}',
30
- },
31
- {
32
- clientMethod: 'lookupTransferCommandCounterByParty',
33
- proxyOperationId: 'lookupTransferCommandCounterByParty',
34
- scanOperationId: 'lookupTransferCommandCounterByParty',
35
- method: 'GET',
36
- path: '/v0/scan-proxy/transfer-command-counter/{party}',
37
- },
38
- {
39
- clientMethod: 'lookupTransferCommandStatus',
40
- proxyOperationId: 'lookupTransferCommandStatus',
41
- scanOperationId: 'lookupTransferCommandStatus',
42
- method: 'GET',
43
- path: '/v0/scan-proxy/transfer-command/status',
44
- },
45
- ];
46
- export function createExperimentalScanProxyClient(config) {
47
- const transport = jsonApi(config);
48
- return {
49
- async lookupFeaturedAppRight(request, options) {
50
- return await transport.request({
51
- method: 'GET',
52
- path: buildRequestPath('/v0/scan-proxy/featured-apps/{provider_party_id}', {
53
- pathParams: request,
54
- }),
55
- signal: options?.signal,
56
- });
57
- },
58
- async getAmuletRules(options) {
59
- return await transport.request({
60
- method: 'GET',
61
- path: '/v0/scan-proxy/amulet-rules',
62
- signal: options?.signal,
63
- });
64
- },
65
- async getAnsRules(request, options) {
66
- return await transport.request({
67
- method: 'POST',
68
- path: '/v0/scan-proxy/ans-rules',
69
- body: request,
70
- signal: options?.signal,
71
- });
72
- },
73
- async lookupTransferPreapprovalByParty(request, options) {
74
- return await transport.request({
75
- method: 'GET',
76
- path: buildRequestPath('/v0/scan-proxy/transfer-preapprovals/by-party/{party}', {
77
- pathParams: request,
78
- }),
79
- signal: options?.signal,
80
- });
81
- },
82
- async lookupTransferCommandCounterByParty(request, options) {
83
- return await transport.request({
84
- method: 'GET',
85
- path: buildRequestPath('/v0/scan-proxy/transfer-command-counter/{party}', {
86
- pathParams: request,
87
- }),
88
- signal: options?.signal,
89
- });
90
- },
91
- async lookupTransferCommandStatus(request, options) {
92
- return await transport.request({
93
- method: 'GET',
94
- path: buildRequestPath('/v0/scan-proxy/transfer-command/status', {
95
- query: request,
96
- }),
97
- signal: options?.signal,
98
- });
99
- },
100
- };
101
- }
102
- function buildRequestPath(pathTemplate, options) {
103
- const path = interpolatePathParams(pathTemplate, options?.pathParams);
104
- const queryString = buildQueryString(options?.query);
105
- return queryString.length === 0 ? path : `${path}?${queryString}`;
106
- }
107
- function interpolatePathParams(pathTemplate, pathParams) {
108
- return pathTemplate.replace(/\{([^}]+)\}/g, (_match, key) => {
109
- const value = pathParams?.[key];
110
- if (value === undefined) {
111
- throw new Error(`Missing required experimental Scan Proxy path parameter: ${key}`);
112
- }
113
- return encodeURIComponent(String(value));
114
- });
115
- }
116
- function buildQueryString(query) {
117
- if (query === undefined) {
118
- return '';
119
- }
120
- const params = new URLSearchParams();
121
- for (const [key, value] of Object.entries(query)) {
122
- if (value === undefined || value === null) {
123
- continue;
124
- }
125
- if (Array.isArray(value)) {
126
- for (const item of value) {
127
- params.append(key, String(item));
128
- }
129
- continue;
130
- }
131
- params.append(key, String(value));
132
- }
133
- return params.toString();
134
- }
135
- //# sourceMappingURL=createExperimentalScanProxyClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createExperimentalScanProxyClient.js","sourceRoot":"","sources":["../../src/experimental/createExperimentalScanProxyClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,UAAU,CAAA;AAgCxD,MAAM,CAAC,MAAM,kCAAkC,GAAG;IAChD;QACE,YAAY,EAAE,wBAAwB;QACtC,gBAAgB,EAAE,wBAAwB;QAC1C,eAAe,EAAE,wBAAwB;QACzC,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,kDAAkD;KACzD;IACD;QACE,YAAY,EAAE,gBAAgB;QAC9B,gBAAgB,EAAE,gBAAgB;QAClC,eAAe,EAAE,gBAAgB;QACjC,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,6BAA6B;KACpC;IACD;QACE,YAAY,EAAE,aAAa;QAC3B,gBAAgB,EAAE,aAAa;QAC/B,eAAe,EAAE,aAAa;QAC9B,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,0BAA0B;KACjC;IACD;QACE,YAAY,EAAE,kCAAkC;QAChD,gBAAgB,EAAE,kCAAkC;QACpD,eAAe,EAAE,kCAAkC;QACnD,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,uDAAuD;KAC9D;IACD;QACE,YAAY,EAAE,qCAAqC;QACnD,gBAAgB,EAAE,qCAAqC;QACvD,eAAe,EAAE,qCAAqC;QACtD,MAAM,E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