@florent-uzio/custody 2.1.0 → 2.3.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 (53) 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/namespaces/intents.d.ts.map +1 -1
  8. package/dist/namespaces/intents.js +31 -36
  9. package/dist/namespaces/intents.js.map +1 -1
  10. package/dist/ripple-custody.d.ts +55 -10
  11. package/dist/ripple-custody.d.ts.map +1 -1
  12. package/dist/ripple-custody.js +54 -21
  13. package/dist/ripple-custody.js.map +1 -1
  14. package/dist/services/intents/intents.types.d.ts +5 -10
  15. package/dist/services/intents/intents.types.d.ts.map +1 -1
  16. package/dist/services/xrpl/index.d.ts +1 -0
  17. package/dist/services/xrpl/index.d.ts.map +1 -1
  18. package/dist/services/xrpl/index.js +1 -4
  19. package/dist/services/xrpl/index.js.map +1 -1
  20. package/dist/services/xrpl/xrpl.adapters.d.ts +23 -5
  21. package/dist/services/xrpl/xrpl.adapters.d.ts.map +1 -1
  22. package/dist/services/xrpl/xrpl.adapters.js +244 -161
  23. package/dist/services/xrpl/xrpl.adapters.js.map +1 -1
  24. package/dist/services/xrpl/xrpl.builders.d.ts +22 -0
  25. package/dist/services/xrpl/xrpl.builders.d.ts.map +1 -0
  26. package/dist/services/xrpl/xrpl.builders.js +107 -0
  27. package/dist/services/xrpl/xrpl.builders.js.map +1 -0
  28. package/dist/services/xrpl/xrpl.crypto.d.ts +6 -0
  29. package/dist/services/xrpl/xrpl.crypto.d.ts.map +1 -0
  30. package/dist/services/xrpl/xrpl.crypto.js +19 -0
  31. package/dist/services/xrpl/xrpl.crypto.js.map +1 -0
  32. package/dist/services/xrpl/xrpl.http-adapters.d.ts.map +1 -1
  33. package/dist/services/xrpl/xrpl.http-adapters.js +5 -0
  34. package/dist/services/xrpl/xrpl.http-adapters.js.map +1 -1
  35. package/dist/services/xrpl/xrpl.ports.d.ts +7 -1
  36. package/dist/services/xrpl/xrpl.ports.d.ts.map +1 -1
  37. package/dist/services/xrpl/xrpl.service.d.ts +79 -36
  38. package/dist/services/xrpl/xrpl.service.d.ts.map +1 -1
  39. package/dist/services/xrpl/xrpl.service.js +178 -182
  40. package/dist/services/xrpl/xrpl.service.js.map +1 -1
  41. package/dist/services/xrpl/xrpl.types.d.ts +108 -7
  42. package/dist/services/xrpl/xrpl.types.d.ts.map +1 -1
  43. package/dist/services/xrpl/xrpl.types.js +0 -28
  44. package/dist/services/xrpl/xrpl.types.js.map +1 -1
  45. package/package.json +2 -1
  46. package/dist/main.d.ts +0 -2
  47. package/dist/main.d.ts.map +0 -1
  48. package/dist/main.helpers.d.ts +0 -2
  49. package/dist/main.helpers.d.ts.map +0 -1
  50. package/dist/main.helpers.js +0 -99
  51. package/dist/main.helpers.js.map +0 -1
  52. package/dist/main.js +0 -41
  53. package/dist/main.js.map +0 -1
@@ -1,10 +1,11 @@
1
- import { createPublicKey } from "crypto";
2
1
  import dayjs from "dayjs";
3
2
  import { v7 as uuidv7 } from "uuid";
4
- import { encodeForSigning, encodeForSigningBatch, hashes, isValidAddress, } from "xrpl";
3
+ import { encodeForSigning, isValidAddress } from "xrpl";
5
4
  import { sleep } from "../../helpers/async/async.js";
6
5
  import { isUndefined } from "../../helpers/index.js";
7
6
  import { CustodyError } from "../../models/index.js";
7
+ import { buildBatchOperation, buildDryRunBody, buildSignBatchPayloadResult, buildTransactionIntent, } from "./xrpl.builders.js";
8
+ import { compressPublicKey } from "./xrpl.crypto.js";
8
9
  export class XrplService {
9
10
  ports;
10
11
  constructor(ports) {
@@ -30,7 +31,7 @@ export class XrplService {
30
31
  domainId: options.domainId,
31
32
  ledgerId: options.ledgerId,
32
33
  });
33
- const intent = this.buildTransactionIntent({
34
+ const intent = buildTransactionIntent({
34
35
  operation: params.operation,
35
36
  context,
36
37
  options,
@@ -115,137 +116,165 @@ export class XrplService {
115
116
  };
116
117
  }
117
118
  /**
118
- * Proposes a raw sign intent for a Batch transaction envelope for a single
119
- * inner account. The batch envelope (`flags` + all inner transaction hashes)
120
- * is encoded using `encodeForSigningBatch` and signed with the key of the
121
- * specified `signerAddress`.
119
+ * Step 1 of the XLS-56 Batch flow — dry-runs a Batch transaction order and
120
+ * returns the canonical signing data. Each participant must sign
121
+ * `signingPayload` with their own XRPL key; collect those signatures and pass
122
+ * them to `proposeBatch` (Step 3).
122
123
  *
123
- * All signers sign the same envelope data. Call this once per inner account
124
- * that is managed by this custody instance.
124
+ * Use `signBatchPayloadAndWait` to sign for inner accounts managed by this
125
+ * custody instance.
125
126
  *
126
- * @param batch - The autofilled Batch transaction (with all inner transactions)
127
- * @param signerAddress - The XRPL address of the inner account to sign for
128
- * @param options - Optional configuration for the raw sign intent
129
- * @returns The proposed intent response
130
- * @throws {CustodyError} If signerAddress is not in the batch, or the account is not found
127
+ * @param payload - Submitter address, execution mode, and inner entries
128
+ * @param options - Optional configuration for the dry-run intent
129
+ * @returns The batch signing data (`signingPayload`, `signingPayloadHash`, resolved transactions)
130
+ * @throws {CustodyError} If the dry run fails or does not return batch signing data
131
131
  */
132
- // public async rawSignInnerBatch(
133
- // batch: Batch,
134
- // signerAddress: string,
135
- // options: RawSignInnerBatchOptions = {},
136
- // ): Promise<Core_IntentResponse> {
137
- // this.validateBatchSigner(batch, signerAddress)
138
- // const context = await this.resolveInnerBatchContext(signerAddress, options)
139
- // const base64Encoded = this.encodeBatchForSigning(batch)
140
- // const { intentResponse } = await this.proposeRawSignIntent(base64Encoded, context, options)
141
- // return intentResponse
142
- // }
132
+ async dryRunBatch(payload, options = {}) {
133
+ const context = await this.ports.resolveContext(payload.Account, {
134
+ domainId: options.domainId,
135
+ });
136
+ const operation = buildBatchOperation(payload, []);
137
+ const body = buildDryRunBody(operation, context, options);
138
+ const response = await this.ports.dryRunIntent(body);
139
+ if (response.type !== "v0_CreateTransactionOrder") {
140
+ throw new CustodyError({
141
+ reason: `Unexpected dry-run response type: ${response.type}`,
142
+ });
143
+ }
144
+ if (!response.success) {
145
+ throw new CustodyError({
146
+ reason: `Batch dry run failed: ${response.errors?.join(", ") ?? "unknown error"}`,
147
+ });
148
+ }
149
+ if (response.estimate.type !== "XRPL" || !response.estimate.batchSigningData) {
150
+ throw new CustodyError({
151
+ reason: "Dry run did not return batchSigningData — confirm the operation type is Batch",
152
+ });
153
+ }
154
+ return response.estimate.batchSigningData;
155
+ }
143
156
  /**
144
- * Signs a Batch transaction envelope for a single inner account and waits
145
- * for the manifest signature.
157
+ * Step 2 of the XLS-56 Batch flow signs the `signingPayload` returned by
158
+ * `dryRunBatch` for a single inner account managed by this custody instance,
159
+ * and waits for the manifest signature.
146
160
  *
147
- * All signers sign the same envelope (`flags` + all inner transaction hashes).
148
- * Call this method once per inner account managed by this custody instance.
149
- * Inner accounts on other custody instances sign independently with their own SDK.
161
+ * Inner accounts on other custody instances (or non-custody participants)
162
+ * sign independently with their own keys.
150
163
  *
151
- * @param batch - The autofilled Batch transaction (with all inner transactions)
152
- * @param signerAddress - The XRPL address of the inner account to sign for
164
+ * @param signingPayload - Hex-encoded `signingPayload` from `dryRunBatch` response
165
+ * @param signerAddress - XRPL address of the inner account to sign for
153
166
  * @param options - Optional configuration for the raw sign intent and polling
154
- * @returns The signature and signing public key in uppercase hex
155
- * @throws {CustodyError} If signerAddress is not in the batch, the account is not found,
156
- * or the manifest signature is not available after maximum retries
167
+ * @returns The signature, signing public key, and pre-built BatchSigner shapes
168
+ * @throws {CustodyError} If the signer account is not found, or the signature is not
169
+ * available after maximum retries
157
170
  */
158
- // public async rawSignInnerBatchAndWait(
159
- // batch: Batch,
160
- // signerAddress: string,
161
- // options: RawSignInnerBatchOptions = {},
162
- // ): Promise<RawSignInnerBatchAndWaitResult> {
163
- // this.validateBatchSigner(batch, signerAddress)
164
- // const context = await this.resolveInnerBatchContext(signerAddress, options)
165
- // const signingPubKey = await this.getPublicKey({
166
- // domainId: context.domainId,
167
- // accountId: context.accountId,
168
- // })
169
- // const base64Encoded = this.encodeBatchForSigning(batch)
170
- // const { payloadId } = await this.proposeRawSignIntent(base64Encoded, context, options)
171
- // const signature = await this.waitForManifestSignature(
172
- // context.domainId,
173
- // context.accountId,
174
- // payloadId,
175
- // options.polling,
176
- // )
177
- // return {
178
- // signature,
179
- // signingPubKey,
180
- // batchSigner: {
181
- // BatchSigner: {
182
- // Account: signerAddress,
183
- // SigningPubKey: signingPubKey,
184
- // TxnSignature: signature,
185
- // },
186
- // },
187
- // custodyBatchSigner: {
188
- // account: signerAddress,
189
- // signingPubKey,
190
- // txnSignature: signature,
191
- // },
192
- // }
193
- // }
171
+ async signBatchPayloadAndWait(signingPayload, signerAddress, options = {}) {
172
+ const handle = await this.signBatchPayload(signingPayload, signerAddress, options);
173
+ const signature = await this.waitForManifestSignature(handle.domainId, handle.accountId, handle.payloadId, options.polling);
174
+ return buildSignBatchPayloadResult(handle, signature);
175
+ }
194
176
  /**
195
- * Resolves the intent context for an inner batch signer.
196
- * When `accountId` and `ledgerId` are provided in options, skips the address lookup.
197
- * @private
177
+ * Step 2 of the XLS-56 Batch flow (non-blocking variant) proposes the raw
178
+ * sign intent for the `signingPayload` returned by `dryRunBatch` for a single
179
+ * inner account managed by this custody instance, then returns immediately
180
+ * without waiting for the manifest signature.
181
+ *
182
+ * Use this when the custody instance operator approves signatures
183
+ * out-of-band: persist the returned `SignBatchPayloadHandle` and pass it to
184
+ * `getBatchSignature` later (possibly from another process) to fetch the
185
+ * signature once it is available.
186
+ *
187
+ * @param signingPayload - Hex-encoded `signingPayload` from `dryRunBatch` response
188
+ * @param signerAddress - XRPL address of the inner account to sign for
189
+ * @param options - Optional configuration for the raw sign intent
190
+ * @returns A handle with the manifest ID and the fields needed to retrieve the signature
191
+ * @throws {CustodyError} If the signer account is not found
198
192
  */
199
- // private async resolveInnerBatchContext(
200
- // signerAddress: string,
201
- // options: RawSignInnerBatchOptions,
202
- // ): Promise<IntentContext> {
203
- // if (options.accountId && options.ledgerId) {
204
- // const fullContext = await this.ports.resolveContext(signerAddress, {
205
- // domainId: options.domainId,
206
- // ledgerId: options.ledgerId,
207
- // })
208
- // return {
209
- // domainId: fullContext.domainId,
210
- // userId: fullContext.userId,
211
- // accountId: options.accountId,
212
- // ledgerId: options.ledgerId,
213
- // address: signerAddress,
214
- // }
215
- // }
216
- // return this.ports.resolveContext(signerAddress, {
217
- // domainId: options.domainId,
218
- // ledgerId: options.ledgerId,
219
- // })
220
- // }
193
+ async signBatchPayload(signingPayload, signerAddress, options = {}) {
194
+ if (!isValidAddress(signerAddress)) {
195
+ throw new CustodyError({ reason: `Invalid signerAddress: ${signerAddress}` });
196
+ }
197
+ const context = await this.resolveSignerContext(signerAddress, options);
198
+ const signingPubKey = await this.getPublicKey({
199
+ domainId: context.domainId,
200
+ accountId: context.accountId,
201
+ });
202
+ const base64Encoded = Buffer.from(signingPayload, "hex").toString("base64");
203
+ const { intentResponse, payloadId } = await this.proposeRawSignIntent(base64Encoded, context, options);
204
+ return {
205
+ payloadId,
206
+ domainId: context.domainId,
207
+ accountId: context.accountId,
208
+ signerAddress,
209
+ signingPubKey,
210
+ intentResponse,
211
+ };
212
+ }
221
213
  /**
222
- * Validates that the signer address is involved in at least one inner transaction.
223
- * @private
214
+ * Retrieves the signature for a payload proposed via `signBatchPayload`,
215
+ * building the BatchSigner shapes when it is available.
216
+ *
217
+ * Performs a single fetch by default (`maxRetries: 1`); the operator may not
218
+ * have approved the signature yet, in which case `undefined` is returned and
219
+ * the caller decides when to retry. Pass `maxRetries`/`intervalMs` to opt into
220
+ * light polling.
221
+ *
222
+ * @param params - Fields from the `SignBatchPayloadHandle` (a handle may be passed directly)
223
+ * @param options - Optional polling configuration (defaults to a single attempt)
224
+ * @returns The signature and BatchSigner shapes, or `undefined` if not yet signed
225
+ * @throws {CustodyError} On any non-404 error fetching the manifest
224
226
  */
225
- validateBatchSigner(batch, signerAddress) {
226
- const involvedAccounts = new Set(batch.RawTransactions.map((rawTx) => rawTx.RawTransaction.Account));
227
- if (!involvedAccounts.has(signerAddress)) {
228
- throw new CustodyError({
229
- reason: `Address ${signerAddress} is not involved in any inner transaction of the Batch`,
230
- });
227
+ async getBatchSignature(params, options = {}) {
228
+ const signature = await this.pollManifestSignature(params.domainId, params.accountId, params.payloadId, { maxRetries: 1, ...options });
229
+ if (isUndefined(signature)) {
230
+ return undefined;
231
231
  }
232
+ return buildSignBatchPayloadResult(params, signature);
232
233
  }
233
234
  /**
234
- * Encodes a Batch transaction envelope for signing.
235
- * Computes txIDs from inner transactions and encodes with `encodeForSigningBatch`.
236
- * @private
235
+ * Step 3 of the XLS-56 Batch flow submits the Batch as a real intent with
236
+ * collected `batchSigners`. The payload must match the one used for
237
+ * `dryRunBatch`; reuse `options.payloadId` and `options.requestId` if you
238
+ * need referential identity with the dry-run.
239
+ *
240
+ * @param payload - Same submitter, execution mode, and entries as the dry-run
241
+ * @param batchSigners - Signatures collected in Step 2 (one per participant)
242
+ * @param options - Optional configuration for the intent
243
+ * @returns The proposed intent response
244
+ * @throws {CustodyError} If validation fails or the submitter account is not found
237
245
  */
238
- encodeBatchForSigning(batch) {
239
- const txIDs = batch.RawTransactions.map((rawTx) => hashes.hashSignedTx(rawTx.RawTransaction));
240
- const batchEncodedHex = encodeForSigningBatch({
241
- flags: batch.Flags,
242
- txIDs,
246
+ async proposeBatch(payload, batchSigners, options = {}) {
247
+ const context = await this.ports.resolveContext(payload.Account, {
248
+ domainId: options.domainId,
249
+ ledgerId: options.ledgerId,
243
250
  });
244
- return Buffer.from(batchEncodedHex, "hex").toString("base64");
251
+ const operation = buildBatchOperation(payload, batchSigners);
252
+ const body = buildTransactionIntent({ operation, context, options });
253
+ return this.ports.submitIntent(body);
254
+ }
255
+ /**
256
+ * Resolves the intent context for an inner-batch signer. Skips the address
257
+ * lookup when `accountId` and `ledgerId` are provided.
258
+ * @private
259
+ */
260
+ async resolveSignerContext(signerAddress, options) {
261
+ if (options.accountId && options.ledgerId) {
262
+ const fullContext = await this.ports.resolveContext(signerAddress, {
263
+ domainId: options.domainId,
264
+ });
265
+ return {
266
+ domainId: fullContext.domainId,
267
+ userId: fullContext.userId,
268
+ accountId: options.accountId,
269
+ ledgerId: options.ledgerId,
270
+ address: signerAddress,
271
+ };
272
+ }
273
+ return this.ports.resolveContext(signerAddress, { domainId: options.domainId });
245
274
  }
246
275
  /**
247
276
  * Proposes a raw sign intent with base64-encoded bytes.
248
- * Shared by rawSign, rawSignAndWait, and signBytesAndWait.
277
+ * Shared by rawSign, rawSignAndWait, and signBatchPayloadAndWait.
249
278
  * @private
250
279
  */
251
280
  async proposeRawSignIntent(base64Bytes, context, options) {
@@ -282,89 +311,56 @@ export class XrplService {
282
311
  }
283
312
  /**
284
313
  * Polls the manifest until a signature is available, then returns it as uppercase hex.
285
- * Handles both the manifest not existing yet (404) and the manifest existing
286
- * but not yet having a signature.
314
+ * Throws if the signature is still unavailable after the maximum retries.
287
315
  * @private
288
316
  */
289
317
  async waitForManifestSignature(domainId, accountId, manifestId, options = {}) {
318
+ const signature = await this.pollManifestSignature(domainId, accountId, manifestId, options);
319
+ if (isUndefined(signature)) {
320
+ throw new CustodyError({
321
+ reason: "Manifest signature not available after maximum retries",
322
+ });
323
+ }
324
+ return signature;
325
+ }
326
+ /**
327
+ * Polls the manifest for a signature, returning it as uppercase hex once
328
+ * available, or `undefined` if still unavailable after the maximum retries.
329
+ * @private
330
+ */
331
+ async pollManifestSignature(domainId, accountId, manifestId, options = {}) {
290
332
  const { maxRetries = 3, intervalMs = 3000, onAttempt } = options;
291
333
  for (let attempt = 1; attempt <= maxRetries; attempt++) {
292
334
  onAttempt?.(attempt);
293
- try {
294
- const manifest = await this.ports.getManifest(domainId, accountId, manifestId);
295
- const { value } = manifest.data;
296
- if (value && value.type === "Unsafe") {
297
- return Buffer.from(value.signature, "base64").toString("hex").toUpperCase();
298
- }
299
- }
300
- catch (error) {
301
- if (!(error instanceof CustodyError && error.statusCode === 404)) {
302
- throw error;
303
- }
335
+ const signature = await this.fetchManifestSignature(domainId, accountId, manifestId);
336
+ if (!isUndefined(signature)) {
337
+ return signature;
304
338
  }
305
339
  if (attempt < maxRetries) {
306
340
  await sleep(intervalMs);
307
341
  }
308
342
  }
309
- throw new CustodyError({
310
- reason: "Manifest signature not available after maximum retries",
311
- });
343
+ return undefined;
312
344
  }
313
345
  /**
314
- * Builds an XRPL intent body.
346
+ * Fetches the manifest once and returns its signature as uppercase hex, or
347
+ * `undefined` if the manifest does not exist yet (404) or has no signature.
315
348
  * @private
316
349
  */
317
- buildTransactionIntent({ operation, context, options, }) {
318
- const feePriority = options.feePriority ?? "Low";
319
- const expiryDays = options.expiryDays ?? 1;
320
- const requestId = options.requestId ?? uuidv7();
321
- const payloadId = options.payloadId ?? uuidv7();
322
- return {
323
- request: {
324
- author: {
325
- domainId: context.domainId,
326
- id: context.userId,
327
- },
328
- customProperties: options.requestCustomProperties ?? {},
329
- expiryAt: dayjs().add(expiryDays, "day").toISOString(),
330
- id: requestId,
331
- payload: {
332
- accountId: context.accountId,
333
- customProperties: options.payloadCustomProperties ?? {},
334
- id: payloadId,
335
- ledgerId: context.ledgerId,
336
- parameters: {
337
- feeStrategy: {
338
- priority: feePriority,
339
- type: "Priority",
340
- },
341
- memos: [],
342
- operation,
343
- type: "XRPL",
344
- },
345
- type: "v0_CreateTransactionOrder",
346
- },
347
- targetDomainId: context.domainId,
348
- type: "Propose",
349
- },
350
- };
350
+ async fetchManifestSignature(domainId, accountId, manifestId) {
351
+ try {
352
+ const manifest = await this.ports.getManifest(domainId, accountId, manifestId);
353
+ const { value } = manifest.data;
354
+ if (value && value.type === "Unsafe") {
355
+ return Buffer.from(value.signature, "base64").toString("hex").toUpperCase();
356
+ }
357
+ }
358
+ catch (error) {
359
+ if (!(error instanceof CustodyError && error.statusCode === 404)) {
360
+ throw error;
361
+ }
362
+ }
363
+ return undefined;
351
364
  }
352
365
  }
353
- /**
354
- * Compresses a base64-encoded SPKI/DER secp256k1 public key to its compressed hex form.
355
- * Uses Node.js built-in crypto via JWK export to extract the raw EC point coordinates.
356
- */
357
- function compressPublicKey(base64PublicKey) {
358
- const publicKey = createPublicKey({
359
- key: Buffer.from(base64PublicKey, "base64"),
360
- format: "der",
361
- type: "spki",
362
- });
363
- const jwk = publicKey.export({ format: "jwk" });
364
- const x = Buffer.from(jwk.x, "base64url");
365
- const y = Buffer.from(jwk.y, "base64url");
366
- const lastByte = y[y.length - 1];
367
- const prefix = lastByte % 2 === 0 ? "02" : "03";
368
- return (prefix + x.toString("hex")).toUpperCase();
369
- }
370
366
  //# sourceMappingURL=xrpl.service.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"xrpl.service.js","sourceRoot":"","sources":["../../../src/services/xrpl/xrpl.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACxC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,MAAM,EACN,cAAc,GAGf,MAAM,MAAM,CAAA;AACb,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAapD,MAAM,OAAO,WAAW;IACO;IAA7B,YAA6B,KAAgB;QAAhB,UAAK,GAAL,KAAK,CAAW;IAAG,CAAC;IAEjD;;;;;;;;;;;;;;OAcG;IACI,KAAK,CAAC,aAAa,CACxB,MAA0D,EAC1D,UAA6B,EAAE;QAE/B,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE;YAC9D,QAAQ,EAAE,OAAO,CAAC,QAAQ;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E,SAAS,EAAE,UAAU,CAAC,CAAA;YACpF,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE,CAAC;gBAC5B,OAAO,SAAS,CAAA;YAClB,CAAC;YAED,IAAI,OAAO,GAAG,UAAU,EAAE,CAAC;gBACzB,MAAM,KAAK,CAAC,UAAU,CAAC,CAAA;YACzB,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,sBAAsB,CAClC,QAAgB,EAChB,SAAiB,EACjB,UAAkB;QAElB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,QAAQ,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;YAE9E,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC,IAAI,CAAA;YAC/B,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;gBACrC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAA;YAC7E,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,CAAC,KAAK,YAAY,YAAY,IAAI,KAAK,CAAC,UAAU,KAAK,GAAG,CAAC,EAAE,CAAC;gBACjE,MAAM,KAAK,CAAA;YACb,CAAC;QACH,CAAC;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;CACF"}
@@ -1,8 +1,9 @@
1
- import type { AccountSet, Clawback, DepositPreauth, MPTokenAuthorize, MPTokenIssuanceCreate, MPTokenIssuanceDestroy, MPTokenIssuanceSet, OfferCreate, Payment, SubmittableTransaction, TrustSet } from "xrpl";
1
+ import type { AccountSet, Batch, BatchSigner, Clawback, DepositPreauth, MPTokenAuthorize, MPTokenIssuanceCreate, MPTokenIssuanceDestroy, MPTokenIssuanceSet, OfferCreate, Payment, SubmittableTransaction, TicketCreate, TrustSet } from "xrpl";
2
2
  import type { components } from "../../models/custody-types.js";
3
3
  import type { XrplLedgerId } from "../../models/ledger-ids.js";
4
4
  import type { Prettify } from "../../type-utils/index.js";
5
5
  import type { DomainUserReference } from "../domain-resolver/index.js";
6
+ import type { Core_IntentResponse } from "../intents/intents.types.js";
6
7
  /**
7
8
  * Minimum set of account fields required to build an XRPL intent.
8
9
  * Consumed by `IntentContext`. Not an API response shape — see
@@ -36,8 +37,23 @@ type Core_XrplOperation_MPTokenIssuanceDestroy = components["schemas"]["Core_Xrp
36
37
  export type CustodyMpTokenIssuanceDestroy = Prettify<Pick<MPTokenIssuanceDestroy, "Account"> & Omit<Core_XrplOperation_MPTokenIssuanceDestroy, "type">>;
37
38
  export type Core_XrplOperation_OfferCreate = components["schemas"]["Core_XrplOperation_OfferCreate"];
38
39
  export type CustodyOfferCreate = Prettify<Pick<OfferCreate, "Account"> & Omit<Core_XrplOperation_OfferCreate, "type">>;
40
+ export type Core_XrplOperation_TicketCreate = components["schemas"]["Core_XrplOperation_TicketCreate"];
41
+ export type CustodyTicketCreate = Prettify<Pick<TicketCreate, "Account"> & Omit<Core_XrplOperation_TicketCreate, "type">>;
39
42
  export type Core_XrplOperation_AccountSet = components["schemas"]["Core_XrplOperation_AccountSet"];
40
43
  export type CustodyAccountSet = Prettify<Pick<AccountSet, "Account"> & Omit<Core_XrplOperation_AccountSet, "type">>;
44
+ export type Core_XrplOperation_Batch = components["schemas"]["Core_XrplOperation_Batch"];
45
+ export type CustodyBatch = Prettify<Pick<Batch, "Account"> & Omit<Core_XrplOperation_Batch, "type">>;
46
+ export type CustodyBatchSigner = CustodyBatch["batchSigners"][number];
47
+ export type CustodyInnerTransaction = CustodyBatch["entries"][number];
48
+ export type CustodyOperation = CustodyInnerTransaction["operation"];
49
+ export type Core_ParticipantSequencing = components["schemas"]["Core_ParticipantSequencing"];
50
+ export type Core_BatchEntry = components["schemas"]["Core_BatchEntry"];
51
+ export type Core_BatchSigner = components["schemas"]["Core_BatchSigner"];
52
+ export type Core_Sequencing = components["schemas"]["Core_Sequencing"];
53
+ export type Core_BatchExecutionMode = components["schemas"]["Core_Xrpl_BatchExecutionMode"];
54
+ export type Core_ApiBatchSigningData = components["schemas"]["Core_ApiBatchSigningData"];
55
+ export type Core_TransactionEstimate_XRPL = components["schemas"]["Core_TransactionEstimate_XRPL"];
56
+ export type Core_IntentDryRunResponse_v0_CreateTransactionOrder = components["schemas"]["Core_IntentDryRunResponse_v0_CreateTransactionOrder"];
41
57
  export type CustodyAccountSetFlag = CustodyAccountSet["setFlag"];
42
58
  export type XrplIntentOptions = {
43
59
  /**
@@ -117,15 +133,100 @@ export type RawSignAndWaitResult = {
117
133
  /** The transaction with TxnSignature and SigningPubKey set, ready to submit */
118
134
  signedTransaction: SubmittableTransaction;
119
135
  };
120
- export {};
136
+ type BatchSignerLookup = {
137
+ accountId?: never;
138
+ ledgerId?: never;
139
+ };
140
+ type BatchSignerDirect = {
141
+ /** Custody account ID — skips the address lookup when provided with ledgerId */
142
+ accountId: string;
143
+ /** Ledger ID for the account */
144
+ ledgerId: string;
145
+ };
121
146
  /**
122
- * Result of rawSignInnerBatchAndWait.
123
- * Extends RawSignAndWaitResult with batch signer representations.
147
+ * Input for `dryRunBatch` / `proposeBatch`.
148
+ *
149
+ * `Account` is the submitter (pays the outer Batch fee). `entries` mixes
150
+ * `SubmitterOperation` and `ParticipantOperation`; build them by hand with
151
+ * `Core_BatchEntry`, or convert from an autofilled xrpl.js `Batch` with
152
+ * `batchToCustodyInnerTransactions`.
124
153
  */
154
+ export type BatchPayloadInput = {
155
+ /** XRPL address of the submitter (the account that pays the outer Batch fee) */
156
+ Account: string;
157
+ /** How the XRP Ledger handles inner-operation failures */
158
+ executionMode: Core_BatchExecutionMode;
159
+ /** Inner operations (SubmitterOperation or ParticipantOperation) */
160
+ entries: Core_BatchEntry[];
161
+ /** Outer Batch sequencing. Defaults to `{ type: "PlatformManaged" }` */
162
+ sequencing?: Core_Sequencing;
163
+ /** Optional last ledger sequence for the outer Batch */
164
+ lastLedgerSequence?: number;
165
+ };
125
166
  /**
126
- * Options for rawSignInnerBatch / rawSignInnerBatchAndWait: intent options + polling configuration.
167
+ * Options for signing the `signingPayload` returned by `dryRunBatch` for an
168
+ * inner account managed by this custody instance.
127
169
  *
128
- * When `accountId` and `ledgerId` are provided, the address-to-account lookup is
129
- * skipped, saving an API call.
170
+ * When `accountId` and `ledgerId` are provided, the address-to-account lookup
171
+ * is skipped.
130
172
  */
173
+ export type SignBatchPayloadOptions = XrplIntentOptions & {
174
+ /** Polling options for waiting for the manifest signature */
175
+ polling?: WaitForSignatureOptions;
176
+ } & (BatchSignerLookup | BatchSignerDirect);
177
+ /**
178
+ * Result of `signBatchPayloadAndWait`.
179
+ *
180
+ * `signature` and `signingPubKey` are uppercase hex. `batchSigner` is the
181
+ * xrpl.js `BatchSigner` shape; `custodyBatchSigner` is the {% PUBLIC_VAR_CUS %}
182
+ * shape — pick whichever the next step needs.
183
+ */
184
+ export type SignBatchPayloadResult = {
185
+ /** The signature in uppercase hex */
186
+ signature: string;
187
+ /** The compressed secp256k1 public key in uppercase hex */
188
+ signingPubKey: string;
189
+ /** xrpl.js BatchSigner — for inclusion in an xrpl.js Batch.BatchSigners array */
190
+ batchSigner: BatchSigner;
191
+ /** Custody BatchSigner — for inclusion in batchSigners on `proposeBatch` */
192
+ custodyBatchSigner: CustodyBatchSigner;
193
+ };
194
+ /**
195
+ * Serializable handle returned by `signBatchPayload`. Persist these fields
196
+ * (e.g. to a database or queue) and pass them to `getBatchSignature` once the
197
+ * custody instance operator has approved the signature — possibly from a
198
+ * different process.
199
+ */
200
+ export type SignBatchPayloadHandle = {
201
+ /** Manifest ID to poll for the signature */
202
+ payloadId: string;
203
+ /** Domain ID of the signer account */
204
+ domainId: string;
205
+ /** Account ID of the signer account */
206
+ accountId: string;
207
+ /** XRPL address of the signer */
208
+ signerAddress: string;
209
+ /** The compressed secp256k1 public key in uppercase hex */
210
+ signingPubKey: string;
211
+ /** The proposed intent response */
212
+ intentResponse: Core_IntentResponse;
213
+ };
214
+ /**
215
+ * Fields `getBatchSignature` needs to fetch the signature and build the
216
+ * BatchSigner shapes. A `SignBatchPayloadHandle` is a structural superset, so a
217
+ * stored handle can be passed directly.
218
+ */
219
+ export type GetBatchSignatureParams = {
220
+ /** Manifest ID returned by `signBatchPayload` */
221
+ payloadId: string;
222
+ /** Domain ID of the signer account */
223
+ domainId: string;
224
+ /** Account ID of the signer account */
225
+ accountId: string;
226
+ /** XRPL address of the signer */
227
+ signerAddress: string;
228
+ /** The compressed secp256k1 public key in uppercase hex */
229
+ signingPubKey: string;
230
+ };
231
+ export {};
131
232
  //# sourceMappingURL=xrpl.types.d.ts.map