@settlemint/dalp-sdk 3.1.4-main.32596885813 → 3.1.4-main.32597092654
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/auth.js
CHANGED
|
@@ -102,7 +102,7 @@ function createCookieStoreFetch(cookieStore, fetchImpl = globalThis.fetch) {
|
|
|
102
102
|
// package.json
|
|
103
103
|
var package_default = {
|
|
104
104
|
name: "@settlemint/dalp-sdk",
|
|
105
|
-
version: "3.1.4-main.
|
|
105
|
+
version: "3.1.4-main.32597092654",
|
|
106
106
|
private: false,
|
|
107
107
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
108
108
|
homepage: "https://settlemint.com",
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,9 @@ export interface WaitForTransactionStatus {
|
|
|
15
15
|
readonly contractError?: WaitForTransactionContractError | null;
|
|
16
16
|
readonly result?: Readonly<Record<string, unknown>>;
|
|
17
17
|
}
|
|
18
|
+
export interface WaitForTransactionSuccess extends WaitForTransactionStatus {
|
|
19
|
+
readonly status: "COMPLETED";
|
|
20
|
+
}
|
|
18
21
|
export interface WaitForTransactionOptions {
|
|
19
22
|
readonly timeoutMs?: number;
|
|
20
23
|
readonly pollIntervalMs?: number;
|
|
@@ -39,4 +42,4 @@ export declare class DalpTransactionWaitError extends Error {
|
|
|
39
42
|
}
|
|
40
43
|
export declare const isDalpTransactionWaitError: (error: unknown) => error is DalpTransactionWaitError;
|
|
41
44
|
/** Poll transaction status until a terminal verdict, timeout, or abort. */
|
|
42
|
-
export declare function waitForTransaction(client: Client, transactionId: string, options?: WaitForTransactionOptions): Promise<
|
|
45
|
+
export declare function waitForTransaction(client: Client, transactionId: string, options?: WaitForTransactionOptions): Promise<WaitForTransactionSuccess>;
|
|
@@ -5,8 +5,8 @@ import"./chunk-w21k7p99.js";
|
|
|
5
5
|
import"./chunk-0zy0nr1x.js";
|
|
6
6
|
|
|
7
7
|
// src/wait-for-transaction.ts
|
|
8
|
-
var terminalStates = new Set(["COMPLETED", "FAILED", "DEAD_LETTER", "CANCELLED"]);
|
|
9
8
|
var failedStates = new Set(["FAILED", "DEAD_LETTER", "CANCELLED"]);
|
|
9
|
+
var isWaitForTransactionSuccess = (status) => status.status === "COMPLETED";
|
|
10
10
|
|
|
11
11
|
class DalpTransactionWaitError extends Error {
|
|
12
12
|
code = "sdk.transaction.WAIT_FAILED";
|
|
@@ -95,7 +95,7 @@ async function waitForTransaction(client, transactionId, options = {}) {
|
|
|
95
95
|
if (failedStates.has(lastStatus.status)) {
|
|
96
96
|
throw new DalpTransactionWaitError(transactionId, "terminal-failure", lastStatus);
|
|
97
97
|
}
|
|
98
|
-
if (
|
|
98
|
+
if (isWaitForTransactionSuccess(lastStatus)) {
|
|
99
99
|
return lastStatus;
|
|
100
100
|
}
|
|
101
101
|
try {
|
package/package.json
CHANGED