@florent-uzio/custody 2.2.0 → 2.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.
Files changed (44) hide show
  1. package/dist/index.d.ts +2 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +2 -0
  4. package/dist/index.js.map +1 -1
  5. package/dist/models/custody-types.d.ts +565 -338
  6. package/dist/models/custody-types.d.ts.map +1 -1
  7. package/dist/ripple-custody.d.ts +55 -10
  8. package/dist/ripple-custody.d.ts.map +1 -1
  9. package/dist/ripple-custody.js +54 -21
  10. package/dist/ripple-custody.js.map +1 -1
  11. package/dist/services/xrpl/index.d.ts +2 -0
  12. package/dist/services/xrpl/index.d.ts.map +1 -1
  13. package/dist/services/xrpl/index.js +2 -4
  14. package/dist/services/xrpl/index.js.map +1 -1
  15. package/dist/services/xrpl/xrpl.adapters.d.ts +23 -5
  16. package/dist/services/xrpl/xrpl.adapters.d.ts.map +1 -1
  17. package/dist/services/xrpl/xrpl.adapters.js +244 -161
  18. package/dist/services/xrpl/xrpl.adapters.js.map +1 -1
  19. package/dist/services/xrpl/xrpl.builders.d.ts +22 -0
  20. package/dist/services/xrpl/xrpl.builders.d.ts.map +1 -0
  21. package/dist/services/xrpl/xrpl.builders.js +109 -0
  22. package/dist/services/xrpl/xrpl.builders.js.map +1 -0
  23. package/dist/services/xrpl/xrpl.crypto.d.ts +6 -0
  24. package/dist/services/xrpl/xrpl.crypto.d.ts.map +1 -0
  25. package/dist/services/xrpl/xrpl.crypto.js +19 -0
  26. package/dist/services/xrpl/xrpl.crypto.js.map +1 -0
  27. package/dist/services/xrpl/xrpl.http-adapters.d.ts.map +1 -1
  28. package/dist/services/xrpl/xrpl.http-adapters.js +5 -0
  29. package/dist/services/xrpl/xrpl.http-adapters.js.map +1 -1
  30. package/dist/services/xrpl/xrpl.ports.d.ts +7 -1
  31. package/dist/services/xrpl/xrpl.ports.d.ts.map +1 -1
  32. package/dist/services/xrpl/xrpl.service.d.ts +79 -36
  33. package/dist/services/xrpl/xrpl.service.d.ts.map +1 -1
  34. package/dist/services/xrpl/xrpl.service.js +182 -182
  35. package/dist/services/xrpl/xrpl.service.js.map +1 -1
  36. package/dist/services/xrpl/xrpl.types.d.ts +112 -7
  37. package/dist/services/xrpl/xrpl.types.d.ts.map +1 -1
  38. package/dist/services/xrpl/xrpl.types.js +0 -28
  39. package/dist/services/xrpl/xrpl.types.js.map +1 -1
  40. package/dist/services/xrpl/xrpl.validators.d.ts +23 -0
  41. package/dist/services/xrpl/xrpl.validators.d.ts.map +1 -0
  42. package/dist/services/xrpl/xrpl.validators.js +43 -0
  43. package/dist/services/xrpl/xrpl.validators.js.map +1 -0
  44. package/package.json +1 -1
@@ -0,0 +1,19 @@
1
+ import { createPublicKey } from "crypto";
2
+ /**
3
+ * Compresses a base64-encoded SPKI/DER secp256k1 public key to its compressed hex form.
4
+ * Uses Node.js built-in crypto via JWK export to extract the raw EC point coordinates.
5
+ */
6
+ export function compressPublicKey(base64PublicKey) {
7
+ const publicKey = createPublicKey({
8
+ key: Buffer.from(base64PublicKey, "base64"),
9
+ format: "der",
10
+ type: "spki",
11
+ });
12
+ const jwk = publicKey.export({ format: "jwk" });
13
+ const x = Buffer.from(jwk.x, "base64url");
14
+ const y = Buffer.from(jwk.y, "base64url");
15
+ const lastByte = y[y.length - 1];
16
+ const prefix = lastByte % 2 === 0 ? "02" : "03";
17
+ return (prefix + x.toString("hex")).toUpperCase();
18
+ }
19
+ //# sourceMappingURL=xrpl.crypto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"xrpl.crypto.js","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.crypto.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AAExC;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,eAAuB;IACvD,MAAM,SAAS,GAAG,eAAe,CAAC;QAChC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC;QAC3C,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,MAAM;KACb,CAAC,CAAA;IAEF,MAAM,GAAG,GAAG,SAAS,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAA;IAC/C,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,EAAE,WAAW,CAAC,CAAA;IAC1C,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAE,EAAE,WAAW,CAAC,CAAA;IAC1C,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAE,CAAA;IACjC,MAAM,MAAM,GAAG,QAAQ,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAC/C,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;AACnD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.http-adapters.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.http-adapters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAI9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,CAsCpE"}
1
+ {"version":3,"file":"xrpl.http-adapters.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.http-adapters.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAS9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEhD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,CA4CpE"}
@@ -31,6 +31,11 @@ export function createHttpPorts(transport) {
31
31
  submitIntent(body) {
32
32
  return transport.post(URLs.intents, body);
33
33
  },
34
+ dryRunIntent(body) {
35
+ return transport.post(URLs.intentsDryRun, body, undefined, {
36
+ sign: false,
37
+ });
38
+ },
34
39
  getManifest(domainId, accountId, manifestId) {
35
40
  return transport.get(URLs.accountManifest, {
36
41
  domainId,
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.http-adapters.js","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.http-adapters.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AAOnE;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,SAAyB;IACvD,OAAO;QACL,KAAK,CAAC,cAAc,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE;YACrC,MAAM,EAAE,GAAG,MAAM,SAAS,CAAC,GAAG,CAAmB,IAAI,CAAC,EAAE,CAAC,CAAA;YACzD,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,oBAAoB,CAAC,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAA;YACpE,MAAM,OAAO,GAAG,MAAM,oBAAoB,CAAC,SAAS,EAAE,OAAO,EAAE;gBAC7D,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,CAAC,CAAA;YACF,OAAO;gBACL,QAAQ;gBACR,MAAM;gBACN,SAAS,EAAE,OAAO,CAAC,SAAS;gBAC5B,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAA;QACH,CAAC;QAED,Y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Y,CAAC;YACrB,MAAM,EAAE,8EAA8E;SACvF,CAAC,CAAA;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;IAC5B,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,CAAC;QAChB,MAAM,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,4BAA4B,EAAE,CAAC,CAAA;IAClE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,aAAa,EAAE,EAAE,EAAE,CAAC;QAC9B,MAAM,IAAI,YAAY,CAAC,EAAE,MAAM,EAAE,sCAAsC,EAAE,CAAC,CAAA;IAC5E,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EAAE,EAAE,CAAA;AACjE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import type { XrplLedgerId } from "../../models/ledger-ids.js";
2
2
  import type { Core_ApiAccount, Core_ApiManifest } from "../accounts/accounts.types.js";
3
- import type { Core_IntentResponse, Core_ProposeIntentBody } from "../intents/intents.types.js";
3
+ import type { Core_IntentDryRunRequest, Core_IntentDryRunResponse, Core_IntentResponse, Core_ProposeIntentBody } from "../intents/intents.types.js";
4
4
  import type { IntentContext } from "./xrpl.types.js";
5
5
  /**
6
6
  * I/O ports for XrplService.
@@ -22,6 +22,12 @@ export interface XrplPorts {
22
22
  * Wraps POST /v1/intents.
23
23
  */
24
24
  submitIntent(body: Core_ProposeIntentBody): Promise<Core_IntentResponse>;
25
+ /**
26
+ * Dry-runs an intent and returns the resolved estimate (including
27
+ * `batchSigningData` for Batch operations).
28
+ * Wraps POST /v1/intents/dry-run.
29
+ */
30
+ dryRunIntent(body: Core_IntentDryRunRequest): Promise<Core_IntentDryRunResponse>;
25
31
  /**
26
32
  * Retrieves a manifest for polling signature availability.
27
33
  * Wraps GET /v1/domains/{domainId}/accounts/{accountId}/manifests/{manifestId}.
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.ports.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACtF,OAAO,KAAK,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;KAAE,GACpD,OAAO,CAAC,aAAa,CAAC,CAAA;IAEzB;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAExE;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAE/F;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;CAC1E"}
1
+ {"version":3,"file":"xrpl.ports.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.ports.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAA;AACtF,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB;;;OAGG;IACH,cAAc,CACZ,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,YAAY,CAAA;KAAE,GACpD,OAAO,CAAC,aAAa,CAAC,CAAA;IAEzB;;;OAGG;IACH,YAAY,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAA;IAExE;;;;OAIG;IACH,YAAY,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAEhF;;;OAGG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAE/F;;;OAGG;IACH,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,CAAA;CAC1E"}
@@ -1,7 +1,7 @@
1
1
  import { type SubmittableTransaction } from "xrpl";
2
2
  import type { Core_IntentResponse } from "../intents/intents.types.js";
3
3
  import type { XrplPorts } from "./xrpl.ports.js";
4
- import type { Core_XrplOperation, RawSignAndWaitOptions, RawSignAndWaitResult, XrplIntentOptions } from "./xrpl.types.js";
4
+ import type { BatchPayloadInput, Core_ApiBatchSigningData, Core_BatchSigner, Core_XrplOperation, GetBatchSignatureParams, RawSignAndWaitOptions, RawSignAndWaitResult, SignBatchPayloadHandle, SignBatchPayloadOptions, SignBatchPayloadResult, WaitForSignatureOptions, XrplIntentOptions } from "./xrpl.types.js";
5
5
  export declare class XrplService {
6
6
  private readonly ports;
7
7
  constructor(ports: XrplPorts);
@@ -57,68 +57,111 @@ export declare class XrplService {
57
57
  */
58
58
  rawSignAndWait(xrplTransaction: SubmittableTransaction, options?: RawSignAndWaitOptions): Promise<RawSignAndWaitResult>;
59
59
  /**
60
- * Proposes a raw sign intent for a Batch transaction envelope for a single
61
- * inner account. The batch envelope (`flags` + all inner transaction hashes)
62
- * is encoded using `encodeForSigningBatch` and signed with the key of the
63
- * specified `signerAddress`.
60
+ * Step 1 of the XLS-56 Batch flow — dry-runs a Batch transaction order and
61
+ * returns the canonical signing data. Each participant must sign
62
+ * `signingPayload` with their own XRPL key; collect those signatures and pass
63
+ * them to `proposeBatch` (Step 3).
64
64
  *
65
- * All signers sign the same envelope data. Call this once per inner account
66
- * that is managed by this custody instance.
65
+ * Use `signBatchPayloadAndWait` to sign for inner accounts managed by this
66
+ * custody instance.
67
67
  *
68
- * @param batch - The autofilled Batch transaction (with all inner transactions)
69
- * @param signerAddress - The XRPL address of the inner account to sign for
70
- * @param options - Optional configuration for the raw sign intent
71
- * @returns The proposed intent response
72
- * @throws {CustodyError} If signerAddress is not in the batch, or the account is not found
68
+ * @param payload - Submitter address, execution mode, and inner entries
69
+ * @param options - Optional configuration for the dry-run intent
70
+ * @returns The batch signing data (`signingPayload`, `signingPayloadHash`, resolved transactions)
71
+ * @throws {CustodyError} If the dry run fails or does not return batch signing data
73
72
  */
73
+ dryRunBatch(payload: BatchPayloadInput, options?: XrplIntentOptions): Promise<Core_ApiBatchSigningData>;
74
74
  /**
75
- * Signs a Batch transaction envelope for a single inner account and waits
76
- * for the manifest signature.
75
+ * Step 2 of the XLS-56 Batch flow signs the `signingPayload` returned by
76
+ * `dryRunBatch` for a single inner account managed by this custody instance,
77
+ * and waits for the manifest signature.
77
78
  *
78
- * All signers sign the same envelope (`flags` + all inner transaction hashes).
79
- * Call this method once per inner account managed by this custody instance.
80
- * Inner accounts on other custody instances sign independently with their own SDK.
79
+ * Inner accounts on other custody instances (or non-custody participants)
80
+ * sign independently with their own keys.
81
81
  *
82
- * @param batch - The autofilled Batch transaction (with all inner transactions)
83
- * @param signerAddress - The XRPL address of the inner account to sign for
82
+ * @param signingPayload - Hex-encoded `signingPayload` from `dryRunBatch` response
83
+ * @param signerAddress - XRPL address of the inner account to sign for
84
84
  * @param options - Optional configuration for the raw sign intent and polling
85
- * @returns The signature and signing public key in uppercase hex
86
- * @throws {CustodyError} If signerAddress is not in the batch, the account is not found,
87
- * or the manifest signature is not available after maximum retries
85
+ * @returns The signature, signing public key, and pre-built BatchSigner shapes
86
+ * @throws {CustodyError} If the signer account is not found, or the signature is not
87
+ * available after maximum retries
88
88
  */
89
+ signBatchPayloadAndWait(signingPayload: string, signerAddress: string, options?: SignBatchPayloadOptions): Promise<SignBatchPayloadResult>;
89
90
  /**
90
- * Resolves the intent context for an inner batch signer.
91
- * When `accountId` and `ledgerId` are provided in options, skips the address lookup.
92
- * @private
91
+ * Step 2 of the XLS-56 Batch flow (non-blocking variant) proposes the raw
92
+ * sign intent for the `signingPayload` returned by `dryRunBatch` for a single
93
+ * inner account managed by this custody instance, then returns immediately
94
+ * without waiting for the manifest signature.
95
+ *
96
+ * Use this when the custody instance operator approves signatures
97
+ * out-of-band: persist the returned `SignBatchPayloadHandle` and pass it to
98
+ * `getBatchSignature` later (possibly from another process) to fetch the
99
+ * signature once it is available.
100
+ *
101
+ * @param signingPayload - Hex-encoded `signingPayload` from `dryRunBatch` response
102
+ * @param signerAddress - XRPL address of the inner account to sign for
103
+ * @param options - Optional configuration for the raw sign intent
104
+ * @returns A handle with the manifest ID and the fields needed to retrieve the signature
105
+ * @throws {CustodyError} If the signer account is not found
93
106
  */
107
+ signBatchPayload(signingPayload: string, signerAddress: string, options?: SignBatchPayloadOptions): Promise<SignBatchPayloadHandle>;
94
108
  /**
95
- * Validates that the signer address is involved in at least one inner transaction.
96
- * @private
109
+ * Retrieves the signature for a payload proposed via `signBatchPayload`,
110
+ * building the BatchSigner shapes when it is available.
111
+ *
112
+ * Performs a single fetch by default (`maxRetries: 1`); the operator may not
113
+ * have approved the signature yet, in which case `undefined` is returned and
114
+ * the caller decides when to retry. Pass `maxRetries`/`intervalMs` to opt into
115
+ * light polling.
116
+ *
117
+ * @param params - Fields from the `SignBatchPayloadHandle` (a handle may be passed directly)
118
+ * @param options - Optional polling configuration (defaults to a single attempt)
119
+ * @returns The signature and BatchSigner shapes, or `undefined` if not yet signed
120
+ * @throws {CustodyError} On any non-404 error fetching the manifest
97
121
  */
98
- private validateBatchSigner;
122
+ getBatchSignature(params: GetBatchSignatureParams, options?: WaitForSignatureOptions): Promise<SignBatchPayloadResult | undefined>;
99
123
  /**
100
- * Encodes a Batch transaction envelope for signing.
101
- * Computes txIDs from inner transactions and encodes with `encodeForSigningBatch`.
124
+ * Step 3 of the XLS-56 Batch flow submits the Batch as a real intent with
125
+ * collected `batchSigners`. The payload must match the one used for
126
+ * `dryRunBatch`; reuse `options.payloadId` and `options.requestId` if you
127
+ * need referential identity with the dry-run.
128
+ *
129
+ * @param payload - Same submitter, execution mode, and entries as the dry-run
130
+ * @param batchSigners - Signatures collected in Step 2 (one per participant)
131
+ * @param options - Optional configuration for the intent
132
+ * @returns The proposed intent response
133
+ * @throws {CustodyError} If validation fails or the submitter account is not found
134
+ */
135
+ proposeBatch(payload: BatchPayloadInput, batchSigners: Core_BatchSigner[], options?: XrplIntentOptions): Promise<Core_IntentResponse>;
136
+ /**
137
+ * Resolves the intent context for an inner-batch signer. Skips the address
138
+ * lookup when `accountId` and `ledgerId` are provided.
102
139
  * @private
103
140
  */
104
- private encodeBatchForSigning;
141
+ private resolveSignerContext;
105
142
  /**
106
143
  * Proposes a raw sign intent with base64-encoded bytes.
107
- * Shared by rawSign, rawSignAndWait, and signBytesAndWait.
144
+ * Shared by rawSign, rawSignAndWait, and signBatchPayloadAndWait.
108
145
  * @private
109
146
  */
110
147
  private proposeRawSignIntent;
111
148
  /**
112
149
  * Polls the manifest until a signature is available, then returns it as uppercase hex.
113
- * Handles both the manifest not existing yet (404) and the manifest existing
114
- * but not yet having a signature.
150
+ * Throws if the signature is still unavailable after the maximum retries.
115
151
  * @private
116
152
  */
117
153
  private waitForManifestSignature;
118
154
  /**
119
- * Builds an XRPL intent body.
155
+ * Polls the manifest for a signature, returning it as uppercase hex once
156
+ * available, or `undefined` if still unavailable after the maximum retries.
157
+ * @private
158
+ */
159
+ private pollManifestSignature;
160
+ /**
161
+ * Fetches the manifest once and returns its signature as uppercase hex, or
162
+ * `undefined` if the manifest does not exist yet (404) or has no signature.
120
163
  * @private
121
164
  */
122
- private buildTransactionIntent;
165
+ private fetchManifestSignature;
123
166
  }
124
167
  //# sourceMappingURL=xrpl.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.service.d.ts","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,sBAAsB,EAC5B,MAAM,MAAM,CAAA;AAIb,OAAO,KAAK,EAAE,mBAAmB,EAA0B,MAAM,6BAA6B,CAAA;AAC9F,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,KAAK,EAEV,kBAAkB,EAElB,qBAAqB,EACrB,oBAAoB,EAEpB,iBAAiB,EAClB,MAAM,iBAAiB,CAAA;AAExB,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,SAAS;IAE7C;;;;;;;;;;;;;;OAcG;IACU,aAAa,CACxB,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,kBAAkB,CAAA;KAAE,EAC1D,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,mBAAmB,CAAC;IAe/B;;;;;;OAMG;IACU,YAAY,CAAC,EACxB,QAAQ,EACR,SAAS,GACV,EAAE;QACD,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;KAClB,GAAG,OAAO,CAAC,MAAM,CAAC;IAoBnB;;;;;;OAMG;IACU,OAAO,CAClB,eAAe,EAAE,sB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