@fivenorth/loop-sdk 0.12.0 → 0.12.2
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 +22 -2
- package/dist/connection.d.ts +3 -1
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +64 -0
- package/dist/index.js +99 -6
- package/dist/provider.d.ts +3 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +35 -6
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +7 -0
- package/dist/server/signer.d.ts +1 -1
- package/dist/server/signer.d.ts.map +1 -1
- package/dist/server/signer.js +1 -1
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,6 +119,15 @@ const contracts = await provider.getActiveContracts({
|
|
|
119
119
|
console.log(contracts);
|
|
120
120
|
```
|
|
121
121
|
|
|
122
|
+
#### Estimate Network Gas
|
|
123
|
+
|
|
124
|
+
```javascript
|
|
125
|
+
const gasEstimate = await provider.estimateGas(damlCommand);
|
|
126
|
+
console.log(gasEstimate);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Use this before submission if you want to inspect the expected network gas first.
|
|
130
|
+
|
|
122
131
|
#### Submit a Transaction
|
|
123
132
|
|
|
124
133
|
To submit a DAML transaction, you need to construct a command object and pass it to `submitTransaction`:
|
|
@@ -143,6 +152,7 @@ try {
|
|
|
143
152
|
// Optional: show a custom message in the wallet prompt
|
|
144
153
|
message: 'Transfer 10 CC to RetailStore',
|
|
145
154
|
estimateTraffic: true, // optional: return estimated traffic in submission response
|
|
155
|
+
deduplicationPeriod: { seconds: 60 }, // optional: override the default 30 minute dedup window
|
|
146
156
|
});
|
|
147
157
|
console.log('Transaction successful:', result);
|
|
148
158
|
} catch (error) {
|
|
@@ -159,6 +169,7 @@ To wait for the transaction result directly (opt-in), use:
|
|
|
159
169
|
```javascript
|
|
160
170
|
await provider.submitAndWaitForTransaction(damlCommand, {
|
|
161
171
|
message: 'Transfer 10 CC to RetailStore',
|
|
172
|
+
deduplicationPeriod: { seconds: 60 },
|
|
162
173
|
});
|
|
163
174
|
```
|
|
164
175
|
|
|
@@ -166,7 +177,7 @@ In wait mode, the final result is returned as a single `onTransactionUpdate` pay
|
|
|
166
177
|
|
|
167
178
|
Note: `submitAndWaitForTransaction` errors do not always mean the transaction failed. A 4xx error (e.g., 400) indicates a definite failure. A 5xx/timeout can mean the ledger is slow or backed up; the transaction may still be committed later, so clients should continue to listen for updates rather than assume failure.
|
|
168
179
|
|
|
169
|
-
Deduplication:
|
|
180
|
+
Deduplication: by default the wallet execute path uses a 30 minute deduplication window. You can override it with `deduplicationPeriod` in submit options. For ambiguous outcomes (for example timeout, disconnect, or 5xx where the previous submission may already have reached Canton), retry with the same payload `commandId` within that window to avoid double execution.
|
|
170
181
|
|
|
171
182
|
#### Sign a Message
|
|
172
183
|
|
|
@@ -200,6 +211,7 @@ await loop.wallet.transfer(
|
|
|
200
211
|
executeBefore: new Date(Date.now() + 24*60*60*1000).toISOString(), // optional
|
|
201
212
|
requestTimeout: 5 * 60 * 1000, // optional (ms), defaults to 5 minutes
|
|
202
213
|
estimateTraffic: true, // optional: return estimated traffic in submission response
|
|
214
|
+
deduplicationPeriod: { seconds: 60 }, // optional: override the default 30 minute dedup window
|
|
203
215
|
},
|
|
204
216
|
);
|
|
205
217
|
```
|
|
@@ -305,7 +317,15 @@ console.log('Transfer result:', result);
|
|
|
305
317
|
|
|
306
318
|
Server SDK transactions use an after-execution network gas model. If a previous transaction created unpaid network gas, the next transaction attempt may fail with `PaymentRequiredError`.
|
|
307
319
|
|
|
308
|
-
Best practice:
|
|
320
|
+
Best practice:
|
|
321
|
+
|
|
322
|
+
- call `estimateGas(...)` before submitting a transaction if you want to inspect the expected network gas first
|
|
323
|
+
- check for due gas before you submit a transaction, and pay it first if present
|
|
324
|
+
|
|
325
|
+
```javascript
|
|
326
|
+
const gasEstimate = await loop.estimateGas(preparedPayload);
|
|
327
|
+
console.log('Estimated network gas:', gasEstimate.estimated_gas_amount);
|
|
328
|
+
```
|
|
309
329
|
|
|
310
330
|
```javascript
|
|
311
331
|
const dueGas = await loop.checkDueGas();
|
package/dist/connection.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Network, Account, Holding, TransferRequest, PreparedTransferPayload, ExchangeApiKeyResponse, TransactionPayload, PreparedSubmissionResponse, ExecuteSubmissionResquest, PendingGasResponse } from './types';
|
|
1
|
+
import type { Network, Account, Holding, TransferRequest, PreparedTransferPayload, ExchangeApiKeyResponse, TransactionPayload, PreparedSubmissionResponse, ExecuteSubmissionResquest, PendingGasResponse, EstimatedGasResponse } from './types';
|
|
2
2
|
import { SessionInfo } from './session';
|
|
3
3
|
export declare class Connection {
|
|
4
4
|
walletUrl: string;
|
|
@@ -35,6 +35,8 @@ export declare class Connection {
|
|
|
35
35
|
private parseErrorResponse;
|
|
36
36
|
private errorMessage;
|
|
37
37
|
prepareTransaction(session: SessionInfo, params: TransactionPayload): Promise<PreparedSubmissionResponse>;
|
|
38
|
+
estimateGas(session: SessionInfo, params: TransactionPayload): Promise<EstimatedGasResponse>;
|
|
39
|
+
estimateGasForConnect(authToken: string, params: TransactionPayload): Promise<EstimatedGasResponse>;
|
|
38
40
|
executeTransaction(session: SessionInfo, params: ExecuteSubmissionResquest): Promise<PreparedSubmissionResponse>;
|
|
39
41
|
getPendingGas(userApiKey: string, trackingId?: string): Promise<PendingGasResponse>;
|
|
40
42
|
preparePendingGas(userApiKey: string, trackingId?: string): Promise<{
|
package/dist/connection.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../src/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,OAAO,EACP,OAAO,EACP,OAAO,EACP,eAAe,EACf,uBAAuB,EAEvB,sBAAsB,EACtB,kBAAk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AE,MAAM,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAmBlH,OAAO,CAAC,YAAY;IAKpB,OAAO,CAAC,eAAe;CAqC1B"}
|
package/dist/connection.js
CHANGED
|
@@ -263,6 +263,69 @@ export class Connection {
|
|
|
263
263
|
}
|
|
264
264
|
return response.json();
|
|
265
265
|
}
|
|
266
|
+
async estimateGas(session, params) {
|
|
267
|
+
const response = await fetch(`${this.apiUrl}/api/v1/.connect/tickets/estimate-gas`, {
|
|
268
|
+
method: 'POST',
|
|
269
|
+
headers: {
|
|
270
|
+
'Content-Type': 'application/json',
|
|
271
|
+
'Authorization': `Bearer ${session.userApiKey}`,
|
|
272
|
+
},
|
|
273
|
+
body: JSON.stringify({
|
|
274
|
+
ticket_id: session.ticketId,
|
|
275
|
+
request_id: generateRequestId(),
|
|
276
|
+
payload: {
|
|
277
|
+
commands: params.commands,
|
|
278
|
+
disclosedContracts: params.disclosedContracts,
|
|
279
|
+
packageIdSelectionPreference: params.packageIdSelectionPreference,
|
|
280
|
+
actAs: params.actAs,
|
|
281
|
+
readAs: params.readAs,
|
|
282
|
+
synchronizerId: params.synchronizerId,
|
|
283
|
+
},
|
|
284
|
+
}),
|
|
285
|
+
});
|
|
286
|
+
if (!response.ok) {
|
|
287
|
+
const details = await this.parseErrorResponse(response);
|
|
288
|
+
throw new Error(this.errorMessage(details, `Failed to estimate gas with status ${response.status}.`));
|
|
289
|
+
}
|
|
290
|
+
const data = await response.json();
|
|
291
|
+
return {
|
|
292
|
+
requires_gas: data?.requiresFee,
|
|
293
|
+
can_execute: data?.canExecute,
|
|
294
|
+
estimated_gas_amount: data?.estimatedFeeAmount,
|
|
295
|
+
estimated_gas_asset: data?.estimatedFeeAsset,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
async estimateGasForConnect(authToken, params) {
|
|
299
|
+
const response = await fetch(`${this.apiUrl}/api/v1/.connect/tickets/transaction/estimate-gas`, {
|
|
300
|
+
method: 'POST',
|
|
301
|
+
headers: {
|
|
302
|
+
'Content-Type': 'application/json',
|
|
303
|
+
'Authorization': `Bearer ${authToken}`,
|
|
304
|
+
},
|
|
305
|
+
body: JSON.stringify({
|
|
306
|
+
request_id: generateRequestId(),
|
|
307
|
+
tx: {
|
|
308
|
+
commands: params.commands,
|
|
309
|
+
disclosedContracts: params.disclosedContracts,
|
|
310
|
+
packageIdSelectionPreference: params.packageIdSelectionPreference,
|
|
311
|
+
actAs: params.actAs,
|
|
312
|
+
readAs: params.readAs,
|
|
313
|
+
synchronizerId: params.synchronizerId,
|
|
314
|
+
},
|
|
315
|
+
}),
|
|
316
|
+
});
|
|
317
|
+
if (!response.ok) {
|
|
318
|
+
const details = await this.parseErrorResponse(response);
|
|
319
|
+
throw new Error(this.errorMessage(details, `Failed to estimate gas with status ${response.status}.`));
|
|
320
|
+
}
|
|
321
|
+
const data = await response.json();
|
|
322
|
+
return {
|
|
323
|
+
requires_gas: data?.requiresFee,
|
|
324
|
+
can_execute: data?.canExecute,
|
|
325
|
+
estimated_gas_amount: data?.estimatedFeeAmount,
|
|
326
|
+
estimated_gas_asset: data?.estimatedFeeAsset,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
266
329
|
// execute a signed transaction with v2/interactive-submisison/execute endpoint
|
|
267
330
|
async executeTransaction(session, params) {
|
|
268
331
|
if (!session.ticketId) {
|
|
@@ -280,6 +343,7 @@ export class Connection {
|
|
|
280
343
|
command_id: params.command_id,
|
|
281
344
|
signature: params.signature,
|
|
282
345
|
transaction_data: params.transaction_data,
|
|
346
|
+
deduplication_period: params.deduplication_period,
|
|
283
347
|
}),
|
|
284
348
|
});
|
|
285
349
|
if (response.status === 402) {
|
package/dist/index.js
CHANGED
|
@@ -2204,15 +2204,26 @@ class Provider {
|
|
|
2204
2204
|
getActiveContracts(params) {
|
|
2205
2205
|
return this.connection.getActiveContracts(this.auth_token, params);
|
|
2206
2206
|
}
|
|
2207
|
+
async estimateGas(payload) {
|
|
2208
|
+
return this.connection.estimateGasForConnect(this.auth_token, payload);
|
|
2209
|
+
}
|
|
2207
2210
|
async submitTransaction(payload, options) {
|
|
2208
|
-
const requestPayload =
|
|
2211
|
+
const requestPayload = {
|
|
2212
|
+
...payload,
|
|
2213
|
+
...options?.deduplicationPeriod ? { deduplicationPeriod: toLedgerDeduplicationPeriod(options.deduplicationPeriod) } : {}
|
|
2214
|
+
};
|
|
2215
|
+
const requestPayloadWithTraffic = options?.estimateTraffic ? { ...requestPayload, estimate_traffic: true } : requestPayload;
|
|
2209
2216
|
const executionMode = options?.executionMode;
|
|
2210
|
-
const finalPayload = executionMode === "wait" ? { ...
|
|
2217
|
+
const finalPayload = executionMode === "wait" ? { ...requestPayloadWithTraffic, execution_mode: "wait" } : requestPayloadWithTraffic;
|
|
2211
2218
|
return this.sendRequest("run_transaction" /* RUN_TRANSACTION */, finalPayload, options);
|
|
2212
2219
|
}
|
|
2213
2220
|
async submitAndWaitForTransaction(payload, options) {
|
|
2214
|
-
const requestPayload =
|
|
2215
|
-
|
|
2221
|
+
const requestPayload = {
|
|
2222
|
+
...payload,
|
|
2223
|
+
...options?.deduplicationPeriod ? { deduplicationPeriod: toLedgerDeduplicationPeriod(options.deduplicationPeriod) } : {}
|
|
2224
|
+
};
|
|
2225
|
+
const requestPayloadWithTraffic = options?.estimateTraffic ? { ...requestPayload, estimate_traffic: true } : requestPayload;
|
|
2226
|
+
return this.sendRequest("run_transaction" /* RUN_TRANSACTION */, { ...requestPayloadWithTraffic, execution_mode: "wait" }, options);
|
|
2216
2227
|
}
|
|
2217
2228
|
async transfer(recipient, amount, instrument, options) {
|
|
2218
2229
|
const amountStr = typeof amount === "number" ? amount.toString() : amount;
|
|
@@ -2254,7 +2265,12 @@ class Provider {
|
|
|
2254
2265
|
actAs: preparedPayload.actAs,
|
|
2255
2266
|
readAs: preparedPayload.readAs,
|
|
2256
2267
|
synchronizerId: preparedPayload.synchronizerId
|
|
2257
|
-
}, {
|
|
2268
|
+
}, {
|
|
2269
|
+
requestTimeout,
|
|
2270
|
+
message,
|
|
2271
|
+
estimateTraffic,
|
|
2272
|
+
deduplicationPeriod: options?.deduplicationPeriod
|
|
2273
|
+
});
|
|
2258
2274
|
}
|
|
2259
2275
|
async signMessage(message) {
|
|
2260
2276
|
return this.sendRequest("sign_raw_message" /* SIGN_RAW_MESSAGE */, message);
|
|
@@ -2368,6 +2384,19 @@ class Provider {
|
|
|
2368
2384
|
});
|
|
2369
2385
|
}
|
|
2370
2386
|
}
|
|
2387
|
+
function toLedgerDeduplicationPeriod(input) {
|
|
2388
|
+
if ("empty" in input) {
|
|
2389
|
+
return { Empty: {} };
|
|
2390
|
+
}
|
|
2391
|
+
return {
|
|
2392
|
+
DeduplicationDuration: {
|
|
2393
|
+
value: {
|
|
2394
|
+
seconds: input.seconds,
|
|
2395
|
+
nanos: input.nanos ?? 0
|
|
2396
|
+
}
|
|
2397
|
+
}
|
|
2398
|
+
};
|
|
2399
|
+
}
|
|
2371
2400
|
|
|
2372
2401
|
// src/connection.ts
|
|
2373
2402
|
class Connection {
|
|
@@ -2622,6 +2651,69 @@ class Connection {
|
|
|
2622
2651
|
}
|
|
2623
2652
|
return response.json();
|
|
2624
2653
|
}
|
|
2654
|
+
async estimateGas(session, params) {
|
|
2655
|
+
const response = await fetch(`${this.apiUrl}/api/v1/.connect/tickets/estimate-gas`, {
|
|
2656
|
+
method: "POST",
|
|
2657
|
+
headers: {
|
|
2658
|
+
"Content-Type": "application/json",
|
|
2659
|
+
Authorization: `Bearer ${session.userApiKey}`
|
|
2660
|
+
},
|
|
2661
|
+
body: JSON.stringify({
|
|
2662
|
+
ticket_id: session.ticketId,
|
|
2663
|
+
request_id: generateRequestId(),
|
|
2664
|
+
payload: {
|
|
2665
|
+
commands: params.commands,
|
|
2666
|
+
disclosedContracts: params.disclosedContracts,
|
|
2667
|
+
packageIdSelectionPreference: params.packageIdSelectionPreference,
|
|
2668
|
+
actAs: params.actAs,
|
|
2669
|
+
readAs: params.readAs,
|
|
2670
|
+
synchronizerId: params.synchronizerId
|
|
2671
|
+
}
|
|
2672
|
+
})
|
|
2673
|
+
});
|
|
2674
|
+
if (!response.ok) {
|
|
2675
|
+
const details = await this.parseErrorResponse(response);
|
|
2676
|
+
throw new Error(this.errorMessage(details, `Failed to estimate gas with status ${response.status}.`));
|
|
2677
|
+
}
|
|
2678
|
+
const data = await response.json();
|
|
2679
|
+
return {
|
|
2680
|
+
requires_gas: data?.requiresFee,
|
|
2681
|
+
can_execute: data?.canExecute,
|
|
2682
|
+
estimated_gas_amount: data?.estimatedFeeAmount,
|
|
2683
|
+
estimated_gas_asset: data?.estimatedFeeAsset
|
|
2684
|
+
};
|
|
2685
|
+
}
|
|
2686
|
+
async estimateGasForConnect(authToken, params) {
|
|
2687
|
+
const response = await fetch(`${this.apiUrl}/api/v1/.connect/tickets/transaction/estimate-gas`, {
|
|
2688
|
+
method: "POST",
|
|
2689
|
+
headers: {
|
|
2690
|
+
"Content-Type": "application/json",
|
|
2691
|
+
Authorization: `Bearer ${authToken}`
|
|
2692
|
+
},
|
|
2693
|
+
body: JSON.stringify({
|
|
2694
|
+
request_id: generateRequestId(),
|
|
2695
|
+
tx: {
|
|
2696
|
+
commands: params.commands,
|
|
2697
|
+
disclosedContracts: params.disclosedContracts,
|
|
2698
|
+
packageIdSelectionPreference: params.packageIdSelectionPreference,
|
|
2699
|
+
actAs: params.actAs,
|
|
2700
|
+
readAs: params.readAs,
|
|
2701
|
+
synchronizerId: params.synchronizerId
|
|
2702
|
+
}
|
|
2703
|
+
})
|
|
2704
|
+
});
|
|
2705
|
+
if (!response.ok) {
|
|
2706
|
+
const details = await this.parseErrorResponse(response);
|
|
2707
|
+
throw new Error(this.errorMessage(details, `Failed to estimate gas with status ${response.status}.`));
|
|
2708
|
+
}
|
|
2709
|
+
const data = await response.json();
|
|
2710
|
+
return {
|
|
2711
|
+
requires_gas: data?.requiresFee,
|
|
2712
|
+
can_execute: data?.canExecute,
|
|
2713
|
+
estimated_gas_amount: data?.estimatedFeeAmount,
|
|
2714
|
+
estimated_gas_asset: data?.estimatedFeeAsset
|
|
2715
|
+
};
|
|
2716
|
+
}
|
|
2625
2717
|
async executeTransaction(session, params) {
|
|
2626
2718
|
if (!session.ticketId) {
|
|
2627
2719
|
throw new Error("Ticket ID is required");
|
|
@@ -2637,7 +2729,8 @@ class Connection {
|
|
|
2637
2729
|
request_id: generateRequestId(),
|
|
2638
2730
|
command_id: params.command_id,
|
|
2639
2731
|
signature: params.signature,
|
|
2640
|
-
transaction_data: params.transaction_data
|
|
2732
|
+
transaction_data: params.transaction_data,
|
|
2733
|
+
deduplication_period: params.deduplication_period
|
|
2641
2734
|
})
|
|
2642
2735
|
});
|
|
2643
2736
|
if (response.status === 402) {
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Connection } from './connection';
|
|
2
|
-
import type { Holding, ActiveContract, TransferOptions, InstrumentSpec, RunTransactionResponse, TransactionPayload } from './types';
|
|
2
|
+
import type { Holding, ActiveContract, TransferOptions, InstrumentSpec, RunTransactionResponse, TransactionPayload, EstimatedGasResponse, DeduplicationPeriodInput } from './types';
|
|
3
3
|
import { MessageType, type Account } from './types';
|
|
4
4
|
export declare const DEFAULT_REQUEST_TIMEOUT_MS = 300000;
|
|
5
5
|
export type RequestFinishStatus = 'success' | 'rejected' | 'timeout' | 'error';
|
|
@@ -21,6 +21,7 @@ type SubmitOptions = {
|
|
|
21
21
|
requestLabel?: string;
|
|
22
22
|
estimateTraffic?: boolean;
|
|
23
23
|
executionMode?: 'async' | 'wait';
|
|
24
|
+
deduplicationPeriod?: DeduplicationPeriodInput;
|
|
24
25
|
};
|
|
25
26
|
export declare function generateRequestId(): string;
|
|
26
27
|
export declare class Provider {
|
|
@@ -48,6 +49,7 @@ export declare class Provider {
|
|
|
48
49
|
templateId?: string;
|
|
49
50
|
interfaceId?: string;
|
|
50
51
|
}): Promise<ActiveContract[]>;
|
|
52
|
+
estimateGas(payload: TransactionPayload): Promise<EstimatedGasResponse>;
|
|
51
53
|
submitTransaction(payload: TransactionPayload, options?: SubmitOptions): Promise<any>;
|
|
52
54
|
submitAndWaitForTransaction(payload: TransactionPayload, options?: SubmitOptions): Promise<any>;
|
|
53
55
|
transfer(recipient: string, amount: string | number, instrument?: InstrumentSpec, options?: TransferOptions & {
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAGd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EAGd,eAAe,EACf,cAAc,EACd,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,wBAAwB,EACzB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAGpD,eAAO,MAAM,0BAA0B,SAAS,CAAC;AACjD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;AAC/E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,mBAAmB,CAAC;IAC5B,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AACF,MAAM,MAAM,aAAa,GA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c,CAAC,OAAO,EAAE,GAAG;IAmBlC,UAAU,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;IAMhC,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAI9B,kBAAkB,CAAC,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAI/F,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKvE,iBAAiB,CACrB,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,GAAG,CAAC;IAaT,2BAA2B,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,GAAG,CAAC;IAaT,QAAQ,CACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GAAG,MAAM,EACvB,UAAU,CAAC,EAAE,cAAc,EAC3B,OAAO,CAAC,EAAE,eAAe,GAAG;QAAE,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;KAAE,GAC/D,OAAO,CAAC,GAAG,CAAC;IAwDT,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC;YAIlC,eAAe;IAa7B,OAAO,CAAC,WAAW;CA+GtB"}
|
package/dist/provider.js
CHANGED
|
@@ -73,18 +73,29 @@ export class Provider {
|
|
|
73
73
|
getActiveContracts(params) {
|
|
74
74
|
return this.connection.getActiveContracts(this.auth_token, params);
|
|
75
75
|
}
|
|
76
|
+
async estimateGas(payload) {
|
|
77
|
+
return this.connection.estimateGasForConnect(this.auth_token, payload);
|
|
78
|
+
}
|
|
76
79
|
// submit a transaction to be signed by the wallet to the websocket
|
|
77
80
|
async submitTransaction(payload, options) {
|
|
78
|
-
const requestPayload =
|
|
81
|
+
const requestPayload = {
|
|
82
|
+
...payload,
|
|
83
|
+
...(options?.deduplicationPeriod ? { deduplicationPeriod: toLedgerDeduplicationPeriod(options.deduplicationPeriod) } : {}),
|
|
84
|
+
};
|
|
85
|
+
const requestPayloadWithTraffic = options?.estimateTraffic ? { ...requestPayload, estimate_traffic: true } : requestPayload;
|
|
79
86
|
const executionMode = options?.executionMode;
|
|
80
87
|
const finalPayload = executionMode === 'wait'
|
|
81
|
-
? { ...
|
|
82
|
-
:
|
|
88
|
+
? { ...requestPayloadWithTraffic, execution_mode: 'wait' }
|
|
89
|
+
: requestPayloadWithTraffic;
|
|
83
90
|
return this.sendRequest(MessageType.RUN_TRANSACTION, finalPayload, options);
|
|
84
91
|
}
|
|
85
92
|
async submitAndWaitForTransaction(payload, options) {
|
|
86
|
-
const requestPayload =
|
|
87
|
-
|
|
93
|
+
const requestPayload = {
|
|
94
|
+
...payload,
|
|
95
|
+
...(options?.deduplicationPeriod ? { deduplicationPeriod: toLedgerDeduplicationPeriod(options.deduplicationPeriod) } : {}),
|
|
96
|
+
};
|
|
97
|
+
const requestPayloadWithTraffic = options?.estimateTraffic ? { ...requestPayload, estimate_traffic: true } : requestPayload;
|
|
98
|
+
return this.sendRequest(MessageType.RUN_TRANSACTION, { ...requestPayloadWithTraffic, execution_mode: 'wait' }, options);
|
|
88
99
|
}
|
|
89
100
|
async transfer(recipient, amount, instrument, options) {
|
|
90
101
|
const amountStr = typeof amount === 'number' ? amount.toString() : amount;
|
|
@@ -128,7 +139,12 @@ export class Provider {
|
|
|
128
139
|
actAs: preparedPayload.actAs,
|
|
129
140
|
readAs: preparedPayload.readAs,
|
|
130
141
|
synchronizerId: preparedPayload.synchronizerId,
|
|
131
|
-
}, {
|
|
142
|
+
}, {
|
|
143
|
+
requestTimeout,
|
|
144
|
+
message,
|
|
145
|
+
estimateTraffic,
|
|
146
|
+
deduplicationPeriod: options?.deduplicationPeriod,
|
|
147
|
+
});
|
|
132
148
|
}
|
|
133
149
|
// submit a raw message to be signed by the wallet to the websocket
|
|
134
150
|
async signMessage(message) {
|
|
@@ -247,3 +263,16 @@ export class Provider {
|
|
|
247
263
|
});
|
|
248
264
|
}
|
|
249
265
|
}
|
|
266
|
+
function toLedgerDeduplicationPeriod(input) {
|
|
267
|
+
if ('empty' in input) {
|
|
268
|
+
return { Empty: {} };
|
|
269
|
+
}
|
|
270
|
+
return {
|
|
271
|
+
DeduplicationDuration: {
|
|
272
|
+
value: {
|
|
273
|
+
seconds: input.seconds,
|
|
274
|
+
nanos: input.nanos ?? 0,
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
package/dist/server/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Provider } from '../provider';
|
|
2
|
-
import type { Network, TransactionPayload, PendingGasResponse } from '../types';
|
|
2
|
+
import type { Network, TransactionPayload, PendingGasResponse, EstimatedGasResponse } from '../types';
|
|
3
3
|
import { Signer } from './signer';
|
|
4
4
|
export declare class LoopSDK {
|
|
5
5
|
private signer?;
|
|
@@ -19,6 +19,7 @@ export declare class LoopSDK {
|
|
|
19
19
|
getProvider(): Provider;
|
|
20
20
|
executeTransaction(payload: TransactionPayload): Promise<any>;
|
|
21
21
|
checkDueGas(trackingId?: string): Promise<PendingGasResponse>;
|
|
22
|
+
estimateGas(payload: TransactionPayload): Promise<EstimatedGasResponse>;
|
|
22
23
|
payGas(trackingId: string): Promise<any>;
|
|
23
24
|
}
|
|
24
25
|
export declare const loop: LoopSDK;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAsB,MAAM,aAAa,CAAC;AAG3D,OAAO,KAAK,EAAE,OAAO,EAAyE,kBAAkB,EAAyD,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"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_id: preparedPayload.command_id,
|
|
113
113
|
transaction_data: preparedPayload.transaction_data,
|
|
114
114
|
signature: signedTransactionHash,
|
|
115
|
+
deduplication_period: payload.deduplicationPeriod,
|
|
115
116
|
});
|
|
116
117
|
return submissionResponse;
|
|
117
118
|
}
|
|
@@ -121,6 +122,12 @@ export class LoopSDK {
|
|
|
121
122
|
}
|
|
122
123
|
return await this.connection.getPendingGas(this.session.userApiKey, trackingId);
|
|
123
124
|
}
|
|
125
|
+
async estimateGas(payload) {
|
|
126
|
+
if (!this.connection || !this.session) {
|
|
127
|
+
throw new Error('Provider and session are required');
|
|
128
|
+
}
|
|
129
|
+
return await this.connection.estimateGas(this.session, payload);
|
|
130
|
+
}
|
|
124
131
|
async payGas(trackingId) {
|
|
125
132
|
if (!this.provider || !this.signer || !this.connection || !this.session) {
|
|
126
133
|
throw new Error('Provider and signer are required');
|
package/dist/server/signer.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/server/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/server/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,YAAY,CAAC;AAE/B,eAAO,MAAM,SAAS,GAAI,eAAe,MAAM,EAAE,SAAS,MAAM,KAAG,MAElE,CAAA;AAED,qBAAa,MAAM;IACf,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;gBAEZ,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAc3C,YAAY,IAAI,MAAM;IAItB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK;IAQzC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IASzC,UAAU,IAAI,MAAM;IAKpB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;CAa9D"}
|
package/dist/server/signer.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -56,6 +56,13 @@ export type TransactionPayload = {
|
|
|
56
56
|
actAs?: string[];
|
|
57
57
|
readAs?: string[];
|
|
58
58
|
synchronizerId?: string;
|
|
59
|
+
deduplicationPeriod?: DeduplicationPeriodInput;
|
|
60
|
+
};
|
|
61
|
+
export type DeduplicationPeriodInput = {
|
|
62
|
+
empty: true;
|
|
63
|
+
} | {
|
|
64
|
+
seconds: number;
|
|
65
|
+
nanos?: number;
|
|
59
66
|
};
|
|
60
67
|
export type PreparedTransferPayload = {
|
|
61
68
|
actAs: string[];
|
|
@@ -88,6 +95,7 @@ export type TransferOptions = {
|
|
|
88
95
|
message?: string;
|
|
89
96
|
executionMode?: 'async' | 'wait';
|
|
90
97
|
estimateTraffic?: boolean;
|
|
98
|
+
deduplicationPeriod?: DeduplicationPeriodInput;
|
|
91
99
|
};
|
|
92
100
|
export type InstrumentSpec = Instrument;
|
|
93
101
|
export interface Wallet {
|
|
@@ -112,6 +120,7 @@ export type ExecuteSubmissionResquest = {
|
|
|
112
120
|
command_id: string;
|
|
113
121
|
transaction_data: string;
|
|
114
122
|
signature: string;
|
|
123
|
+
deduplication_period?: DeduplicationPeriodInput;
|
|
115
124
|
};
|
|
116
125
|
export type PendingGasResponse = {
|
|
117
126
|
pending: boolean;
|
|
@@ -122,4 +131,10 @@ export type PendingGasResponse = {
|
|
|
122
131
|
expires_at?: string;
|
|
123
132
|
request_id?: string;
|
|
124
133
|
};
|
|
134
|
+
export type EstimatedGasResponse = {
|
|
135
|
+
requires_gas: boolean;
|
|
136
|
+
can_execute: boolean;
|
|
137
|
+
estimated_gas_amount?: string;
|
|
138
|
+
estimated_gas_asset?: string;
|
|
139
|
+
};
|
|
125
140
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|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