@owneraio/finp2p-sdk-js 0.28.24 → 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 (48) hide show
  1. package/lib/OwneraAPI/finp2p-node-api/data.d.ts +13 -0
  2. package/lib/OwneraAPI/finp2p-node-api/data.js +58 -0
  3. package/lib/OwneraAPI/finp2p-node-api/data.js.map +1 -0
  4. package/lib/OwneraAPI/finp2p-node-api/profiles.js +16 -7
  5. package/lib/OwneraAPI/finp2p-node-api/profiles.js.map +1 -1
  6. package/lib/OwneraAPI/index.js +2 -0
  7. package/lib/OwneraAPI/index.js.map +1 -1
  8. package/lib/OwneraAPI/oss-api/oss.js +89 -3
  9. package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
  10. package/lib/core/intents/createIntent/createMoveIntentReq.d.ts +28 -0
  11. package/lib/core/intents/createIntent/createMoveIntentReq.js +84 -0
  12. package/lib/core/intents/createIntent/createMoveIntentReq.js.map +1 -0
  13. package/lib/core/intents/createIntent/helpers.d.ts +28 -2
  14. package/lib/core/intents/createIntent/helpers.js +68 -1
  15. package/lib/core/intents/createIntent/helpers.js.map +1 -1
  16. package/lib/core/intents/executeMoveIntent.d.ts +19 -0
  17. package/lib/core/intents/executeMoveIntent.js +134 -0
  18. package/lib/core/intents/executeMoveIntent.js.map +1 -0
  19. package/lib/core/intents/getIntent.js +9 -0
  20. package/lib/core/intents/getIntent.js.map +1 -1
  21. package/lib/core/intents/index.d.ts +3 -0
  22. package/lib/core/intents/index.js +7 -1
  23. package/lib/core/intents/index.js.map +1 -1
  24. package/lib/core/intents/updateMoveIntentReq.d.ts +27 -0
  25. package/lib/core/intents/updateMoveIntentReq.js +92 -0
  26. package/lib/core/intents/updateMoveIntentReq.js.map +1 -0
  27. package/lib/core/intents/utils.js +1 -0
  28. package/lib/core/intents/utils.js.map +1 -1
  29. package/lib/core/user.js +55 -0
  30. package/lib/core/user.js.map +1 -1
  31. package/lib/types/AssetData/index.d.ts +142 -0
  32. package/lib/types/AssetData/index.js +3 -0
  33. package/lib/types/AssetData/index.js.map +1 -0
  34. package/lib/types/Core/Intents.d.ts +131 -2
  35. package/lib/types/Core/OwneraAPI.d.ts +2 -0
  36. package/lib/types/Core/User.d.ts +34 -1
  37. package/lib/types/Oss/FinancialAsset.d.ts +21 -5
  38. package/lib/types/Oss/Oss.d.ts +12 -1
  39. package/lib/types/Oss/OssSchemas.d.ts +39 -2
  40. package/lib/types/Oss/OssSchemas.js.map +1 -1
  41. package/lib/types/Profiles/Accounts.d.ts +32 -0
  42. package/lib/types/Profiles/Intents.d.ts +45 -2
  43. package/lib/types/Profiles/Profiles.d.ts +25 -1
  44. package/lib/types/Tokens/Tokens.d.ts +2 -0
  45. package/lib/types/index.d.ts +1 -0
  46. package/lib/types/index.js +1 -0
  47. package/lib/types/index.js.map +1 -1
  48. package/package.json +1 -1
@@ -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';
@@ -1,4 +1,5 @@
1
1
  export * from './ApprovalsConfig';
2
+ export * from './AssetData';
2
3
  export * from './Auth';
3
4
  export * from './Certificates';
4
5
  export * from './Commons';
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ApprovalsConfig"), exports);
18
+ __exportStar(require("./AssetData"), exports);
18
19
  __exportStar(require("./Auth"), exports);
19
20
  __exportStar(require("./Certificates"), exports);
20
21
  __exportStar(require("./Commons"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,yCAAuB;AACvB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,6CAA2B;AAC3B,+CAA6B;AAC7B,kDAAgC;AAChC,wCAAsB;AACtB,mDAAiC;AACjC,6CAA2B;AAC3B,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA2B;AAC3B,wDAAsC;AACtC,2CAAyB;AACzB,0CAAwB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,8CAA4B;AAC5B,yCAAuB;AACvB,iDAA+B;AAC/B,4CAA0B;AAC1B,yCAAuB;AACvB,8CAA4B;AAC5B,4CAA0B;AAC1B,6CAA2B;AAC3B,+CAA6B;AAC7B,kDAAgC;AAChC,wCAAsB;AACtB,mDAAiC;AACjC,6CAA2B;AAC3B,kDAAgC;AAChC,6CAA2B;AAC3B,6CAA2B;AAC3B,wDAAsC;AACtC,2CAAyB;AACzB,0CAAwB"}
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.24",
5
+ "version": "0.28.26",
6
6
  "homepage": "https://ownera.io/",
7
7
  "scripts": {
8
8
  "build": "yarn clean && tsc",