@owneraio/finp2p-sdk-js 0.28.25 → 0.28.41

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 (205) hide show
  1. package/README.md +71 -1
  2. package/lib/OwneraAPI/__tests__/apiErrorShape.test.d.ts +1 -0
  3. package/lib/OwneraAPI/__tests__/apiErrorShape.test.js +264 -0
  4. package/lib/OwneraAPI/__tests__/apiErrorShape.test.js.map +1 -0
  5. package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js +5 -12
  6. package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js.map +1 -1
  7. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.d.ts +1 -0
  8. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js +56 -0
  9. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js.map +1 -0
  10. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.d.ts +1 -0
  11. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js +75 -0
  12. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js.map +1 -0
  13. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.d.ts +1 -0
  14. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js +348 -0
  15. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js.map +1 -0
  16. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.d.ts +1 -0
  17. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js +97 -0
  18. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js.map +1 -0
  19. package/lib/OwneraAPI/finp2p-node-api/certificates.js +15 -6
  20. package/lib/OwneraAPI/finp2p-node-api/certificates.js.map +1 -1
  21. package/lib/OwneraAPI/finp2p-node-api/custodies.js +13 -2
  22. package/lib/OwneraAPI/finp2p-node-api/custodies.js.map +1 -1
  23. package/lib/OwneraAPI/finp2p-node-api/documents.js +22 -9
  24. package/lib/OwneraAPI/finp2p-node-api/documents.js.map +1 -1
  25. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.d.ts +13 -0
  26. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js +71 -0
  27. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js.map +1 -0
  28. package/lib/OwneraAPI/finp2p-node-api/ledgers.js +13 -2
  29. package/lib/OwneraAPI/finp2p-node-api/ledgers.js.map +1 -1
  30. package/lib/OwneraAPI/finp2p-node-api/messages.js +12 -3
  31. package/lib/OwneraAPI/finp2p-node-api/messages.js.map +1 -1
  32. package/lib/OwneraAPI/finp2p-node-api/operations.js +37 -15
  33. package/lib/OwneraAPI/finp2p-node-api/operations.js.map +1 -1
  34. package/lib/OwneraAPI/finp2p-node-api/policies.js +14 -5
  35. package/lib/OwneraAPI/finp2p-node-api/policies.js.map +1 -1
  36. package/lib/OwneraAPI/finp2p-node-api/profiles.js +95 -49
  37. package/lib/OwneraAPI/finp2p-node-api/profiles.js.map +1 -1
  38. package/lib/OwneraAPI/finp2p-node-api/tokens.js +20 -0
  39. package/lib/OwneraAPI/finp2p-node-api/tokens.js.map +1 -1
  40. package/lib/OwneraAPI/index.js +2 -0
  41. package/lib/OwneraAPI/index.js.map +1 -1
  42. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.d.ts +1 -0
  43. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js +253 -0
  44. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js.map +1 -0
  45. package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js +52 -0
  46. package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js.map +1 -1
  47. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.d.ts +1 -0
  48. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js +347 -0
  49. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js.map +1 -0
  50. package/lib/OwneraAPI/oss-api/filterUtils.d.ts +20 -0
  51. package/lib/OwneraAPI/oss-api/filterUtils.js +57 -5
  52. package/lib/OwneraAPI/oss-api/filterUtils.js.map +1 -1
  53. package/lib/OwneraAPI/oss-api/oss.js +188 -75
  54. package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
  55. package/lib/OwneraAPI/oss-api/queryUtils.d.ts +1 -0
  56. package/lib/OwneraAPI/oss-api/queryUtils.js +6 -5
  57. package/lib/OwneraAPI/oss-api/queryUtils.js.map +1 -1
  58. package/lib/OwneraAPI/oss-api/queryValidation.d.ts +3 -1
  59. package/lib/OwneraAPI/oss-api/queryValidation.js +21 -2
  60. package/lib/OwneraAPI/oss-api/queryValidation.js.map +1 -1
  61. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.d.ts +1 -0
  62. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js +42 -0
  63. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js.map +1 -0
  64. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.d.ts +1 -0
  65. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js +73 -0
  66. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js.map +1 -0
  67. package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js +23 -11
  68. package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js.map +1 -1
  69. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.d.ts +1 -1
  70. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js +3 -1
  71. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js.map +1 -1
  72. package/lib/OwneraAPI/utils.d.ts +39 -0
  73. package/lib/OwneraAPI/utils.js +125 -73
  74. package/lib/OwneraAPI/utils.js.map +1 -1
  75. package/lib/core/__tests__/consoleLogger.test.d.ts +1 -0
  76. package/lib/core/__tests__/consoleLogger.test.js +269 -0
  77. package/lib/core/__tests__/consoleLogger.test.js.map +1 -0
  78. package/lib/core/__tests__/createAssetNameUniqueness.test.d.ts +1 -0
  79. package/lib/core/__tests__/createAssetNameUniqueness.test.js +95 -0
  80. package/lib/core/__tests__/createAssetNameUniqueness.test.js.map +1 -0
  81. package/lib/core/__tests__/custodianPrecedence.test.d.ts +1 -0
  82. package/lib/core/__tests__/custodianPrecedence.test.js +683 -0
  83. package/lib/core/__tests__/custodianPrecedence.test.js.map +1 -0
  84. package/lib/core/__tests__/executeIntentSettlementAssets.test.d.ts +1 -0
  85. package/lib/core/__tests__/executeIntentSettlementAssets.test.js +128 -0
  86. package/lib/core/__tests__/executeIntentSettlementAssets.test.js.map +1 -0
  87. package/lib/core/__tests__/logException.test.d.ts +1 -0
  88. package/lib/core/__tests__/logException.test.js +49 -0
  89. package/lib/core/__tests__/logException.test.js.map +1 -0
  90. package/lib/core/__tests__/multiplyDecimalStrings.test.d.ts +1 -0
  91. package/lib/core/__tests__/multiplyDecimalStrings.test.js +37 -0
  92. package/lib/core/__tests__/multiplyDecimalStrings.test.js.map +1 -0
  93. package/lib/core/__tests__/settlementExecutionAmount.test.d.ts +1 -0
  94. package/lib/core/__tests__/settlementExecutionAmount.test.js +300 -0
  95. package/lib/core/__tests__/settlementExecutionAmount.test.js.map +1 -0
  96. package/lib/core/asset.js +21 -27
  97. package/lib/core/asset.js.map +1 -1
  98. package/lib/core/custodian.d.ts +30 -0
  99. package/lib/core/custodian.js +49 -0
  100. package/lib/core/custodian.js.map +1 -0
  101. package/lib/core/index.d.ts +1 -0
  102. package/lib/core/index.js +3 -1
  103. package/lib/core/index.js.map +1 -1
  104. package/lib/core/intents/__tests__/intentErrorCode.test.d.ts +1 -0
  105. package/lib/core/intents/__tests__/intentErrorCode.test.js +111 -0
  106. package/lib/core/intents/__tests__/intentErrorCode.test.js.map +1 -0
  107. package/lib/core/intents/__tests__/intentHandleReject.test.d.ts +1 -0
  108. package/lib/core/intents/__tests__/intentHandleReject.test.js +50 -0
  109. package/lib/core/intents/__tests__/intentHandleReject.test.js.map +1 -0
  110. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.d.ts +1 -0
  111. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js +185 -0
  112. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js.map +1 -0
  113. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.d.ts +1 -0
  114. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js +85 -0
  115. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js.map +1 -0
  116. package/lib/core/intents/__tests__/loanIntentMetadata.test.d.ts +1 -0
  117. package/lib/core/intents/__tests__/loanIntentMetadata.test.js +81 -0
  118. package/lib/core/intents/__tests__/loanIntentMetadata.test.js.map +1 -0
  119. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.d.ts +1 -0
  120. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js +203 -0
  121. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js.map +1 -0
  122. package/lib/core/intents/createIntent/createIntent.js +4 -3
  123. package/lib/core/intents/createIntent/createIntent.js.map +1 -1
  124. package/lib/core/intents/createIntent/createMoveIntentReq.d.ts +27 -0
  125. package/lib/core/intents/createIntent/createMoveIntentReq.js +91 -0
  126. package/lib/core/intents/createIntent/createMoveIntentReq.js.map +1 -0
  127. package/lib/core/intents/createIntent/helpers.d.ts +32 -2
  128. package/lib/core/intents/createIntent/helpers.js +78 -1
  129. package/lib/core/intents/createIntent/helpers.js.map +1 -1
  130. package/lib/core/intents/createLoanIntent.js +64 -19
  131. package/lib/core/intents/createLoanIntent.js.map +1 -1
  132. package/lib/core/intents/executeIntent.js +102 -41
  133. package/lib/core/intents/executeIntent.js.map +1 -1
  134. package/lib/core/intents/executeLoanIntent.js +48 -23
  135. package/lib/core/intents/executeLoanIntent.js.map +1 -1
  136. package/lib/core/intents/executeMoveIntent.d.ts +19 -0
  137. package/lib/core/intents/executeMoveIntent.js +134 -0
  138. package/lib/core/intents/executeMoveIntent.js.map +1 -0
  139. package/lib/core/intents/executePrivateIntent.js +46 -13
  140. package/lib/core/intents/executePrivateIntent.js.map +1 -1
  141. package/lib/core/intents/executeRedemptionIntent.d.ts +1 -0
  142. package/lib/core/intents/executeRedemptionIntent.js +23 -9
  143. package/lib/core/intents/executeRedemptionIntent.js.map +1 -1
  144. package/lib/core/intents/executeTransferRequest.d.ts +5 -0
  145. package/lib/core/intents/executeTransferRequest.js +14 -3
  146. package/lib/core/intents/executeTransferRequest.js.map +1 -1
  147. package/lib/core/intents/getIntent.js +18 -0
  148. package/lib/core/intents/getIntent.js.map +1 -1
  149. package/lib/core/intents/index.d.ts +3 -0
  150. package/lib/core/intents/index.js +7 -1
  151. package/lib/core/intents/index.js.map +1 -1
  152. package/lib/core/intents/transfer.js +7 -2
  153. package/lib/core/intents/transfer.js.map +1 -1
  154. package/lib/core/intents/updateMoveIntentReq.d.ts +28 -0
  155. package/lib/core/intents/updateMoveIntentReq.js +94 -0
  156. package/lib/core/intents/updateMoveIntentReq.js.map +1 -0
  157. package/lib/core/intents/utils.d.ts +15 -7
  158. package/lib/core/intents/utils.js +36 -26
  159. package/lib/core/intents/utils.js.map +1 -1
  160. package/lib/core/logger.js +128 -22
  161. package/lib/core/logger.js.map +1 -1
  162. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.d.ts +1 -0
  163. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js +60 -0
  164. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js.map +1 -0
  165. package/lib/core/normalizers/normalizeOperationResponse.d.ts +6 -0
  166. package/lib/core/normalizers/normalizeOperationResponse.js +4 -5
  167. package/lib/core/normalizers/normalizeOperationResponse.js.map +1 -1
  168. package/lib/core/sdk.d.ts +4 -0
  169. package/lib/core/sdk.js +2 -2
  170. package/lib/core/sdk.js.map +1 -1
  171. package/lib/core/user.d.ts +2 -2
  172. package/lib/core/user.js +60 -2
  173. package/lib/core/user.js.map +1 -1
  174. package/lib/core/utils.d.ts +17 -1
  175. package/lib/core/utils.js +75 -16
  176. package/lib/core/utils.js.map +1 -1
  177. package/lib/index.d.ts +1 -0
  178. package/lib/index.js +3 -1
  179. package/lib/index.js.map +1 -1
  180. package/lib/types/Core/Intents.d.ts +243 -2
  181. package/lib/types/Core/Intents.js +9 -0
  182. package/lib/types/Core/Intents.js.map +1 -1
  183. package/lib/types/Core/OwneraAPI.d.ts +21 -1
  184. package/lib/types/Core/User.d.ts +62 -4
  185. package/lib/types/InvestorAccounts/InvestorAccounts.d.ts +171 -0
  186. package/lib/types/InvestorAccounts/InvestorAccounts.js +35 -0
  187. package/lib/types/InvestorAccounts/InvestorAccounts.js.map +1 -0
  188. package/lib/types/InvestorAccounts/index.d.ts +1 -0
  189. package/lib/types/InvestorAccounts/index.js +18 -0
  190. package/lib/types/InvestorAccounts/index.js.map +1 -0
  191. package/lib/types/Operations/Operations.d.ts +11 -0
  192. package/lib/types/Oss/Oss.d.ts +18 -1
  193. package/lib/types/Oss/OssSchemas.d.ts +89 -2
  194. package/lib/types/Oss/OssSchemas.js.map +1 -1
  195. package/lib/types/Oss/utils.d.ts +32 -0
  196. package/lib/types/PaymentAdapter/PaymentAdapter.d.ts +7 -0
  197. package/lib/types/PaymentAdapter/index.d.ts +33 -1
  198. package/lib/types/Profiles/Accounts.d.ts +32 -0
  199. package/lib/types/Profiles/Intents.d.ts +58 -3
  200. package/lib/types/Profiles/Profiles.d.ts +71 -2
  201. package/lib/types/Tokens/Tokens.d.ts +111 -1
  202. package/lib/types/index.d.ts +1 -0
  203. package/lib/types/index.js +1 -0
  204. package/lib/types/index.js.map +1 -1
  205. package/package.json +1 -1
package/lib/core/user.js CHANGED
@@ -13,6 +13,7 @@ exports.getPublicKey = exports.createUser = exports.addAccount = exports.sendMes
13
13
  const certificate_1 = require("./certificate");
14
14
  const intents_1 = require("./intents");
15
15
  const executePrivateIntent_1 = require("./intents/executePrivateIntent");
16
+ const custodian_1 = require("./custodian");
16
17
  const updateTransferIntent_1 = require("./intents/updateTransferIntent");
17
18
  const payments_1 = require("./payments");
18
19
  const normalizeOperationResponse_1 = require("./normalizers/normalizeOperationResponse");
@@ -199,6 +200,7 @@ const getUser = (req) => __awaiter(void 0, void 0, void 0, function* () {
199
200
  data,
200
201
  logger,
201
202
  owneraAPI,
203
+ custodianOrgId,
202
204
  userId,
203
205
  userPublicKey: req.publicKey || (yield (0, exports.getPublicKey)({ owneraAPI, logger, userId })),
204
206
  idempotency: options === null || options === void 0 ? void 0 : options.idempotencyKey,
@@ -338,7 +340,62 @@ const getUser = (req) => __awaiter(void 0, void 0, void 0, function* () {
338
340
  owneraAPI,
339
341
  logger,
340
342
  data,
343
+ custodianOrgId,
344
+ userPublicKey: req.publicKey || (yield (0, exports.getPublicKey)({ owneraAPI, logger, userId })),
345
+ idempotency: options === null || options === void 0 ? void 0 : options.idempotencyKey,
346
+ });
347
+ }),
348
+ /**
349
+ * Create move intent
350
+ *
351
+ * Declares a migration path from a source asset to a destination asset.
352
+ * Created by the issuer; executed later by any holder.
353
+ *
354
+ * @param createMoveIntent
355
+ * @param options
356
+ * @returns
357
+ */
358
+ createMoveIntent: (createMoveIntent, options) => __awaiter(void 0, void 0, void 0, function* () {
359
+ return yield (0, intents_1.createMoveIntentReq)({
360
+ owneraAPI,
361
+ logger,
362
+ createIntentRequest: createMoveIntent,
363
+ }, options);
364
+ }),
365
+ /**
366
+ * Update move intent
367
+ *
368
+ * Replaces a move intent's allowed destination assets (source immutable).
369
+ * Resolves each destination's CAIP-19 identifier, like createMoveIntent.
370
+ *
371
+ * @param updateMoveIntent
372
+ * @param options
373
+ * @returns
374
+ */
375
+ updateMoveIntent: (updateMoveIntent, options) => __awaiter(void 0, void 0, void 0, function* () {
376
+ return yield (0, intents_1.updateMoveIntentReq)({
377
+ owneraAPI,
378
+ logger,
379
+ updateIntentRequest: updateMoveIntent,
380
+ }, options);
381
+ }),
382
+ /**
383
+ * Execute move intent
384
+ *
385
+ * The holder migrates their holding to the chosen destination asset.
386
+ *
387
+ * @param data
388
+ * @param options
389
+ * @returns
390
+ */
391
+ executeMoveIntent: (data, options) => __awaiter(void 0, void 0, void 0, function* () {
392
+ return yield (0, intents_1.executeMoveIntent)({
393
+ owneraAPI,
394
+ logger,
395
+ data,
396
+ userId,
341
397
  userPublicKey: req.publicKey || (yield (0, exports.getPublicKey)({ owneraAPI, logger, userId })),
398
+ custodianOrgId,
342
399
  idempotency: options === null || options === void 0 ? void 0 : options.idempotencyKey,
343
400
  });
344
401
  }),
@@ -385,8 +442,9 @@ const sendMessageToCore = (req) => __awaiter(void 0, void 0, void 0, function* (
385
442
  });
386
443
  exports.sendMessageToCore = sendMessageToCore;
387
444
  const addAccount = (req, options) => __awaiter(void 0, void 0, void 0, function* () {
388
- const { owneraAPI, custodianOrgId, userId } = req;
389
- return yield owneraAPI.profiles.addAccount({ orgId: custodianOrgId, ownerId: userId }, {
445
+ const { owneraAPI, custodianOrgId, userId, logger } = req;
446
+ const orgId = (options === null || options === void 0 ? void 0 : options.custodianOrgId) || (0, custodian_1.defaultCustodianOrgId)(custodianOrgId, 'user.addAccount', logger);
447
+ return yield owneraAPI.profiles.addAccount({ orgId, ownerId: userId }, {
390
448
  idempotency: options === null || options === void 0 ? void 0 : options.idempotencyKey,
391
449
  });
392
450
  });
@@ -1 +1 @@
1
- {"version":3,"file":"user.js","sourceRoot":"","sources":["../../src/core/user.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,+CAAkE;AAClE,uCAUmB;AACnB,yEAAsE;AACtE,yEAAuE;AACvE,yCAA+C;AAG/C,yFAAsF;AAYtF;;;;GAIG;AACI,MAAM,OAAO,GAAG,CAAO,GAAoB,EAA0B,EAAE;IAC5E,MAAM,EAAE,SAAS,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,KAAK;QACnB,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;QAC3C,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC,CACH,CAAC;AACJ,CAAC,CAAA,CAAC;AAEK,MAAM,YAAY,GAAG,CAAO,CAAoE,EAAE,EAAE,kDACzG,OAAA,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA,GAAA,CAAC;AADlB,QAAA,YAAY,gBACM;AAE/B,MAAM,KAAK,GAAG,CACZ,CAMC,EACD,OAA4B,EAC5B,EAAE;IACF,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,4BAA4B,EAAE;QAC1C,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,aAAa,EAAE,CAAC,CAAC,aAAa;QAC9B,UAAU,EAAE,CAAC,CAAC,UAAU;KACzB,CAAC,CAAC;IACH,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,YAAY,CAC5C,EAAE,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CAAC,aAAa,EAAE,UAAU,EAAE,CAAC,CAAC,UAAU,EAAE,EACjF;QACE,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc;KACrC,CACF,CAAC;AACJ,CAAC,CAAA,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Logs Exception
3
3
  *
4
4
  * @param error object that we want to print.
5
- * @param log function for logging
5
+ * @param log function for logging. Called as a plain function, so pass `(...input) => logger.error(...input)`
6
+ * rather than `logger.error`: a class-based logger's method loses its `this` otherwise.
6
7
  * @returns
7
8
  */
8
9
  export declare const logException: (error: any, log: (...input: any[]) => void) => void;
@@ -29,3 +30,18 @@ export declare const getOrgFromResourceId: (resourceId: string) => string;
29
30
  *
30
31
  */
31
32
  export declare const generateIdempotencyKey: () => string;
33
+ /**
34
+ * Exact multiplication of two decimal strings, as decimal arithmetic — no floats anywhere.
35
+ *
36
+ * The router compares settlement amounts as DECIMAL STRINGS, exactly, so the SDK must never
37
+ * hand it a float-derived string: `Number('3') * Number('0.1')` is `"0.30000000000000004"`,
38
+ * which a stored `"0.3"` rejects (7305). Scaling both operands to integers, multiplying with
39
+ * BigInt and re-placing the point gives the true product with no rounding at any step.
40
+ *
41
+ * Output is canonical — no exponent, no trailing fractional zeros, no trailing point — so
42
+ * `"1050.00" x "1"` is `"1050"`, matching the router's own normalisation of the stored total.
43
+ * Note this makes the ARITHMETIC exact; it cannot make an inexact per-unit value divide a
44
+ * total evenly (quantity 11 of total 100 has no finite decimal unit). Callers who hold the
45
+ * total should send it directly rather than reconstructing it from a unit.
46
+ */
47
+ export declare const multiplyDecimalStrings: (a: string, b: string) => string;
package/lib/core/utils.js CHANGED
@@ -3,39 +3,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.generateIdempotencyKey = exports.getOrgFromResourceId = exports.generateNonce = exports.logException = void 0;
6
+ exports.multiplyDecimalStrings = exports.generateIdempotencyKey = exports.getOrgFromResourceId = exports.generateNonce = exports.logException = void 0;
7
7
  const axios_1 = __importDefault(require("axios"));
8
8
  const crypto_1 = require("crypto");
9
+ const describeBody = (data) => {
10
+ if (data && typeof data.pipe === 'function')
11
+ return '<stream>';
12
+ try {
13
+ return JSON.stringify(data);
14
+ }
15
+ catch (_a) {
16
+ return '<unserializable>';
17
+ }
18
+ };
9
19
  /**
10
20
  * Logs Exception
11
21
  *
12
22
  * @param error object that we want to print.
13
- * @param log function for logging
23
+ * @param log function for logging. Called as a plain function, so pass `(...input) => logger.error(...input)`
24
+ * rather than `logger.error`: a class-based logger's method loses its `this` otherwise.
14
25
  * @returns
15
26
  */
16
27
  const logException = (error, log) => {
17
- var _a;
18
- if (axios_1.default.isAxiosError(error) && error.response) {
19
- const config = error.config;
20
- const res = error.response;
21
- if (config) {
22
- log(`🔴 Axios Exception: ${config.method} ${config.url} ${res.status}:`);
23
- if (Array.isArray(res.data['errors'])) {
24
- for (const { code, message } of res.data['errors']) {
25
- log(`🔴 Code: ${code}`);
26
- log(`🔴 Message: ${message}`);
28
+ var _a, _b;
29
+ // Never throws: callers log from inside a request's catch before rejecting, so a throw here
30
+ // (a stream body's circular references, a null body) would leave their promise unsettled.
31
+ try {
32
+ if (axios_1.default.isAxiosError(error) && error.response) {
33
+ const config = error.config;
34
+ const res = error.response;
35
+ if (config) {
36
+ log(`🔴 Axios Exception: ${config.method} ${config.url} ${res.status}:`);
37
+ if (Array.isArray((_a = res.data) === null || _a === void 0 ? void 0 : _a.errors)) {
38
+ for (const { code, message } of res.data.errors) {
39
+ log(`🔴 Code: ${code}`);
40
+ log(`🔴 Message: ${message}`);
41
+ }
42
+ }
43
+ else {
44
+ log(`🔴 Details: ${describeBody(res.data)}`);
27
45
  }
28
46
  }
29
47
  else {
30
- log(`🔴 Details: ${JSON.stringify(res.data)}`);
48
+ log(`🔴 Axios Exception: ${res.status} - ${describeBody(res.data)}`);
31
49
  }
32
50
  }
33
51
  else {
34
- log(`🔴 Axios Exception: ${res.status} - ${JSON.stringify(res.data)}`);
52
+ log(`🔴 Exception: ${error === null || error === void 0 ? void 0 : error.message}, stack: ${(_b = error === null || error === void 0 ? void 0 : error.stack) === null || _b === void 0 ? void 0 : _b.slice(0, 200)}`);
35
53
  }
36
54
  }
37
- else {
38
- log(`🔴 Exception: ${error.message}, stack: ${(_a = error.stack) === null || _a === void 0 ? void 0 : _a.slice(0, 200)}`);
55
+ catch (_c) {
56
+ // logging is best-effort
39
57
  }
40
58
  };
41
59
  exports.logException = logException;
@@ -72,4 +90,45 @@ exports.getOrgFromResourceId = getOrgFromResourceId;
72
90
  */
73
91
  const generateIdempotencyKey = () => (0, exports.generateNonce)().toString('hex');
74
92
  exports.generateIdempotencyKey = generateIdempotencyKey;
93
+ /**
94
+ * Exact multiplication of two decimal strings, as decimal arithmetic — no floats anywhere.
95
+ *
96
+ * The router compares settlement amounts as DECIMAL STRINGS, exactly, so the SDK must never
97
+ * hand it a float-derived string: `Number('3') * Number('0.1')` is `"0.30000000000000004"`,
98
+ * which a stored `"0.3"` rejects (7305). Scaling both operands to integers, multiplying with
99
+ * BigInt and re-placing the point gives the true product with no rounding at any step.
100
+ *
101
+ * Output is canonical — no exponent, no trailing fractional zeros, no trailing point — so
102
+ * `"1050.00" x "1"` is `"1050"`, matching the router's own normalisation of the stored total.
103
+ * Note this makes the ARITHMETIC exact; it cannot make an inexact per-unit value divide a
104
+ * total evenly (quantity 11 of total 100 has no finite decimal unit). Callers who hold the
105
+ * total should send it directly rather than reconstructing it from a unit.
106
+ */
107
+ const multiplyDecimalStrings = (a, b) => {
108
+ const parse = (s) => {
109
+ const trimmed = s.trim();
110
+ // Unambiguous by construction: the digit run before the point is a single greedy
111
+ // `\d+` and the fraction only starts at a literal `.`, so there is exactly one way
112
+ // to match — no polynomial backtracking on long digit strings (CodeQL js/polynomial-redos).
113
+ if (!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)$/.test(trimmed)) {
114
+ throw new Error(`multiplyDecimalStrings: not a plain decimal string: "${s}"`);
115
+ }
116
+ const negative = trimmed.startsWith('-');
117
+ const unsigned = trimmed.replace(/^[+-]/, '');
118
+ const [whole = '', frac = ''] = unsigned.split('.');
119
+ return { digits: BigInt((whole || '0') + frac), scale: frac.length, negative };
120
+ };
121
+ const x = parse(a);
122
+ const y = parse(b);
123
+ const product = x.digits * y.digits;
124
+ const scale = x.scale + y.scale;
125
+ let text = product.toString().padStart(scale + 1, '0');
126
+ if (scale > 0) {
127
+ // Re-place the point, then drop trailing fractional zeros and a bare trailing point.
128
+ text = `${text.slice(0, -scale)}.${text.slice(-scale)}`.replace(/0+$/, '').replace(/\.$/, '');
129
+ }
130
+ const negative = x.negative !== y.negative && product !== BigInt(0);
131
+ return `${negative ? '-' : ''}${text}`;
132
+ };
133
+ exports.multiplyDecimalStrings = multiplyDecimalStrings;
75
134
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/core/utils.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,mCAAqC;AAErC;;;;;;GAMG;AACI,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,GAA8B,EAAE,EAAE;;IACzE,IAAI,eAAK,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QAChD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;QAC5B,MAAM,GAAG,GAAG,KAAK,CAAC,QAAQ,CAAC;QAC3B,IAAI,MAAM,EAAE,CAAC;YACX,GAAG,CAAC,uBAAuB,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;YACzE,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;gBACtC,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;oBACnD,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;oBACxB,GAAG,CAAC,eAAe,OAAO,EAAE,CAAC,CAAC;gBAChC,CAAC;YACH,CAAC;iBAAM,CAAC;gBACN,GAAG,CAAC,eAAe,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACjD,CAAC;QACH,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,uBAAuB,GAAG,CAAC,MAAM,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;SAAM,CAAC;QACN,GAAG,CAAC,iBAAiB,KAAK,CAAC,OAAO,YAAY,MAAA,KAAK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,KAAK,EAAE,EAAE,CAAC,CAAC;IAChG,CAAC;IACD,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,QAAQ,IAAI,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC;IACpE,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC;AACzC,CAAC,CAAC;AAzBW,QAAA,sBAAsB,0BAyBjC"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './core';
2
2
  export { default as OwneraAPI } from './OwneraAPI';
3
+ export { TRANSPORT_ERROR_CODE } from './OwneraAPI/utils';
3
4
  export * from './types';
4
5
  export * from './validators';
package/lib/index.js CHANGED
@@ -17,10 +17,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.OwneraAPI = void 0;
20
+ exports.TRANSPORT_ERROR_CODE = exports.OwneraAPI = void 0;
21
21
  __exportStar(require("./core"), exports);
22
22
  var OwneraAPI_1 = require("./OwneraAPI");
23
23
  Object.defineProperty(exports, "OwneraAPI", { enumerable: true, get: function () { return __importDefault(OwneraAPI_1).default; } });
24
+ var utils_1 = require("./OwneraAPI/utils");
25
+ Object.defineProperty(exports, "TRANSPORT_ERROR_CODE", { enumerable: true, get: function () { return utils_1.TRANSPORT_ERROR_CODE; } });
24
26
  __exportStar(require("./types"), exports);
25
27
  __exportStar(require("./validators"), exports);
26
28
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,0CAAwB;AACxB,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,yCAAuB;AACvB,yCAAmD;AAA1C,uHAAA,OAAO,OAAa;AAC7B,2CAAyD;AAAhD,6GAAA,oBAAoB,OAAA;AAC7B,0CAAwB;AACxB,+CAA6B"}
@@ -1,6 +1,7 @@
1
- import { ManualSignaturePolicy, SettlementAssetTerm, SettlementInstructionDestinationAccount, SettlementInstructionSourceAccount, FullSettlementTerm, TransferRequestIntent, IntentCreationSettlementTerm } from '../Profiles';
1
+ import { FinIdAccount, FinP2PAsset, ManualSignaturePolicy, MovePresignedSignaturePolicy, SettlementAssetTerm, SettlementInstructionDestinationAccount, SettlementInstructionSourceAccount, FullSettlementTerm, TransferRequestIntent, IntentCreationSettlementTerm } from '../Profiles';
2
+ import { NetworkAccount } from '../InvestorAccounts';
2
3
  /**
3
- * Intent Interface allow to manage intent state (enable/disable)
4
+ * Intent Interface allow to manage intent state (enable/disable/cancel)
4
5
  */
5
6
  export interface IntentInterface {
6
7
  id: string;
@@ -14,6 +15,21 @@ export interface IntentInterface {
14
15
  *
15
16
  */
16
17
  disable: () => Promise<void>;
18
+ /**
19
+ * Cancel intent — the CREATOR withdrawing it.
20
+ *
21
+ */
22
+ cancel: () => Promise<void>;
23
+ /**
24
+ * Reject intent — the RECEIVER refusing it, optionally saying why.
25
+ *
26
+ * Terminal. Only the intent's receiver may reject, and only while the intent is
27
+ * active; the router enforces both. A non-blank `reason` is persisted on the intent
28
+ * and readable by the counterparty as `rejectReason`. Requires a router with the
29
+ * explicit reject endpoint (finp2p-core#2649); older routers answer 404.
30
+ *
31
+ */
32
+ reject: (reason?: string) => Promise<void>;
17
33
  }
18
34
  export type SellingSettlementInstructionRequest = {
19
35
  destinationAccount: SettlementInstructionDestinationAccount[];
@@ -57,7 +73,60 @@ export interface CreateIntent {
57
73
  export interface LoanIntentSettlementAccountOverride {
58
74
  orgId: string;
59
75
  asset?: SettlementAssetTerm;
76
+ /**
77
+ * Custodian for THIS settlement account.
78
+ *
79
+ * Without it the settlement custodians are taken from `sourceCustodianOrgId` /
80
+ * `destinationCustodianOrgId`, which also drive the asset accounts — and they map
81
+ * to opposite sides in the two instructions (source → asset borrower but settlement
82
+ * LENDER). A cross-org loan whose two parties have different custodians is
83
+ * therefore inexpressible with those two fields alone: satisfying the asset legs
84
+ * necessarily inverts the settlement legs.
85
+ *
86
+ * Honoured on BOTH create and execute with the same precedence — this override,
87
+ * then `sourceCustodianOrgId` / `destinationCustodianOrgId`, then the SDK default —
88
+ * so the two calls cannot disagree about the stored custodian (a mismatch is the
89
+ * router's 7301). Optional and defaulted to today's behaviour, so existing callers
90
+ * are unaffected.
91
+ */
92
+ custodian?: {
93
+ orgId: string;
94
+ };
95
+ }
96
+ /** An account on the loan's collateral that a loan policy may route the collateral through. */
97
+ export interface LoanIntentAdditionalAccount {
98
+ /** Profile id of the account owner. */
99
+ owner: string;
100
+ finId: string;
101
+ /** Empty falls back to the Sdk's default custodian. */
102
+ custodianOrgId: string;
103
+ /**
104
+ * Organization holding the account; it executes every hop sourced at the account.
105
+ * Absent or empty defaults to the organization of the collateral asset.
106
+ *
107
+ * An organization other than the collateral's has not been run end to end against an
108
+ * adapter: its hops execute at this organization with the collateral profile's ledger
109
+ * binding, so they only work if this organization's adapter reaches the same ledger
110
+ * state the collateral was credited in.
111
+ */
112
+ orgId?: string;
113
+ /** Wallet an on-chain leg needs, e.g. `{ type: 'walletAccount', address }`. */
114
+ networkAccount?: NetworkAccount;
60
115
  }
116
+ export interface LoanIntentAdditionalAccounts {
117
+ /** Holds the borrower's collateral until the principal arrives. Router alias `lender_escrow`. */
118
+ openingLeg?: LoanIntentAdditionalAccount;
119
+ /** Holds the returning collateral until the repayment arrives. Router alias `borrower_escrow`. */
120
+ closingLeg?: LoanIntentAdditionalAccount;
121
+ }
122
+ /**
123
+ * The alias each leg is sent under: the name a loan policy references as
124
+ * contract_details.loan.additional_accounts.<alias> (finp2p-core #2708).
125
+ */
126
+ export declare const LOAN_ADDITIONAL_ACCOUNT_ALIASES: {
127
+ readonly openingLeg: "lender_escrow";
128
+ readonly closingLeg: "borrower_escrow";
129
+ };
61
130
  export interface CreateLoanIntent {
62
131
  amount: string;
63
132
  assetId: string;
@@ -85,6 +154,21 @@ export interface CreateLoanIntent {
85
154
  */
86
155
  settlementBorrowerAccount?: LoanIntentSettlementAccountOverride;
87
156
  settlementLenderAccount?: LoanIntentSettlementAccountOverride;
157
+ /** Optional custom metadata forwarded to the node (map of non-empty strings). */
158
+ metadata?: Record<string, string>;
159
+ /**
160
+ * The legs sent must match the aliases the loan policy uses: the router rejects
161
+ * creation (7332) when the matched policy routes through a leg that was not sent,
162
+ * or ignores a leg that was.
163
+ *
164
+ * Empty or absent sends none. Sending any needs a router on release v0.29 or later
165
+ * (finp2p-core #2709). Older routers do not reject the field: they accept the request
166
+ * and silently book a plain loan without the escrows, so check the router version
167
+ * before sending.
168
+ *
169
+ * A leg may not be the borrower's or the lender's own collateral account.
170
+ */
171
+ additionalAccounts?: LoanIntentAdditionalAccounts;
88
172
  }
89
173
  export interface IntentExecution {
90
174
  assetId: string;
@@ -107,6 +191,19 @@ export interface Transfer {
107
191
  destinationAccount: SettlementInstructionDestinationAccount;
108
192
  sourceAccount: SettlementInstructionSourceAccount;
109
193
  idempotency?: string;
194
+ /**
195
+ * FALLBACK custodian for the SOURCE side: used only when the account carries no
196
+ * `custodian.orgId` of its own — it does NOT override one that is present, unlike the
197
+ * identically-suffixed override fields on {@link IntentExecution}, hence the `Fallback` in the
198
+ * name. It takes precedence over the Sdk default {@link SdkOptions.custodianOrgId}. The two
199
+ * sides of a transfer are different investors, so each side has its own field — a single shared
200
+ * fallback would custody one of them at the wrong organization.
201
+ *
202
+ * Note the accounts are read at `account.custodian.orgId` — a `custody` key is ignored.
203
+ */
204
+ sourceFallbackCustodianOrgId?: string;
205
+ /** Same as {@link Transfer.sourceFallbackCustodianOrgId}, for the DESTINATION side. */
206
+ destinationFallbackCustodianOrgId?: string;
110
207
  }
111
208
  export interface LoanIntentExecutionData {
112
209
  assetId: string;
@@ -117,7 +214,25 @@ export interface LoanIntentExecutionData {
117
214
  sourceCustodianOrgId?: string;
118
215
  destinationCustodianOrgId?: string;
119
216
  settlementAssetId?: string;
217
+ /**
218
+ * Per-unit settlement value. When set (and `settlementTotalAmount` is not), the SDK sends
219
+ * `assetTerm.amount x settlementTermAmount`, computed with exact decimal arithmetic; a zero
220
+ * or non-decimal product is rejected. It takes precedence over the stored settlement term.
221
+ */
120
222
  settlementTermAmount?: string;
223
+ /**
224
+ * The settlement TOTAL for the execute payload, sent verbatim. Takes precedence over
225
+ * `settlementTermAmount` and the stored settlement term.
226
+ *
227
+ * When both overrides are omitted the SDK derives the amount from the intent's stored
228
+ * settlement term: a fullSettlement total as is, a partialSettlement unitValue x
229
+ * `assetTerm.amount` with exact decimal arithmetic. A caller that already holds the
230
+ * intent's stored total (an approving counterparty reading the intent back) should pass it
231
+ * here rather than `settlementTermAmount`: the router compares the execute amount against
232
+ * the stored total as an exact decimal value, and a total reconstructed from a rounded
233
+ * per-unit value can only match when the division was exact in the first place.
234
+ */
235
+ settlementTotalAmount?: string;
121
236
  observers?: string[];
122
237
  /**
123
238
  * Optional per-side overrides for the settlement instruction's borrower
@@ -153,3 +268,129 @@ export interface CreateTransferRequest {
153
268
  transactionMetadata?: TransferRequestIntentMetadata;
154
269
  signaturePolicy: ManualSignaturePolicy;
155
270
  }
271
+ /**
272
+ * A move destination, optionally carrying a pre-funded pool account.
273
+ *
274
+ * Superset of {@link FinP2PAsset}, mirroring the node's `moveDestination` schema
275
+ * (which supersedes `finp2pAsset` in `moveAsset.destinationAssets`). The extra
276
+ * fields serve *custody-offered* Move: instead of minting on the destination,
277
+ * the `Transfer` drains a pre-funded pool account (the `hold-transfer-*`
278
+ * variants). Omit both for the issuer-offered path, which is unchanged.
279
+ *
280
+ * Node rules, both enforced server-side:
281
+ * - `fromSegregatedAccountOwner` is **required** when `fromSegregatedAccount` is
282
+ * set — it names the Transfer's seller (the debited party), needed for
283
+ * receipts and regulation. The SDK also checks this client-side and fails
284
+ * fast, since it needs no lookups.
285
+ * - The pool account **and** its owner must live on the **destination asset's
286
+ * org**. Cross-org pool placement is rejected by the node (not checked
287
+ * client-side — it would need a per-account org lookup — so it surfaces as a
288
+ * node 400).
289
+ */
290
+ export interface MoveDestinationInput extends FinP2PAsset {
291
+ /** Pre-funded pool the Transfer drains into this destination (`hold-transfer-*` variants). */
292
+ fromSegregatedAccount?: FinIdAccount;
293
+ /** Resource id of the pool owner / Transfer seller. Required when `fromSegregatedAccount` is set. */
294
+ fromSegregatedAccountOwner?: string;
295
+ }
296
+ /**
297
+ * SDK input for creating a Move intent. Declares an asset-level migration path
298
+ * from a single source asset (`assetId`) to one-or-more destination assets. The
299
+ * intent is created by the source asset's own org; any holder executes it by
300
+ * supplying their own accounts and picking one of the declared destinations.
301
+ * See {@link MoveIntentExecutionData} for the execution counterpart.
302
+ *
303
+ * Supply destinations via either `destinationAsset` (single) or
304
+ * `destinationAssets` (one-or-more) — both map to the node's
305
+ * `moveAsset.destinationAssets` list. When both are given, `destinationAssets`
306
+ * wins; at least one destination is required.
307
+ *
308
+ * `signaturePolicy` is optional (defaults to `manualPolicy`) and accepts either
309
+ * a manual or presigned policy, matching the node's `moveIntent` schema.
310
+ *
311
+ * Two optional fields enable *custody-offered* Move (see
312
+ * {@link MoveDestinationInput} and `sourceToSegregatedAccount`). Omitting both
313
+ * gives the issuer-offered path, where the source is redeemed (burned) on
314
+ * release — unchanged by their addition.
315
+ */
316
+ export interface CreateMoveIntent {
317
+ assetId: string;
318
+ start: number;
319
+ end: number;
320
+ /** Single destination. Convenience alias for a one-element `destinationAssets`. */
321
+ destinationAsset?: MoveDestinationInput;
322
+ /** One-or-more destinations. Takes precedence over `destinationAsset`. */
323
+ destinationAssets?: MoveDestinationInput[];
324
+ /**
325
+ * Custody-offered Move: release held source tokens to this segregated account
326
+ * on the source chain **instead of burning them**. Omit for the
327
+ * issuer-offered path (source is redeemed on release).
328
+ *
329
+ * Node rule: must live on the **source asset's org**. Cross-org placement is
330
+ * rejected server-side.
331
+ */
332
+ sourceToSegregatedAccount?: FinIdAccount;
333
+ signaturePolicy?: ManualSignaturePolicy | MovePresignedSignaturePolicy;
334
+ intentId?: string;
335
+ /** Optional custom metadata forwarded to the node (map of non-empty strings). */
336
+ metadata?: Record<string, string>;
337
+ }
338
+ /**
339
+ * SDK input for editing a Move intent. At least one editable field must be
340
+ * supplied — destinations, a new window, or a status change.
341
+ *
342
+ * - Destinations (`destinationAssets` preferred, or `destinationAsset` single
343
+ * alias) replace the intent's allowed destination list. The source asset is
344
+ * immutable. Given as SDK-facing {@link FinP2PAsset}s — the wrapper resolves
345
+ * each to its CAIP-19 wire shape, mirroring {@link CreateMoveIntent}. When
346
+ * destinations are provided, the node requires at least one.
347
+ * - `start` / `end` are optional epoch-millisecond window bounds.
348
+ * - `status: 'Rejected'` rejects the intent (the only status the PATCH accepts).
349
+ * May be sent on its own, without destinations. To reject WITH a reason, or on a
350
+ * router that gates rejection on the receiver, use `profiles.rejectIntent` /
351
+ * {@link IntentInterface.reject} — the explicit reject endpoint.
352
+ * - Custody-offered seg/pool fields are updatable, with **omit = keep, not
353
+ * clear** semantics: the SDK never sends a clearing value for
354
+ * `sourceToSegregatedAccount` when you omit it, so the intent's existing
355
+ * value survives. To change it, pass a new one. (Per-destination pools ride
356
+ * along with the destinations that replace the list — replacing destinations
357
+ * without their pool fields does drop those pools, since the whole
358
+ * destination list is replaced.)
359
+ */
360
+ export interface UpdateMoveIntent {
361
+ assetId: string;
362
+ intentId: string;
363
+ destinationAsset?: MoveDestinationInput;
364
+ destinationAssets?: MoveDestinationInput[];
365
+ /**
366
+ * New source Release target. Omit to keep the intent's current value —
367
+ * omitting never clears it. See {@link CreateMoveIntent.sourceToSegregatedAccount}.
368
+ */
369
+ sourceToSegregatedAccount?: FinIdAccount;
370
+ start?: number;
371
+ end?: number;
372
+ status?: 'Rejected';
373
+ }
374
+ /**
375
+ * SDK input for executing a Move intent. The holder supplies the chosen
376
+ * destination asset (`destinationAssetId`); source and destination accounts
377
+ * are derived from the executor's public key and the resolved orgs. `amount`
378
+ * is optional — when omitted, the execution carries no asset term.
379
+ *
380
+ * `sourceCustodianOrgId` / `destinationCustodianOrgId` optionally override the
381
+ * custodian org used for each account. When omitted, both default to the
382
+ * executor's custodian org (the SDK's `custodianOrgId`). The node requires a
383
+ * non-empty custodian org, so one must resolve to a real value.
384
+ */
385
+ export interface MoveIntentExecutionData {
386
+ assetId: string;
387
+ intentId: string;
388
+ destinationAssetId: string;
389
+ amount?: string;
390
+ executionId?: string;
391
+ observers?: string[];
392
+ sourceCustodianOrgId?: string;
393
+ destinationCustodianOrgId?: string;
394
+ /** Optional custom metadata forwarded to the node (map of non-empty strings). */
395
+ metadata?: Record<string, string>;
396
+ }
@@ -1,3 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LOAN_ADDITIONAL_ACCOUNT_ALIASES = void 0;
4
+ /**
5
+ * The alias each leg is sent under: the name a loan policy references as
6
+ * contract_details.loan.additional_accounts.<alias> (finp2p-core #2708).
7
+ */
8
+ exports.LOAN_ADDITIONAL_ACCOUNT_ALIASES = {
9
+ openingLeg: 'lender_escrow',
10
+ closingLeg: 'borrower_escrow',
11
+ };
3
12
  //# sourceMappingURL=Intents.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Intents.js","sourceRoot":"","sources":["../../../src/types/Core/Intents.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"Intents.js","sourceRoot":"","sources":["../../../src/types/Core/Intents.ts"],"names":[],"mappings":";;;AAsJA;;;GAGG;AACU,QAAA,+BAA+B,GAAG;IAC7C,UAAU,EAAE,eAAe;IAC3B,UAAU,EAAE,iBAAiB;CACwC,CAAC"}