@owneraio/finp2p-sdk-js 0.28.25 → 0.28.26

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 (34) hide show
  1. package/lib/OwneraAPI/finp2p-node-api/profiles.js +16 -7
  2. package/lib/OwneraAPI/finp2p-node-api/profiles.js.map +1 -1
  3. package/lib/OwneraAPI/oss-api/oss.js +33 -0
  4. package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
  5. package/lib/core/intents/createIntent/createMoveIntentReq.d.ts +28 -0
  6. package/lib/core/intents/createIntent/createMoveIntentReq.js +84 -0
  7. package/lib/core/intents/createIntent/createMoveIntentReq.js.map +1 -0
  8. package/lib/core/intents/createIntent/helpers.d.ts +28 -2
  9. package/lib/core/intents/createIntent/helpers.js +68 -1
  10. package/lib/core/intents/createIntent/helpers.js.map +1 -1
  11. package/lib/core/intents/executeMoveIntent.d.ts +19 -0
  12. package/lib/core/intents/executeMoveIntent.js +134 -0
  13. package/lib/core/intents/executeMoveIntent.js.map +1 -0
  14. package/lib/core/intents/getIntent.js +9 -0
  15. package/lib/core/intents/getIntent.js.map +1 -1
  16. package/lib/core/intents/index.d.ts +3 -0
  17. package/lib/core/intents/index.js +7 -1
  18. package/lib/core/intents/index.js.map +1 -1
  19. package/lib/core/intents/updateMoveIntentReq.d.ts +27 -0
  20. package/lib/core/intents/updateMoveIntentReq.js +92 -0
  21. package/lib/core/intents/updateMoveIntentReq.js.map +1 -0
  22. package/lib/core/intents/utils.js +1 -0
  23. package/lib/core/intents/utils.js.map +1 -1
  24. package/lib/core/user.js +55 -0
  25. package/lib/core/user.js.map +1 -1
  26. package/lib/types/Core/Intents.d.ts +131 -2
  27. package/lib/types/Core/User.d.ts +34 -1
  28. package/lib/types/Oss/OssSchemas.d.ts +39 -2
  29. package/lib/types/Oss/OssSchemas.js.map +1 -1
  30. package/lib/types/Profiles/Accounts.d.ts +32 -0
  31. package/lib/types/Profiles/Intents.d.ts +45 -2
  32. package/lib/types/Profiles/Profiles.d.ts +25 -1
  33. package/lib/types/Tokens/Tokens.d.ts +2 -0
  34. package/package.json +1 -1
@@ -1,6 +1,6 @@
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
2
  /**
3
- * Intent Interface allow to manage intent state (enable/disable)
3
+ * Intent Interface allow to manage intent state (enable/disable/cancel)
4
4
  */
5
5
  export interface IntentInterface {
6
6
  id: string;
@@ -14,6 +14,11 @@ export interface IntentInterface {
14
14
  *
15
15
  */
16
16
  disable: () => Promise<void>;
17
+ /**
18
+ * Cancel intent
19
+ *
20
+ */
21
+ cancel: () => Promise<void>;
17
22
  }
18
23
  export type SellingSettlementInstructionRequest = {
19
24
  destinationAccount: SettlementInstructionDestinationAccount[];
@@ -153,3 +158,127 @@ export interface CreateTransferRequest {
153
158
  transactionMetadata?: TransferRequestIntentMetadata;
154
159
  signaturePolicy: ManualSignaturePolicy;
155
160
  }
161
+ /**
162
+ * A move destination, optionally carrying a pre-funded pool account.
163
+ *
164
+ * Superset of {@link FinP2PAsset}, mirroring the node's `moveDestination` schema
165
+ * (which supersedes `finp2pAsset` in `moveAsset.destinationAssets`). The extra
166
+ * fields serve *custody-offered* Move: instead of minting on the destination,
167
+ * the `Transfer` drains a pre-funded pool account (the `hold-transfer-*`
168
+ * variants). Omit both for the issuer-offered path, which is unchanged.
169
+ *
170
+ * Node rules, both enforced server-side:
171
+ * - `fromSegregatedAccountOwner` is **required** when `fromSegregatedAccount` is
172
+ * set — it names the Transfer's seller (the debited party), needed for
173
+ * receipts and regulation. The SDK also checks this client-side and fails
174
+ * fast, since it needs no lookups.
175
+ * - The pool account **and** its owner must live on the **destination asset's
176
+ * org**. Cross-org pool placement is rejected by the node (not checked
177
+ * client-side — it would need a per-account org lookup — so it surfaces as a
178
+ * node 400).
179
+ */
180
+ export interface MoveDestinationInput extends FinP2PAsset {
181
+ /** Pre-funded pool the Transfer drains into this destination (`hold-transfer-*` variants). */
182
+ fromSegregatedAccount?: FinIdAccount;
183
+ /** Resource id of the pool owner / Transfer seller. Required when `fromSegregatedAccount` is set. */
184
+ fromSegregatedAccountOwner?: string;
185
+ }
186
+ /**
187
+ * SDK input for creating a Move intent. Declares an asset-level migration path
188
+ * from a single source asset (`assetId`) to one-or-more destination assets. The
189
+ * intent is created by the source asset's own org; any holder executes it by
190
+ * supplying their own accounts and picking one of the declared destinations.
191
+ * See {@link MoveIntentExecutionData} for the execution counterpart.
192
+ *
193
+ * Supply destinations via either `destinationAsset` (single) or
194
+ * `destinationAssets` (one-or-more) — both map to the node's
195
+ * `moveAsset.destinationAssets` list. When both are given, `destinationAssets`
196
+ * wins; at least one destination is required.
197
+ *
198
+ * `signaturePolicy` is optional (defaults to `manualPolicy`) and accepts either
199
+ * a manual or presigned policy, matching the node's `moveIntent` schema.
200
+ *
201
+ * Two optional fields enable *custody-offered* Move (see
202
+ * {@link MoveDestinationInput} and `sourceToSegregatedAccount`). Omitting both
203
+ * gives the issuer-offered path, where the source is redeemed (burned) on
204
+ * release — unchanged by their addition.
205
+ */
206
+ export interface CreateMoveIntent {
207
+ assetId: string;
208
+ start: number;
209
+ end: number;
210
+ /** Single destination. Convenience alias for a one-element `destinationAssets`. */
211
+ destinationAsset?: MoveDestinationInput;
212
+ /** One-or-more destinations. Takes precedence over `destinationAsset`. */
213
+ destinationAssets?: MoveDestinationInput[];
214
+ /**
215
+ * Custody-offered Move: release held source tokens to this segregated account
216
+ * on the source chain **instead of burning them**. Omit for the
217
+ * issuer-offered path (source is redeemed on release).
218
+ *
219
+ * Node rule: must live on the **source asset's org**. Cross-org placement is
220
+ * rejected server-side.
221
+ */
222
+ sourceToSegregatedAccount?: FinIdAccount;
223
+ signaturePolicy?: ManualSignaturePolicy | MovePresignedSignaturePolicy;
224
+ intentId?: string;
225
+ /** Optional custom metadata forwarded to the node (map of non-empty strings). */
226
+ metadata?: Record<string, string>;
227
+ }
228
+ /**
229
+ * SDK input for editing a Move intent. At least one editable field must be
230
+ * supplied — destinations, a new window, or a status change.
231
+ *
232
+ * - Destinations (`destinationAssets` preferred, or `destinationAsset` single
233
+ * alias) replace the intent's allowed destination list. The source asset is
234
+ * immutable. Given as SDK-facing {@link FinP2PAsset}s — the wrapper resolves
235
+ * each to its CAIP-19 wire shape, mirroring {@link CreateMoveIntent}. When
236
+ * destinations are provided, the node requires at least one.
237
+ * - `start` / `end` are optional epoch-millisecond window bounds.
238
+ * - `status: 'Rejected'` rejects the intent (the only status the node accepts).
239
+ * May be sent on its own, without destinations.
240
+ * - Custody-offered seg/pool fields are updatable, with **omit = keep, not
241
+ * clear** semantics: the SDK never sends a clearing value for
242
+ * `sourceToSegregatedAccount` when you omit it, so the intent's existing
243
+ * value survives. To change it, pass a new one. (Per-destination pools ride
244
+ * along with the destinations that replace the list — replacing destinations
245
+ * without their pool fields does drop those pools, since the whole
246
+ * destination list is replaced.)
247
+ */
248
+ export interface UpdateMoveIntent {
249
+ assetId: string;
250
+ intentId: string;
251
+ destinationAsset?: MoveDestinationInput;
252
+ destinationAssets?: MoveDestinationInput[];
253
+ /**
254
+ * New source Release target. Omit to keep the intent's current value —
255
+ * omitting never clears it. See {@link CreateMoveIntent.sourceToSegregatedAccount}.
256
+ */
257
+ sourceToSegregatedAccount?: FinIdAccount;
258
+ start?: number;
259
+ end?: number;
260
+ status?: 'Rejected';
261
+ }
262
+ /**
263
+ * SDK input for executing a Move intent. The holder supplies the chosen
264
+ * destination asset (`destinationAssetId`); source and destination accounts
265
+ * are derived from the executor's public key and the resolved orgs. `amount`
266
+ * is optional — when omitted, the execution carries no asset term.
267
+ *
268
+ * `sourceCustodianOrgId` / `destinationCustodianOrgId` optionally override the
269
+ * custodian org used for each account. When omitted, both default to the
270
+ * executor's custodian org (the SDK's `custodianOrgId`). The node requires a
271
+ * non-empty custodian org, so one must resolve to a real value.
272
+ */
273
+ export interface MoveIntentExecutionData {
274
+ assetId: string;
275
+ intentId: string;
276
+ destinationAssetId: string;
277
+ amount?: string;
278
+ executionId?: string;
279
+ observers?: string[];
280
+ sourceCustodianOrgId?: string;
281
+ destinationCustodianOrgId?: string;
282
+ /** Optional custom metadata forwarded to the node (map of non-empty strings). */
283
+ metadata?: Record<string, string>;
284
+ }
@@ -1,6 +1,6 @@
1
1
  import { IdResponse } from '../Commons';
2
2
  import { CertificateInterface } from './Certificates';
3
- import { CreateIntent, CreateLoanIntent, CreateTransferRequest, IntentExecution, IntentInterface, LoanIntentExecutionData, Transfer } from './Intents';
3
+ import { CreateIntent, CreateLoanIntent, CreateMoveIntent, CreateTransferRequest, IntentExecution, IntentInterface, LoanIntentExecutionData, MoveIntentExecutionData, Transfer, UpdateMoveIntent } from './Intents';
4
4
  import { MappedUser, ReceiptSchemaOss } from '../Oss';
5
5
  import { PaymentAccountResponse } from '../PaymentAdapter';
6
6
  import { ExecuteResponse } from '../Tokens';
@@ -188,6 +188,39 @@ export interface UserInterface extends IdResponse {
188
188
  *
189
189
  */
190
190
  updateTransferRequest: (data: UpdateTransferRequestIntentRequest, options?: CoreRequestOptions) => Promise<any>;
191
+ /**
192
+ * Create move intent
193
+ *
194
+ * The issuer declares a migration path from a source asset to a destination
195
+ * asset. Executed later by any holder via {@link executeMoveIntent}.
196
+ *
197
+ * @param createMoveIntent Request. See {@link CreateMoveIntent}
198
+ * @param options Options. See {@link CoreRequestOptions}
199
+ * @returns Promise with object. See {@link IdResponse}
200
+ */
201
+ createMoveIntent: (createMoveIntent: CreateMoveIntent, options?: CoreRequestOptions) => Promise<IdResponse>;
202
+ /**
203
+ * Update move intent
204
+ *
205
+ * Replaces a move intent's allowed destination assets (the source asset is
206
+ * immutable). Resolves each destination's CAIP-19 identifier, mirroring
207
+ * {@link createMoveIntent}, so callers pass SDK-facing `FinP2PAsset`s.
208
+ *
209
+ * @param updateMoveIntent Request. See {@link UpdateMoveIntent}
210
+ * @param options Options. See {@link CoreRequestOptions}
211
+ * @returns Promise that resolves when the intent is updated
212
+ */
213
+ updateMoveIntent: (updateMoveIntent: UpdateMoveIntent, options?: CoreRequestOptions) => Promise<void>;
214
+ /**
215
+ * Execute move intent
216
+ *
217
+ * The holder migrates their holding to the chosen destination asset.
218
+ *
219
+ * @param data Request. See {@link MoveIntentExecutionData}
220
+ * @param options Options. See {@link CoreRequestOptions}
221
+ * @returns Promise with object. See {@link ExecuteResponse}
222
+ */
223
+ executeMoveIntent: (data: MoveIntentExecutionData, options?: CoreRequestOptions) => Promise<ExecuteResponse>;
191
224
  }
192
225
  export interface SendMessageRequestFromClient {
193
226
  assetId: string;
@@ -188,7 +188,44 @@ export interface TransferRequestIntentSchemaOss {
188
188
  signaturePolicyType?: string;
189
189
  signaturePolicy?: Record<string, string>;
190
190
  }
191
- export type IntentDetailsSchemaOss = PrimarySaleSchemaOss | RedemptionIntentSchemaOss | BuyingIntentSchemaOss | SellingIntentSchemaOss | LoanIntentSchemaOss | PrivateIntentSchemaOss | TransferRequestIntentSchemaOss;
191
+ /**
192
+ * Move Intent Schema OSS (read model).
193
+ *
194
+ * `sourceAsset` / `destinationAssets` are top-level on the GraphQL `MoveIntent`
195
+ * type — not nested under an `asset` wrapper — matching the shared intent
196
+ * fragment (`...on MoveIntent { sourceAsset { resourceId } destinationAssets { resourceId } }`).
197
+ * This differs from the create request shape ({@link MoveIntentRequest}), where
198
+ * they sit under `asset`.
199
+ */
200
+ export interface MoveIntentSchemaOss {
201
+ sourceAsset: FinP2PAssetSchemaOss;
202
+ destinationAssets: MoveDestinationSchemaOss[];
203
+ /**
204
+ * Custody-offered Move: the segregated account held source tokens are
205
+ * Released to instead of being burned. Absent on issuer-offered intents.
206
+ */
207
+ sourceToSegregatedAccount?: FinP2PAccountSchemaOss;
208
+ signaturePolicyType?: string;
209
+ signaturePolicy?: Record<string, string>;
210
+ }
211
+ /**
212
+ * Move destination read model (GraphQL `MoveDestination`, which supersedes
213
+ * `FinP2PAsset` in `MoveIntent.destinationAssets`).
214
+ *
215
+ * `fromSegregatedAccount` is the pre-funded pool a custody-offered Move's
216
+ * Transfer drains into this destination. Its write-side companion
217
+ * `fromSegregatedAccountOwner` is deliberately absent — that field is write-only
218
+ * on create/update and has no OSS read counterpart.
219
+ *
220
+ * `ledgerIdentifier` exists on the GraphQL type but is not currently selected by
221
+ * the SDK's fragment, so it is not populated — see the fragment comment in
222
+ * `oss-api/oss.ts`.
223
+ */
224
+ export interface MoveDestinationSchemaOss {
225
+ resourceId: string;
226
+ fromSegregatedAccount?: FinP2PAccountSchemaOss;
227
+ }
228
+ export type IntentDetailsSchemaOss = PrimarySaleSchemaOss | RedemptionIntentSchemaOss | BuyingIntentSchemaOss | SellingIntentSchemaOss | LoanIntentSchemaOss | PrivateIntentSchemaOss | TransferRequestIntentSchemaOss | MoveIntentSchemaOss;
192
229
  export interface LoanAssetInstructionSchemaOss {
193
230
  borrowerAccount: FinP2PAssetAccountSchemaOss;
194
231
  lenderAccount: FinP2PAssetAccountSchemaOss;
@@ -204,7 +241,7 @@ export interface InterestRateTerm {
204
241
  export interface CloseAmountTerm {
205
242
  repaymentVolume: string;
206
243
  }
207
- export type IntentTypeSchemaOss = 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'redemptionIntent' | 'loanIntent' | 'privateOfferIntent' | 'requestForTransferIntent';
244
+ export type IntentTypeSchemaOss = 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'redemptionIntent' | 'loanIntent' | 'privateOfferIntent' | 'requestForTransferIntent' | 'moveIntent';
208
245
  export interface IssuerSchemaOss extends ProfileSchemaOss {
209
246
  name: string;
210
247
  assets: AssetsSchemaOss;
@@ -1 +1 @@
1
- {"version":3,"file":"OssSchemas.js","sourceRoot":"","sources":["../../../src/types/Oss/OssSchemas.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,kCAAW,CAAA;IACX,qCAAc,CAAA;IACd,wCAAiB,CAAA;AACnB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,sDAA2B,CAAA;IAC3B,wCAAa,CAAA;IACb,8CAAmB,CAAA;IACnB,4CAAiB,CAAA;AACnB,CAAC,EALW,uBAAuB,uCAAvB,uBAAuB,QAKlC;AAyFD,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;AACvB,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB;AAuWD,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,uCAA0B,CAAA;IAC1B,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,8CAAiC,CAAA;IACjC,+CAAkC,CAAA;IAClC,8BAAiB,CAAA;IACjB,4BAAe,CAAA;AACjB,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAOD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
1
+ {"version":3,"file":"OssSchemas.js","sourceRoot":"","sources":["../../../src/types/Oss/OssSchemas.ts"],"names":[],"mappings":";;;AAIA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,0CAAmB,CAAA;IACnB,sCAAe,CAAA;IACf,sCAAe,CAAA;IACf,kCAAW,CAAA;IACX,kCAAW,CAAA;IACX,qCAAc,CAAA;IACd,wCAAiB,CAAA;AACnB,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B;AAED,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,sDAA2B,CAAA;IAC3B,wCAAa,CAAA;IACb,8CAAmB,CAAA;IACnB,4CAAiB,CAAA;AACnB,CAAC,EALW,uBAAuB,uCAAvB,uBAAuB,QAKlC;AAyFD,IAAY,YAOX;AAPD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,yCAAyB,CAAA;IACzB,uCAAuB,CAAA;IACvB,uCAAuB,CAAA;IACvB,mCAAmB,CAAA;IACnB,qCAAqB,CAAA;AACvB,CAAC,EAPW,YAAY,4BAAZ,YAAY,QAOvB;AAgZD,IAAY,SAYX;AAZD,WAAY,SAAS;IACnB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,0BAAa,CAAA;IACb,uCAA0B,CAAA;IAC1B,oCAAuB,CAAA;IACvB,0BAAa,CAAA;IACb,8CAAiC,CAAA;IACjC,+CAAkC,CAAA;IAClC,8BAAiB,CAAA;IACjB,4BAAe,CAAA;AACjB,CAAC,EAZW,SAAS,yBAAT,SAAS,QAYpB;AAOD,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,oCAAe,CAAA;IACf,wCAAmB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
@@ -3,6 +3,38 @@ export interface FinP2PAsset {
3
3
  assetIdentifierType: typeof assetFinP2PType;
4
4
  resourceId: string;
5
5
  }
6
+ /**
7
+ * Node-shaped FinP2P asset (`finp2pAsset` schema): a resource id plus its
8
+ * CAIP-19 ledger identifier. This is the wire shape the node expects inside a
9
+ * move intent's `destinationAssets` (create and update), as opposed to the
10
+ * SDK-facing {@link FinP2PAsset}. The core create path resolves this from a
11
+ * {@link FinP2PAsset} via `buildCaip19Identifier`; the low-level
12
+ * `updateIntent` forwards it verbatim.
13
+ */
14
+ export interface Caip19FinP2PAsset {
15
+ id: string;
16
+ ledgerIdentifier: {
17
+ /** Always `'CAIP-19'` in practice; typed as string to match the core `buildCaip19Identifier` output. */
18
+ assetIdentifierType: string;
19
+ network: string;
20
+ standard: string;
21
+ tokenId: string;
22
+ };
23
+ }
24
+ /**
25
+ * Node-shaped move destination (`moveDestination` schema): a
26
+ * {@link Caip19FinP2PAsset} plus the optional pre-funded pool that a
27
+ * custody-offered Move's `Transfer` drains into this destination. Supersedes
28
+ * `finp2pAsset` in `moveAsset.destinationAssets` on both create and update.
29
+ *
30
+ * `fromSegregatedAccountOwner` is write-only — it sets the pool owner /
31
+ * Transfer seller and has no counterpart on the OSS read type
32
+ * ({@link MoveDestinationSchemaOss}).
33
+ */
34
+ export interface Caip19MoveDestination extends Caip19FinP2PAsset {
35
+ fromSegregatedAccount?: FinIdAccount;
36
+ fromSegregatedAccountOwner?: string;
37
+ }
6
38
  export interface CryptocurrencyAsset {
7
39
  type: 'cryptocurrency';
8
40
  code: CryptoCurrencyCode;
@@ -15,11 +15,20 @@ export interface PresignedIntentSignaturePolicy {
15
15
  nonce: string;
16
16
  type: 'presignedPolicy';
17
17
  }
18
+ /**
19
+ * Move intent presigned policy. The node's `moveIntent` schema defines
20
+ * `presignedPolicy` as `{ type }` only — no `nonce` (unlike loan/other intents,
21
+ * see {@link PresignedIntentSignaturePolicy}). Sending a `nonce` here risks
22
+ * rejection by the node's strict field validation.
23
+ */
24
+ export interface MovePresignedSignaturePolicy {
25
+ type: 'presignedPolicy';
26
+ }
18
27
  export interface ManualSignaturePolicy {
19
28
  type: 'manualPolicy';
20
29
  }
21
30
  export interface IntentRequestWithType {
22
- type: 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'redemptionIntent' | 'loanIntent' | 'privateOfferIntent';
31
+ type: 'primarySale' | 'buyingIntent' | 'sellingIntent' | 'redemptionIntent' | 'loanIntent' | 'privateOfferIntent' | 'moveIntent';
23
32
  }
24
33
  export interface IntentAsset {
25
34
  assetTerm: AssetTerm;
@@ -151,6 +160,35 @@ export interface ExecuteTransferRequestIntent {
151
160
  observers?: string[];
152
161
  }
153
162
  export type PrivateOfferIntentRequest = PrivateOfferTradeIntentRequest | PrivateOfferIssuanceIntentRequest | TransferRequestIntentRequest;
163
+ /**
164
+ * Move intent asset shape. Declares a single source asset and one-or-more
165
+ * allowed destination assets (migration targets). The SDK's `CreateMoveIntent`
166
+ * accepts either a single destination or a list; both resolve to this
167
+ * `destinationAssets` array.
168
+ *
169
+ * `sourceToSegregatedAccount` is the custody-offered addition: held source
170
+ * tokens are Released to it instead of being burned. Omitted for the
171
+ * issuer-offered path.
172
+ */
173
+ export interface MoveIntentAsset {
174
+ sourceAsset: FinP2PAsset;
175
+ destinationAssets: MoveDestination[];
176
+ sourceToSegregatedAccount?: FinIdAccount;
177
+ }
178
+ /**
179
+ * Node-shaped `moveDestination`: a destination asset plus its optional
180
+ * pre-funded pool. Superset of {@link FinP2PAsset}.
181
+ */
182
+ export interface MoveDestination extends FinP2PAsset {
183
+ fromSegregatedAccount?: FinIdAccount;
184
+ /** Write-only; required by the node when `fromSegregatedAccount` is set. */
185
+ fromSegregatedAccountOwner?: string;
186
+ }
187
+ export interface MoveIntentRequest extends IntentRequestWithType {
188
+ type: 'moveIntent';
189
+ asset: MoveIntentAsset;
190
+ signaturePolicy: ManualSignaturePolicy | MovePresignedSignaturePolicy;
191
+ }
154
192
  export interface LoanInstruction {
155
193
  closeDate: number;
156
194
  openDate: number;
@@ -185,10 +223,15 @@ export interface LoanIntent {
185
223
  loanInstruction: LoanInstruction;
186
224
  signaturePolicy: PresignedIntentSignaturePolicy;
187
225
  }
188
- export type IntentRequest = PrimarySaleIntentRequest | RedemptionIntentRequest | BuyingIntentRequest | SellingIntentRequest | LoanIntent | PrivateOfferIntentRequest;
226
+ export type IntentRequest = PrimarySaleIntentRequest | RedemptionIntentRequest | BuyingIntentRequest | SellingIntentRequest | LoanIntent | PrivateOfferIntentRequest | MoveIntentRequest;
189
227
  export interface IntentCoreRequest {
190
228
  start: number;
191
229
  end: number;
192
230
  intent: IntentRequest;
193
231
  intentId?: string;
232
+ /**
233
+ * Optional custom metadata (node `customMetadata`): a map of non-empty
234
+ * string key/value pairs for tracing/reconciliation, opaque to the Router.
235
+ */
236
+ metadata?: Record<string, string>;
194
237
  }
@@ -2,7 +2,7 @@ import { IdResponse, Operation, RequestOptions } from '../Commons';
2
2
  import { CreateTransferRequest } from '../Core';
3
3
  import { ExecuteTransferRequestIntent, IntentCoreRequest, UpdateTransferRequestIntentRequest } from './Intents';
4
4
  import { CryptoCurrencyCode, Iso4217Code } from '../utils';
5
- import { IntentUpdateSettlementTerm, IntentUpdateAssetTerm, FinIdAccount, FinP2PAsset } from './Accounts';
5
+ import { IntentUpdateSettlementTerm, IntentUpdateAssetTerm, FinIdAccount, FinP2PAsset, Caip19MoveDestination } from './Accounts';
6
6
  import { IntentTypeSchemaOss } from '../Oss';
7
7
  /**
8
8
  * Profiles Interface allow to create, update, share and manage state of different profile instances
@@ -98,6 +98,16 @@ export interface Profiles {
98
98
  *
99
99
  */
100
100
  disableIntent(r: IntentQuery, options?: RequestOptions): Promise<void>;
101
+ /**
102
+ * Cancel Intent
103
+ *
104
+ * @param r
105
+ * @param options
106
+ *
107
+ * @returns
108
+ *
109
+ */
110
+ cancelIntent(r: IntentQuery, options?: RequestOptions): Promise<void>;
101
111
  disableIntentTypes(r: IntentTypesRequest, options?: RequestOptions): Promise<void>;
102
112
  enableIntentTypes(r: IntentTypesRequest, options?: RequestOptions): Promise<void>;
103
113
  syncBalance(r: AccountBalanceSyncRequest, options?: RequestOptions): Promise<void>;
@@ -252,6 +262,20 @@ export interface UpdateIntentRequest extends IntentQuery {
252
262
  type: string;
253
263
  settlementTerm?: IntentUpdateSettlementTerm;
254
264
  assetTerm?: IntentUpdateAssetTerm;
265
+ /**
266
+ * Move intent only (`type: 'moveIntent'`). Replaces the intent's allowed
267
+ * destination assets — at least one is required, and the source asset is
268
+ * immutable. Node-shaped {@link Caip19MoveDestination} entries (each
269
+ * optionally carrying a pre-funded pool), forwarded to PATCH verbatim
270
+ * (resolve CAIP-19 before calling, as the create path does).
271
+ */
272
+ destinationAssets?: Caip19MoveDestination[];
273
+ /**
274
+ * Move intent only. New source Release target for custody-offered Move.
275
+ * The node preserves the intent's existing value when this is omitted, so
276
+ * callers must not send a clearing value to mean "unchanged".
277
+ */
278
+ sourceToSegregatedAccount?: FinIdAccount;
255
279
  };
256
280
  status?: string;
257
281
  }
@@ -257,6 +257,8 @@ export interface ExecuteRequest {
257
257
  intent: IntentExecutionType;
258
258
  executionId?: string;
259
259
  observers?: string[];
260
+ /** Optional custom metadata (node `customMetadata`): a map of non-empty strings. */
261
+ metadata?: Record<string, string>;
260
262
  }
261
263
  export interface ExecuteResponse extends Operation {
262
264
  type: 'execution';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@owneraio/finp2p-sdk-js",
3
3
  "main": "lib/index.js",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
- "version": "0.28.25",
5
+ "version": "0.28.26",
6
6
  "homepage": "https://ownera.io/",
7
7
  "scripts": {
8
8
  "build": "yarn clean && tsc",