@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/amulet-service-scan-proxy.d.ts.map +1 -1
- package/dist/amulet-service-scan.d.ts.map +1 -1
- package/dist/amulet-service.d.ts.map +1 -1
- package/dist/index.cjs +321 -349
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +298 -344
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -1,356 +1,310 @@
|
|
|
1
|
-
import { ScanClient } from
|
|
2
|
-
import Decimal from
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
-
|
|
156
|
+
//#endregion
|
|
157
|
+
//#region src/amulet-service-scan.ts
|
|
207
158
|
var AmuletServiceScanOnly = class extends AmuletServiceBase {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
|
|
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
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
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
|
-
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
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
|
-
|
|
305
|
+
return x instanceof ScanClient;
|
|
352
306
|
}
|
|
353
|
-
|
|
307
|
+
//#endregion
|
|
354
308
|
export { AmuletService };
|
|
355
|
-
|
|
309
|
+
|
|
356
310
|
//# sourceMappingURL=index.js.map
|