@canton-network/core-amulet-service 1.8.0 → 1.10.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/dist/index.js CHANGED
@@ -1,356 +1,310 @@
1
- import { ScanClient } from '@canton-network/core-splice-client';
2
- import Decimal from 'decimal.js';
3
-
4
- var __defProp = Object.defineProperty;
5
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
6
- var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
7
- var REQUESTED_AT_SKEW_MS = 6e4;
1
+ import { ScanClient } from "@canton-network/core-splice-client";
2
+ import Decimal from "decimal.js";
3
+ //#region src/amulet-service-base.ts
4
+ const REQUESTED_AT_SKEW_MS = 6e4;
8
5
  var AmuletServiceBase = class {
9
- constructor(tokenStandard) {
10
- this.tokenStandard = tokenStandard;
11
- }
12
- async buyMemberTraffic(dso, provider, trafficAmount, synchronizerId, memberId, migrationId, inputUtxos) {
13
- const amuletRules = await this.getAmuletRules();
14
- const activeRound = await this.getActiveOpenMiningRound();
15
- const inputHoldings = await this.tokenStandard.getInputHoldingsCids(
16
- provider,
17
- inputUtxos,
18
- new Decimal(trafficAmount)
19
- );
20
- if (!amuletRules) {
21
- throw new Error("AmuletRules contract not found");
22
- }
23
- if (!activeRound) {
24
- throw new Error(
25
- "OpenMiningRound active at current moment not found"
26
- );
27
- }
28
- const disclosed = [
29
- {
30
- templateId: amuletRules.template_id,
31
- contractId: amuletRules.contract_id,
32
- createdEventBlob: amuletRules.created_event_blob,
33
- synchronizerId
34
- },
35
- {
36
- templateId: activeRound.template_id,
37
- contractId: activeRound.contract_id,
38
- createdEventBlob: activeRound.created_event_blob,
39
- synchronizerId
40
- }
41
- ];
42
- const context = {
43
- openMiningRound: activeRound.contract_id,
44
- issuingMiningRounds: [],
45
- validatorRights: [],
46
- featuredAppRight: null
47
- };
48
- const choiceArgs = {
49
- context,
50
- inputs: inputHoldings.map((cid) => ({
51
- tag: "InputAmulet",
52
- value: cid
53
- })),
54
- provider,
55
- memberId: this.tokenStandard.core.toQualifiedMemberId(memberId),
56
- synchronizerId,
57
- migrationId: migrationId.toString(),
58
- trafficAmount: trafficAmount.toString(),
59
- expectedDso: dso
60
- };
61
- const exercise = {
62
- templateId: "#splice-amulet:Splice.AmuletRules:AmuletRules",
63
- contractId: amuletRules.contract_id,
64
- choice: "AmuletRules_BuyMemberTraffic",
65
- choiceArgument: choiceArgs
66
- };
67
- return [exercise, disclosed];
68
- }
69
- async selfGrantFeatureAppRight(providerPartyId, synchronizerId) {
70
- const amuletRules = await this.getAmuletRules();
71
- const disclosedContracts = {
72
- templateId: amuletRules.template_id,
73
- contractId: amuletRules.contract_id,
74
- createdEventBlob: amuletRules.created_event_blob,
75
- synchronizerId
76
- };
77
- return [
78
- {
79
- templateId: amuletRules.template_id,
80
- contractId: amuletRules.contract_id,
81
- choice: "AmuletRules_DevNet_FeatureApp",
82
- choiceArgument: {
83
- provider: providerPartyId
84
- }
85
- },
86
- [disclosedContracts]
87
- ];
88
- }
89
- async cancelTransferPreapproval(contractId, templateId, actor) {
90
- const exercise = {
91
- templateId,
92
- contractId,
93
- choice: "TransferPreapproval_Cancel",
94
- choiceArgument: { p: actor }
95
- };
96
- return [exercise, []];
97
- }
98
- async renewTransferPreapproval(contractId, templateId, provider, synchronizerId, newExpiresAt, inputUtxos) {
99
- const amuletRules = await this.getAmuletRules();
100
- const activeRound = await this.getActiveOpenMiningRound();
101
- if (!amuletRules) {
102
- throw new Error("AmuletRules contract not found");
103
- }
104
- if (!activeRound) {
105
- throw new Error(
106
- "OpenMiningRound active at current moment not found"
107
- );
108
- }
109
- const disclosed = [
110
- {
111
- templateId: amuletRules.template_id,
112
- contractId: amuletRules.contract_id,
113
- createdEventBlob: amuletRules.created_event_blob,
114
- synchronizerId
115
- },
116
- {
117
- templateId: activeRound.template_id,
118
- contractId: activeRound.contract_id,
119
- createdEventBlob: activeRound.created_event_blob,
120
- synchronizerId
121
- }
122
- ];
123
- const inputHoldings = await this.tokenStandard.getInputHoldingsCids(
124
- provider,
125
- inputUtxos
126
- );
127
- const context = {
128
- context: {
129
- openMiningRound: activeRound.contract_id,
130
- issuingMiningRounds: [],
131
- validatorRights: [],
132
- featuredAppRight: null
133
- },
134
- amuletRules: amuletRules.contract_id
135
- };
136
- const effectiveNewExpiresAt = newExpiresAt ?? new Date(Date.now() + 90 * 24 * 3600 * 1e3);
137
- const exercise = {
138
- templateId,
139
- contractId,
140
- choice: "TransferPreapproval_Renew",
141
- choiceArgument: {
142
- context,
143
- inputs: inputHoldings.map((cid) => ({
144
- tag: "InputAmulet",
145
- value: cid
146
- })),
147
- newExpiresAt: effectiveNewExpiresAt.toISOString()
148
- }
149
- };
150
- return [exercise, disclosed];
151
- }
152
- async createTap(receiver, amount, instrumentAdmin, instrumentId, registryUrl) {
153
- const now = /* @__PURE__ */ new Date();
154
- const tomorrow = new Date(now);
155
- tomorrow.setDate(tomorrow.getDate() + 1);
156
- const choiceArgs = {
157
- expectedAdmin: instrumentAdmin,
158
- transfer: {
159
- sender: instrumentAdmin,
160
- receiver,
161
- amount,
162
- instrumentId: { admin: instrumentAdmin, id: instrumentId },
163
- lock: null,
164
- requestedAt: new Date(
165
- Date.now() - REQUESTED_AT_SKEW_MS
166
- ).toISOString(),
167
- executeBefore: tomorrow.toISOString(),
168
- inputHoldingCids: [],
169
- meta: { values: {} }
170
- },
171
- extraArgs: {
172
- context: { values: {} },
173
- meta: { values: {} }
174
- }
175
- };
176
- const disclosedContracts = (await this.tokenStandard.transfer.fetchTransferFactoryChoiceContext(
177
- registryUrl,
178
- choiceArgs
179
- )).choiceContext.disclosedContracts;
180
- const amuletRules = await this.getAmuletRules();
181
- if (!amuletRules) {
182
- throw new Error("AmuletRules contract not found");
183
- }
184
- const latestOpenMiningRound = await this.getActiveOpenMiningRound();
185
- if (!latestOpenMiningRound) {
186
- throw new Error(
187
- "OpenMiningRound active at current moment not found"
188
- );
189
- }
190
- return [
191
- {
192
- templateId: amuletRules.template_id,
193
- contractId: amuletRules.contract_id,
194
- choice: "AmuletRules_DevNet_Tap",
195
- choiceArgument: {
196
- receiver,
197
- amount,
198
- openRound: latestOpenMiningRound.contract_id
199
- }
200
- },
201
- disclosedContracts
202
- ];
203
- }
6
+ constructor(tokenStandard) {
7
+ this.tokenStandard = tokenStandard;
8
+ }
9
+ async buyMemberTraffic(dso, provider, trafficAmount, synchronizerId, memberId, migrationId, inputUtxos) {
10
+ const amuletRules = await this.getAmuletRules();
11
+ const activeRound = await this.getActiveOpenMiningRound();
12
+ const inputHoldings = await this.tokenStandard.getInputHoldingsCids(provider, inputUtxos, new Decimal(trafficAmount));
13
+ if (!amuletRules) throw new Error("AmuletRules contract not found");
14
+ if (!activeRound) throw new Error("OpenMiningRound active at current moment not found");
15
+ const disclosed = [{
16
+ templateId: amuletRules.template_id,
17
+ contractId: amuletRules.contract_id,
18
+ createdEventBlob: amuletRules.created_event_blob,
19
+ synchronizerId
20
+ }, {
21
+ templateId: activeRound.template_id,
22
+ contractId: activeRound.contract_id,
23
+ createdEventBlob: activeRound.created_event_blob,
24
+ synchronizerId
25
+ }];
26
+ const choiceArgs = {
27
+ context: {
28
+ openMiningRound: activeRound.contract_id,
29
+ issuingMiningRounds: [],
30
+ validatorRights: [],
31
+ featuredAppRight: null
32
+ },
33
+ inputs: inputHoldings.map((cid) => ({
34
+ tag: "InputAmulet",
35
+ value: cid
36
+ })),
37
+ provider,
38
+ memberId: this.tokenStandard.core.toQualifiedMemberId(memberId),
39
+ synchronizerId,
40
+ migrationId: migrationId.toString(),
41
+ trafficAmount: trafficAmount.toString(),
42
+ expectedDso: dso
43
+ };
44
+ return [{
45
+ templateId: "#splice-amulet:Splice.AmuletRules:AmuletRules",
46
+ contractId: amuletRules.contract_id,
47
+ choice: "AmuletRules_BuyMemberTraffic",
48
+ choiceArgument: choiceArgs
49
+ }, disclosed];
50
+ }
51
+ async selfGrantFeatureAppRight(providerPartyId, synchronizerId) {
52
+ const amuletRules = await this.getAmuletRules();
53
+ const disclosedContracts = {
54
+ templateId: amuletRules.template_id,
55
+ contractId: amuletRules.contract_id,
56
+ createdEventBlob: amuletRules.created_event_blob,
57
+ synchronizerId
58
+ };
59
+ return [{
60
+ templateId: amuletRules.template_id,
61
+ contractId: amuletRules.contract_id,
62
+ choice: "AmuletRules_DevNet_FeatureApp",
63
+ choiceArgument: { provider: providerPartyId }
64
+ }, [disclosedContracts]];
65
+ }
66
+ async cancelTransferPreapproval(contractId, templateId, actor) {
67
+ return [{
68
+ templateId,
69
+ contractId,
70
+ choice: "TransferPreapproval_Cancel",
71
+ choiceArgument: { p: actor }
72
+ }, []];
73
+ }
74
+ async renewTransferPreapproval(contractId, templateId, provider, synchronizerId, newExpiresAt, inputUtxos) {
75
+ const amuletRules = await this.getAmuletRules();
76
+ const activeRound = await this.getActiveOpenMiningRound();
77
+ if (!amuletRules) throw new Error("AmuletRules contract not found");
78
+ if (!activeRound) throw new Error("OpenMiningRound active at current moment not found");
79
+ const disclosed = [{
80
+ templateId: amuletRules.template_id,
81
+ contractId: amuletRules.contract_id,
82
+ createdEventBlob: amuletRules.created_event_blob,
83
+ synchronizerId
84
+ }, {
85
+ templateId: activeRound.template_id,
86
+ contractId: activeRound.contract_id,
87
+ createdEventBlob: activeRound.created_event_blob,
88
+ synchronizerId
89
+ }];
90
+ const inputHoldings = await this.tokenStandard.getInputHoldingsCids(provider, inputUtxos);
91
+ const context = {
92
+ context: {
93
+ openMiningRound: activeRound.contract_id,
94
+ issuingMiningRounds: [],
95
+ validatorRights: [],
96
+ featuredAppRight: null
97
+ },
98
+ amuletRules: amuletRules.contract_id
99
+ };
100
+ const effectiveNewExpiresAt = newExpiresAt ?? new Date(Date.now() + 7776e6);
101
+ return [{
102
+ templateId,
103
+ contractId,
104
+ choice: "TransferPreapproval_Renew",
105
+ choiceArgument: {
106
+ context,
107
+ inputs: inputHoldings.map((cid) => ({
108
+ tag: "InputAmulet",
109
+ value: cid
110
+ })),
111
+ newExpiresAt: effectiveNewExpiresAt.toISOString()
112
+ }
113
+ }, disclosed];
114
+ }
115
+ async createTap(receiver, amount, instrumentAdmin, instrumentId, registryUrl) {
116
+ const tomorrow = /* @__PURE__ */ new Date(/* @__PURE__ */ new Date());
117
+ tomorrow.setDate(tomorrow.getDate() + 1);
118
+ const choiceArgs = {
119
+ expectedAdmin: instrumentAdmin,
120
+ transfer: {
121
+ sender: instrumentAdmin,
122
+ receiver,
123
+ amount,
124
+ instrumentId: {
125
+ admin: instrumentAdmin,
126
+ id: instrumentId
127
+ },
128
+ lock: null,
129
+ requestedAt: (/* @__PURE__ */ new Date(Date.now() - REQUESTED_AT_SKEW_MS)).toISOString(),
130
+ executeBefore: tomorrow.toISOString(),
131
+ inputHoldingCids: [],
132
+ meta: { values: {} }
133
+ },
134
+ extraArgs: {
135
+ context: { values: {} },
136
+ meta: { values: {} }
137
+ }
138
+ };
139
+ const disclosedContracts = (await this.tokenStandard.transfer.fetchTransferFactoryChoiceContext(registryUrl, choiceArgs)).choiceContext.disclosedContracts;
140
+ const amuletRules = await this.getAmuletRules();
141
+ if (!amuletRules) throw new Error("AmuletRules contract not found");
142
+ const latestOpenMiningRound = await this.getActiveOpenMiningRound();
143
+ if (!latestOpenMiningRound) throw new Error("OpenMiningRound active at current moment not found");
144
+ return [{
145
+ templateId: amuletRules.template_id,
146
+ contractId: amuletRules.contract_id,
147
+ choice: "AmuletRules_DevNet_Tap",
148
+ choiceArgument: {
149
+ receiver,
150
+ amount,
151
+ openRound: latestOpenMiningRound.contract_id
152
+ }
153
+ }, disclosedContracts];
154
+ }
204
155
  };
205
-
206
- // src/amulet-service-scan.ts
156
+ //#endregion
157
+ //#region src/amulet-service-scan.ts
207
158
  var AmuletServiceScanOnly = class extends AmuletServiceBase {
208
- constructor(tokenStandard, scanClient) {
209
- super(tokenStandard);
210
- this.tokenStandard = tokenStandard;
211
- this.scanClient = scanClient;
212
- }
213
- async getAmuletRules() {
214
- const amuletRules = await this.scanClient.getAmuletRules();
215
- if (!amuletRules) {
216
- throw new Error("AmuletRules contract not found");
217
- }
218
- return amuletRules;
219
- }
220
- async getActiveOpenMiningRound() {
221
- return await this.scanClient.getActiveOpenMiningRound();
222
- }
223
- async isDevNet() {
224
- return await this.scanClient.isDevNet();
225
- }
226
- async getTransferPreApprovalByParty(partyId) {
227
- const { transfer_preapproval } = await this.scanClient.get(
228
- "/v0/transfer-preapprovals/by-party/{party}",
229
- {
230
- path: {
231
- party: partyId
232
- }
233
- }
234
- );
235
- return transfer_preapproval;
236
- }
237
- async getFeaturedAppsByParty(partyId) {
238
- const { featured_app_right } = await this.scanClient.get(
239
- "/v0/featured-apps/{provider_party_id}",
240
- {
241
- path: {
242
- provider_party_id: partyId
243
- }
244
- }
245
- );
246
- return featured_app_right;
247
- }
248
- async getMemberTrafficStatus(domainId, memberId) {
249
- return this.scanClient.get(
250
- "/v0/domains/{domain_id}/members/{member_id}/traffic-status",
251
- {
252
- path: {
253
- domain_id: domainId,
254
- member_id: this.tokenStandard.core.toQualifiedMemberId(memberId)
255
- }
256
- }
257
- );
258
- }
159
+ constructor(tokenStandard, scanClient) {
160
+ super(tokenStandard);
161
+ this.tokenStandard = tokenStandard;
162
+ this.scanClient = scanClient;
163
+ }
164
+ async getAmuletRules() {
165
+ const amuletRules = await this.scanClient.getAmuletRules();
166
+ if (!amuletRules) throw new Error("AmuletRules contract not found");
167
+ return amuletRules;
168
+ }
169
+ async getActiveOpenMiningRound() {
170
+ return await this.scanClient.getActiveOpenMiningRound();
171
+ }
172
+ async isDevNet() {
173
+ return await this.scanClient.isDevNet();
174
+ }
175
+ async getTransferPreApprovalByParty(partyId) {
176
+ const { transfer_preapproval } = await this.scanClient.get("/v0/transfer-preapprovals/by-party/{party}", { path: { party: partyId } });
177
+ return transfer_preapproval;
178
+ }
179
+ async getFeaturedAppsByParty(partyId) {
180
+ const { featured_app_right } = await this.scanClient.get("/v0/featured-apps/{provider_party_id}", { path: { provider_party_id: partyId } });
181
+ return featured_app_right;
182
+ }
183
+ async getMemberTrafficStatus(domainId, memberId) {
184
+ return this.scanClient.get("/v0/domains/{domain_id}/members/{member_id}/traffic-status", { path: {
185
+ domain_id: domainId,
186
+ member_id: this.tokenStandard.core.toQualifiedMemberId(memberId)
187
+ } });
188
+ }
259
189
  };
260
-
261
- // src/amulet-service-scan-proxy.ts
190
+ //#endregion
191
+ //#region src/amulet-service-scan-proxy.ts
192
+ /** AmuletService extends TokenStandardService to provide features that are
193
+ * available for amulet but not in the token standard, such as:
194
+ *
195
+ * - Tapping
196
+ * - Transfer preapprovals
197
+ * - Featured apps
198
+ */
262
199
  var AmuletServiceScanProxy = class extends AmuletServiceBase {
263
- constructor(tokenStandard, scanProxyClient, scanClient) {
264
- super(tokenStandard);
265
- this.tokenStandard = tokenStandard;
266
- this.scanProxyClient = scanProxyClient;
267
- this.scanClient = scanClient;
268
- }
269
- getAmuletRules() {
270
- return this.scanProxyClient.getAmuletRules();
271
- }
272
- getActiveOpenMiningRound() {
273
- return this.scanProxyClient.getActiveOpenMiningRound();
274
- }
275
- async isDevNet() {
276
- return await this.scanProxyClient.isDevNet();
277
- }
278
- async getTransferPreApprovalByParty(partyId) {
279
- const { transfer_preapproval } = await this.scanProxyClient.get(
280
- "/v0/scan-proxy/transfer-preapprovals/by-party/{party}",
281
- {
282
- path: {
283
- party: partyId
284
- }
285
- }
286
- );
287
- return transfer_preapproval;
288
- }
289
- async getFeaturedAppsByParty(partyId) {
290
- const { featured_app_right } = await this.scanProxyClient.get(
291
- "/v0/scan-proxy/featured-apps/{provider_party_id}",
292
- {
293
- path: {
294
- provider_party_id: partyId
295
- }
296
- }
297
- );
298
- return featured_app_right;
299
- }
300
- async getMemberTrafficStatus(domainId, memberId) {
301
- if (!this.scanClient) {
302
- throw new Error("Scan API URL was not provided");
303
- }
304
- return this.scanClient.get(
305
- "/v0/domains/{domain_id}/members/{member_id}/traffic-status",
306
- {
307
- path: {
308
- domain_id: domainId,
309
- member_id: this.tokenStandard.core.toQualifiedMemberId(memberId)
310
- }
311
- }
312
- );
313
- }
200
+ constructor(tokenStandard, scanProxyClient, scanClient) {
201
+ super(tokenStandard);
202
+ this.tokenStandard = tokenStandard;
203
+ this.scanProxyClient = scanProxyClient;
204
+ this.scanClient = scanClient;
205
+ }
206
+ getAmuletRules() {
207
+ return this.scanProxyClient.getAmuletRules();
208
+ }
209
+ getActiveOpenMiningRound() {
210
+ return this.scanProxyClient.getActiveOpenMiningRound();
211
+ }
212
+ async isDevNet() {
213
+ return await this.scanProxyClient.isDevNet();
214
+ }
215
+ async getTransferPreApprovalByParty(partyId) {
216
+ const { transfer_preapproval } = await this.scanProxyClient.get("/v0/scan-proxy/transfer-preapprovals/by-party/{party}", { path: { party: partyId } });
217
+ return transfer_preapproval;
218
+ }
219
+ async getFeaturedAppsByParty(partyId) {
220
+ const { featured_app_right } = await this.scanProxyClient.get("/v0/scan-proxy/featured-apps/{provider_party_id}", { path: { provider_party_id: partyId } });
221
+ return featured_app_right;
222
+ }
223
+ async getMemberTrafficStatus(domainId, memberId) {
224
+ if (!this.scanClient) throw new Error("Scan API URL was not provided");
225
+ return this.scanClient.get("/v0/domains/{domain_id}/members/{member_id}/traffic-status", { path: {
226
+ domain_id: domainId,
227
+ member_id: this.tokenStandard.core.toQualifiedMemberId(memberId)
228
+ } });
229
+ }
314
230
  };
315
-
316
- // src/amulet-service.ts
231
+ //#endregion
232
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
233
+ function _typeof(o) {
234
+ "@babel/helpers - typeof";
235
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
236
+ return typeof o;
237
+ } : function(o) {
238
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
239
+ }, _typeof(o);
240
+ }
241
+ //#endregion
242
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
243
+ function toPrimitive(t, r) {
244
+ if ("object" != _typeof(t) || !t) return t;
245
+ var e = t[Symbol.toPrimitive];
246
+ if (void 0 !== e) {
247
+ var i = e.call(t, r || "default");
248
+ if ("object" != _typeof(i)) return i;
249
+ throw new TypeError("@@toPrimitive must return a primitive value.");
250
+ }
251
+ return ("string" === r ? String : Number)(t);
252
+ }
253
+ //#endregion
254
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
255
+ function toPropertyKey(t) {
256
+ var i = toPrimitive(t, "string");
257
+ return "symbol" == _typeof(i) ? i : i + "";
258
+ }
259
+ //#endregion
260
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
261
+ function _defineProperty(e, r, t) {
262
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
263
+ value: t,
264
+ enumerable: !0,
265
+ configurable: !0,
266
+ writable: !0
267
+ }) : e[r] = t, e;
268
+ }
269
+ //#endregion
270
+ //#region src/amulet-service.ts
317
271
  var AmuletService = class {
318
- constructor(tokenStandard, arg1, arg2) {
319
- __publicField(this, "serviceImpl");
320
- this.serviceImpl = isScanClient(arg1) ? new AmuletServiceScanOnly(tokenStandard, arg1) : new AmuletServiceScanProxy(tokenStandard, arg1, arg2);
321
- }
322
- async buyMemberTraffic(...args) {
323
- return this.serviceImpl.buyMemberTraffic(...args);
324
- }
325
- async createTap(...args) {
326
- return this.serviceImpl.createTap(...args);
327
- }
328
- async cancelTransferPreapproval(...args) {
329
- return this.serviceImpl.cancelTransferPreapproval(...args);
330
- }
331
- async renewTransferPreapproval(...args) {
332
- return this.serviceImpl.renewTransferPreapproval(...args);
333
- }
334
- async getFeaturedAppsByParty(...args) {
335
- return this.serviceImpl.getFeaturedAppsByParty(...args);
336
- }
337
- async getTransferPreApprovalByParty(...args) {
338
- return this.serviceImpl.getTransferPreApprovalByParty(...args);
339
- }
340
- async selfGrantFeatureAppRight(...args) {
341
- return this.serviceImpl.selfGrantFeatureAppRight(...args);
342
- }
343
- async isDevNet(...args) {
344
- return this.serviceImpl.isDevNet(...args);
345
- }
346
- async getMemberTrafficStatus(...args) {
347
- return this.serviceImpl.getMemberTrafficStatus(...args);
348
- }
272
+ constructor(tokenStandard, arg1, arg2) {
273
+ _defineProperty(this, "serviceImpl", void 0);
274
+ this.serviceImpl = isScanClient(arg1) ? new AmuletServiceScanOnly(tokenStandard, arg1) : new AmuletServiceScanProxy(tokenStandard, arg1, arg2);
275
+ }
276
+ async buyMemberTraffic(...args) {
277
+ return this.serviceImpl.buyMemberTraffic(...args);
278
+ }
279
+ async createTap(...args) {
280
+ return this.serviceImpl.createTap(...args);
281
+ }
282
+ async cancelTransferPreapproval(...args) {
283
+ return this.serviceImpl.cancelTransferPreapproval(...args);
284
+ }
285
+ async renewTransferPreapproval(...args) {
286
+ return this.serviceImpl.renewTransferPreapproval(...args);
287
+ }
288
+ async getFeaturedAppsByParty(...args) {
289
+ return this.serviceImpl.getFeaturedAppsByParty(...args);
290
+ }
291
+ async getTransferPreApprovalByParty(...args) {
292
+ return this.serviceImpl.getTransferPreApprovalByParty(...args);
293
+ }
294
+ async selfGrantFeatureAppRight(...args) {
295
+ return this.serviceImpl.selfGrantFeatureAppRight(...args);
296
+ }
297
+ async isDevNet(...args) {
298
+ return this.serviceImpl.isDevNet(...args);
299
+ }
300
+ async getMemberTrafficStatus(...args) {
301
+ return this.serviceImpl.getMemberTrafficStatus(...args);
302
+ }
349
303
  };
350
304
  function isScanClient(x) {
351
- return x instanceof ScanClient;
305
+ return x instanceof ScanClient;
352
306
  }
353
-
307
+ //#endregion
354
308
  export { AmuletService };
355
- //# sourceMappingURL=index.js.map
309
+
356
310
  //# sourceMappingURL=index.js.map