@notabene/javascript-sdk 2.14.1 → 2.14.2-next.2
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.
- package/README.md +5 -4
- package/dist/cjs/notabene.cjs +23 -1
- package/dist/cjs/notabene.d.ts +79 -50
- package/dist/cjs/package.json +1 -1
- package/dist/esm/notabene.d.ts +79 -50
- package/dist/esm/notabene.js +12114 -454
- package/dist/esm/package.json +1 -1
- package/dist/notabene.d.ts +79 -50
- package/dist/notabene.js +12114 -454
- package/package.json +1 -1
- package/src/responseTransformer/__tests__/transformer.test.ts +638 -0
- package/src/responseTransformer/__tests__/utils.test.ts +35 -0
- package/src/responseTransformer/mappers.ts +88 -26
- package/src/responseTransformer/transformer.ts +121 -73
- package/src/responseTransformer/types.ts +12 -1
- package/src/responseTransformer/utils.ts +37 -1
- package/src/types.ts +6 -2
- package/src/utils/arbitraries.ts +1 -1
package/dist/cjs/notabene.d.ts
CHANGED
|
@@ -82,6 +82,11 @@ export declare enum AgentType {
|
|
|
82
82
|
VASP = "VASP"
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
declare interface BaseRequestConfig {
|
|
86
|
+
originatorId?: DID_2;
|
|
87
|
+
beneficiaryId?: DID_2;
|
|
88
|
+
}
|
|
89
|
+
|
|
85
90
|
/**
|
|
86
91
|
* Beneficiary
|
|
87
92
|
* Represents the receiver of the requested VA transfer
|
|
@@ -99,7 +104,7 @@ declare type Beneficiary = {
|
|
|
99
104
|
* @public
|
|
100
105
|
*/
|
|
101
106
|
declare type BeneficiaryFields = {
|
|
102
|
-
destination
|
|
107
|
+
destination: Destination;
|
|
103
108
|
};
|
|
104
109
|
|
|
105
110
|
declare type BeneficiaryV2 = {
|
|
@@ -331,32 +336,45 @@ export declare interface ComponentResponse {
|
|
|
331
336
|
/**
|
|
332
337
|
* Transforms a Notabene component response to IVMS101 format
|
|
333
338
|
*
|
|
339
|
+
* ## IVMS101 Config by Transaction Type
|
|
340
|
+
*
|
|
341
|
+
* The `originator` and `beneficiary` config options provide the customer's PII data.
|
|
342
|
+
* Which one to use depends on the transaction type:
|
|
343
|
+
*
|
|
344
|
+
* - **Withdrawals**: Pass `originator` - the customer is sending funds (customer = originator)
|
|
345
|
+
* - **Deposits**: Pass `beneficiary` - the customer is receiving funds (customer = beneficiary)
|
|
346
|
+
*
|
|
347
|
+
* For self-transfers, the provided data is automatically reused for both parties.
|
|
348
|
+
*
|
|
334
349
|
* @param response - The response from the Notabene Embedded Component
|
|
335
|
-
* @param delegateToken - The JWT delegate token for extracting the
|
|
350
|
+
* @param delegateToken - The JWT delegate token for extracting the customer ID
|
|
336
351
|
* @param config - Configuration object with optional IDs
|
|
337
|
-
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken
|
|
338
|
-
* @param config.beneficiaryId - Optional beneficiary ID (auto-
|
|
339
|
-
* @param config.
|
|
340
|
-
* @param config.
|
|
352
|
+
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken for withdrawals)
|
|
353
|
+
* @param config.beneficiaryId - Optional beneficiary ID (auto-extracted from delegateToken for deposits)
|
|
354
|
+
* @param config.originator - Customer's IVMS101 data for withdrawals (customer is the sender)
|
|
355
|
+
* @param config.beneficiary - Customer's IVMS101 data for deposits (customer is the receiver)
|
|
341
356
|
* @returns The transformed request body in IVMS101 format
|
|
342
357
|
*
|
|
343
358
|
* @example
|
|
344
359
|
* ```typescript
|
|
345
360
|
* import { componentResponseToIVMS101 } from '$lib/notabene-tx-transformer';
|
|
346
361
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
362
|
+
* // For withdrawals: pass originator (customer is sending)
|
|
363
|
+
* const withdrawalIvms = componentResponseToIVMS101(
|
|
364
|
+
* withdrawalResponse,
|
|
365
|
+
* delegateToken,
|
|
366
|
+
* { originator: customerIvmsData }
|
|
351
367
|
* );
|
|
352
368
|
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
369
|
+
* // For deposits: pass beneficiary (customer is receiving)
|
|
370
|
+
* const depositIvms = componentResponseToIVMS101(
|
|
371
|
+
* depositResponse,
|
|
372
|
+
* delegateToken,
|
|
373
|
+
* { beneficiary: customerIvmsData }
|
|
374
|
+
* );
|
|
357
375
|
* ```
|
|
358
376
|
*/
|
|
359
|
-
export declare function componentResponseToIVMS101(response: TransactionResponse<Withdrawal>, delegateToken: string, config?:
|
|
377
|
+
export declare function componentResponseToIVMS101(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToIVMS101RequestConfig): TransactionIVMS101Request;
|
|
360
378
|
|
|
361
379
|
/**
|
|
362
380
|
* Transforms a Notabene component response to a Version 2 transaction create API request body
|
|
@@ -373,9 +391,11 @@ export declare function componentResponseToIVMS101(response: TransactionResponse
|
|
|
373
391
|
* ```typescript
|
|
374
392
|
* import { componentResponseToTxCreateRequest } from '$lib/notabene-tx-transformer';
|
|
375
393
|
*
|
|
376
|
-
* withdrawal
|
|
394
|
+
* // Works with both withdrawal and deposit responses
|
|
395
|
+
* transaction.on('complete', async (result) => {
|
|
377
396
|
* const requestBody = componentResponseToTxCreateRequest(
|
|
378
397
|
* result.response,
|
|
398
|
+
* delegateToken,
|
|
379
399
|
* {
|
|
380
400
|
* originatorId: 'mailto:user@example.com',
|
|
381
401
|
* beneficiaryId: 'urn:beneficiary:recipient',
|
|
@@ -390,7 +410,7 @@ export declare function componentResponseToIVMS101(response: TransactionResponse
|
|
|
390
410
|
* });
|
|
391
411
|
* ```
|
|
392
412
|
*/
|
|
393
|
-
export declare function componentResponseToTxCreateRequest(response: TransactionResponse<Withdrawal>, delegateToken: string, config?:
|
|
413
|
+
export declare function componentResponseToTxCreateRequest(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToTxCreateRequestConfig): TransactionCreateRequestV2;
|
|
394
414
|
|
|
395
415
|
/**
|
|
396
416
|
* Transforms a Notabene component response into txCreate, IVMS101, and confirmRelationship request bodies
|
|
@@ -400,50 +420,50 @@ export declare function componentResponseToTxCreateRequest(response: Transaction
|
|
|
400
420
|
* which is useful for V2 workflows where you need to create a transaction first,
|
|
401
421
|
* then append IVMS101 data to it, and finally confirm the relationship.
|
|
402
422
|
*
|
|
423
|
+
* ## IVMS101 Config by Transaction Type
|
|
424
|
+
*
|
|
425
|
+
* The `originator` and `beneficiary` config options provide the customer's PII data.
|
|
426
|
+
* Which one to use depends on the transaction type:
|
|
427
|
+
*
|
|
428
|
+
* - **Withdrawals**: Pass `originator` - the customer is sending funds (customer = originator)
|
|
429
|
+
* - **Deposits**: Pass `beneficiary` - the customer is receiving funds (customer = beneficiary)
|
|
430
|
+
*
|
|
431
|
+
* For self-transfers, the provided data is automatically reused for both parties.
|
|
432
|
+
*
|
|
403
433
|
* @param response - The response from the Notabene Embedded Component
|
|
404
|
-
* @param delegateToken - The JWT delegate token for extracting the
|
|
434
|
+
* @param delegateToken - The JWT delegate token for extracting the customer ID
|
|
405
435
|
* @param config - Optional configuration for IDs and reference
|
|
406
|
-
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken
|
|
407
|
-
* @param config.beneficiaryId - Optional beneficiary ID (auto-
|
|
436
|
+
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken for withdrawals)
|
|
437
|
+
* @param config.beneficiaryId - Optional beneficiary ID (auto-extracted from delegateToken for deposits)
|
|
408
438
|
* @param config.referenceId - Optional reference ID (auto-generated if not provided)
|
|
409
|
-
* @param config.originator -
|
|
439
|
+
* @param config.originator - Customer's IVMS101 data for withdrawals (customer is the sender)
|
|
440
|
+
* @param config.beneficiary - Customer's IVMS101 data for deposits (customer is the receiver)
|
|
410
441
|
* @returns Object with `createTx`, `ivms101`, and optional `confirmRelationship` properties containing the respective request bodies
|
|
411
442
|
*
|
|
412
443
|
* @example
|
|
413
444
|
* ```typescript
|
|
414
445
|
* import { componentResponseToTxRequests } from '$lib/notabene-tx-transformer';
|
|
415
446
|
*
|
|
447
|
+
* // For withdrawals: pass originator (customer is sending)
|
|
416
448
|
* withdrawal.on('complete', async (result) => {
|
|
417
|
-
* const { createTx, ivms101
|
|
449
|
+
* const { createTx, ivms101 } = componentResponseToTxRequests(
|
|
418
450
|
* result.response,
|
|
419
|
-
*
|
|
420
|
-
* { originator:
|
|
451
|
+
* delegateToken,
|
|
452
|
+
* { originator: customerIvmsData }
|
|
421
453
|
* );
|
|
454
|
+
* });
|
|
422
455
|
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* const txId = txResponse.transfer['@id'];
|
|
431
|
-
* await fetch(`/entity/${vaspDid}/tx/${txId}/append`, {
|
|
432
|
-
* method: 'POST',
|
|
433
|
-
* body: JSON.stringify(ivms101)
|
|
434
|
-
* });
|
|
435
|
-
*
|
|
436
|
-
* // Finally, confirm relationship
|
|
437
|
-
* if (confirmRelationship) {
|
|
438
|
-
* await fetch(`/entity/${vaspDid}/relationship?to=${to}&from=${from}`, {
|
|
439
|
-
* method: 'PATCH',
|
|
440
|
-
* body: JSON.stringify({ proof: confirmRelationship.proof })
|
|
441
|
-
* });
|
|
442
|
-
* }
|
|
456
|
+
* // For deposits: pass beneficiary (customer is receiving)
|
|
457
|
+
* deposit.on('complete', async (result) => {
|
|
458
|
+
* const { createTx, ivms101 } = componentResponseToTxRequests(
|
|
459
|
+
* result.response,
|
|
460
|
+
* delegateToken,
|
|
461
|
+
* { beneficiary: customerIvmsData }
|
|
462
|
+
* );
|
|
443
463
|
* });
|
|
444
464
|
* ```
|
|
445
465
|
*/
|
|
446
|
-
export declare function componentResponseToTxRequests(response: TransactionResponse<Withdrawal>, delegateToken: string, config?: ResponseToTxRequestConfig): {
|
|
466
|
+
export declare function componentResponseToTxRequests(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToTxRequestConfig): {
|
|
447
467
|
createTx: TransactionCreateRequestV2;
|
|
448
468
|
ivms101: TransactionIVMS101Request;
|
|
449
469
|
confirmRelationship?: {
|
|
@@ -1475,7 +1495,7 @@ declare type Originator = {
|
|
|
1475
1495
|
* @public
|
|
1476
1496
|
*/
|
|
1477
1497
|
declare type OriginatorFields = {
|
|
1478
|
-
source
|
|
1498
|
+
source: Source | Source[];
|
|
1479
1499
|
};
|
|
1480
1500
|
|
|
1481
1501
|
declare type OriginatorV2 = {
|
|
@@ -1672,13 +1692,18 @@ export declare type ResizeRequest = {
|
|
|
1672
1692
|
height: number;
|
|
1673
1693
|
};
|
|
1674
1694
|
|
|
1675
|
-
|
|
1676
|
-
originatorId?: DID_2;
|
|
1677
|
-
beneficiaryId?: DID_2;
|
|
1678
|
-
referenceId?: string;
|
|
1695
|
+
declare interface ResponseToIVMS101RequestConfig extends BaseRequestConfig {
|
|
1679
1696
|
originator?: OriginatorV2;
|
|
1697
|
+
beneficiary?: BeneficiaryV2;
|
|
1680
1698
|
}
|
|
1681
1699
|
|
|
1700
|
+
declare interface ResponseToTxCreateRequestConfig extends BaseRequestConfig {
|
|
1701
|
+
referenceId?: string;
|
|
1702
|
+
settlementAddress?: string;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
export declare type ResponseToTxRequestConfig = ResponseToTxCreateRequestConfig & ResponseToIVMS101RequestConfig;
|
|
1706
|
+
|
|
1682
1707
|
/**
|
|
1683
1708
|
* Ownership Proof using Screenshot
|
|
1684
1709
|
* @public
|
|
@@ -1796,8 +1821,11 @@ export declare enum Status {
|
|
|
1796
1821
|
*/
|
|
1797
1822
|
export declare type Theme = {
|
|
1798
1823
|
mode: 'light' | 'dark';
|
|
1824
|
+
backgroundColor?: string;
|
|
1799
1825
|
primaryColor?: string;
|
|
1826
|
+
primaryForeground?: string;
|
|
1800
1827
|
secondaryColor?: string;
|
|
1828
|
+
secondaryForeground?: string;
|
|
1801
1829
|
fontFamily?: string;
|
|
1802
1830
|
logo?: string;
|
|
1803
1831
|
};
|
|
@@ -1922,6 +1950,7 @@ export declare interface TransactionOptions {
|
|
|
1922
1950
|
hide?: ValidationSections[];
|
|
1923
1951
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
1924
1952
|
autoSubmit?: boolean;
|
|
1953
|
+
supportUrl?: string;
|
|
1925
1954
|
}
|
|
1926
1955
|
|
|
1927
1956
|
/**
|
package/dist/cjs/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "Notabene <developers@notabene.id>",
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"packageManager": "yarn@4.5.1",
|
|
13
|
-
"version": "2.14.
|
|
13
|
+
"version": "2.14.2-next.2",
|
|
14
14
|
"source": "src/notabene.ts",
|
|
15
15
|
"main": "dist/cjs/notabene.cjs",
|
|
16
16
|
"module": "dist/esm/notabene.js",
|
package/dist/esm/notabene.d.ts
CHANGED
|
@@ -82,6 +82,11 @@ export declare enum AgentType {
|
|
|
82
82
|
VASP = "VASP"
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
declare interface BaseRequestConfig {
|
|
86
|
+
originatorId?: DID_2;
|
|
87
|
+
beneficiaryId?: DID_2;
|
|
88
|
+
}
|
|
89
|
+
|
|
85
90
|
/**
|
|
86
91
|
* Beneficiary
|
|
87
92
|
* Represents the receiver of the requested VA transfer
|
|
@@ -99,7 +104,7 @@ declare type Beneficiary = {
|
|
|
99
104
|
* @public
|
|
100
105
|
*/
|
|
101
106
|
declare type BeneficiaryFields = {
|
|
102
|
-
destination
|
|
107
|
+
destination: Destination;
|
|
103
108
|
};
|
|
104
109
|
|
|
105
110
|
declare type BeneficiaryV2 = {
|
|
@@ -331,32 +336,45 @@ export declare interface ComponentResponse {
|
|
|
331
336
|
/**
|
|
332
337
|
* Transforms a Notabene component response to IVMS101 format
|
|
333
338
|
*
|
|
339
|
+
* ## IVMS101 Config by Transaction Type
|
|
340
|
+
*
|
|
341
|
+
* The `originator` and `beneficiary` config options provide the customer's PII data.
|
|
342
|
+
* Which one to use depends on the transaction type:
|
|
343
|
+
*
|
|
344
|
+
* - **Withdrawals**: Pass `originator` - the customer is sending funds (customer = originator)
|
|
345
|
+
* - **Deposits**: Pass `beneficiary` - the customer is receiving funds (customer = beneficiary)
|
|
346
|
+
*
|
|
347
|
+
* For self-transfers, the provided data is automatically reused for both parties.
|
|
348
|
+
*
|
|
334
349
|
* @param response - The response from the Notabene Embedded Component
|
|
335
|
-
* @param delegateToken - The JWT delegate token for extracting the
|
|
350
|
+
* @param delegateToken - The JWT delegate token for extracting the customer ID
|
|
336
351
|
* @param config - Configuration object with optional IDs
|
|
337
|
-
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken
|
|
338
|
-
* @param config.beneficiaryId - Optional beneficiary ID (auto-
|
|
339
|
-
* @param config.
|
|
340
|
-
* @param config.
|
|
352
|
+
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken for withdrawals)
|
|
353
|
+
* @param config.beneficiaryId - Optional beneficiary ID (auto-extracted from delegateToken for deposits)
|
|
354
|
+
* @param config.originator - Customer's IVMS101 data for withdrawals (customer is the sender)
|
|
355
|
+
* @param config.beneficiary - Customer's IVMS101 data for deposits (customer is the receiver)
|
|
341
356
|
* @returns The transformed request body in IVMS101 format
|
|
342
357
|
*
|
|
343
358
|
* @example
|
|
344
359
|
* ```typescript
|
|
345
360
|
* import { componentResponseToIVMS101 } from '$lib/notabene-tx-transformer';
|
|
346
361
|
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
362
|
+
* // For withdrawals: pass originator (customer is sending)
|
|
363
|
+
* const withdrawalIvms = componentResponseToIVMS101(
|
|
364
|
+
* withdrawalResponse,
|
|
365
|
+
* delegateToken,
|
|
366
|
+
* { originator: customerIvmsData }
|
|
351
367
|
* );
|
|
352
368
|
*
|
|
353
|
-
*
|
|
354
|
-
*
|
|
355
|
-
*
|
|
356
|
-
*
|
|
369
|
+
* // For deposits: pass beneficiary (customer is receiving)
|
|
370
|
+
* const depositIvms = componentResponseToIVMS101(
|
|
371
|
+
* depositResponse,
|
|
372
|
+
* delegateToken,
|
|
373
|
+
* { beneficiary: customerIvmsData }
|
|
374
|
+
* );
|
|
357
375
|
* ```
|
|
358
376
|
*/
|
|
359
|
-
export declare function componentResponseToIVMS101(response: TransactionResponse<Withdrawal>, delegateToken: string, config?:
|
|
377
|
+
export declare function componentResponseToIVMS101(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToIVMS101RequestConfig): TransactionIVMS101Request;
|
|
360
378
|
|
|
361
379
|
/**
|
|
362
380
|
* Transforms a Notabene component response to a Version 2 transaction create API request body
|
|
@@ -373,9 +391,11 @@ export declare function componentResponseToIVMS101(response: TransactionResponse
|
|
|
373
391
|
* ```typescript
|
|
374
392
|
* import { componentResponseToTxCreateRequest } from '$lib/notabene-tx-transformer';
|
|
375
393
|
*
|
|
376
|
-
* withdrawal
|
|
394
|
+
* // Works with both withdrawal and deposit responses
|
|
395
|
+
* transaction.on('complete', async (result) => {
|
|
377
396
|
* const requestBody = componentResponseToTxCreateRequest(
|
|
378
397
|
* result.response,
|
|
398
|
+
* delegateToken,
|
|
379
399
|
* {
|
|
380
400
|
* originatorId: 'mailto:user@example.com',
|
|
381
401
|
* beneficiaryId: 'urn:beneficiary:recipient',
|
|
@@ -390,7 +410,7 @@ export declare function componentResponseToIVMS101(response: TransactionResponse
|
|
|
390
410
|
* });
|
|
391
411
|
* ```
|
|
392
412
|
*/
|
|
393
|
-
export declare function componentResponseToTxCreateRequest(response: TransactionResponse<Withdrawal>, delegateToken: string, config?:
|
|
413
|
+
export declare function componentResponseToTxCreateRequest(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToTxCreateRequestConfig): TransactionCreateRequestV2;
|
|
394
414
|
|
|
395
415
|
/**
|
|
396
416
|
* Transforms a Notabene component response into txCreate, IVMS101, and confirmRelationship request bodies
|
|
@@ -400,50 +420,50 @@ export declare function componentResponseToTxCreateRequest(response: Transaction
|
|
|
400
420
|
* which is useful for V2 workflows where you need to create a transaction first,
|
|
401
421
|
* then append IVMS101 data to it, and finally confirm the relationship.
|
|
402
422
|
*
|
|
423
|
+
* ## IVMS101 Config by Transaction Type
|
|
424
|
+
*
|
|
425
|
+
* The `originator` and `beneficiary` config options provide the customer's PII data.
|
|
426
|
+
* Which one to use depends on the transaction type:
|
|
427
|
+
*
|
|
428
|
+
* - **Withdrawals**: Pass `originator` - the customer is sending funds (customer = originator)
|
|
429
|
+
* - **Deposits**: Pass `beneficiary` - the customer is receiving funds (customer = beneficiary)
|
|
430
|
+
*
|
|
431
|
+
* For self-transfers, the provided data is automatically reused for both parties.
|
|
432
|
+
*
|
|
403
433
|
* @param response - The response from the Notabene Embedded Component
|
|
404
|
-
* @param delegateToken - The JWT delegate token for extracting the
|
|
434
|
+
* @param delegateToken - The JWT delegate token for extracting the customer ID
|
|
405
435
|
* @param config - Optional configuration for IDs and reference
|
|
406
|
-
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken
|
|
407
|
-
* @param config.beneficiaryId - Optional beneficiary ID (auto-
|
|
436
|
+
* @param config.originatorId - Optional originator ID (auto-extracted from delegateToken for withdrawals)
|
|
437
|
+
* @param config.beneficiaryId - Optional beneficiary ID (auto-extracted from delegateToken for deposits)
|
|
408
438
|
* @param config.referenceId - Optional reference ID (auto-generated if not provided)
|
|
409
|
-
* @param config.originator -
|
|
439
|
+
* @param config.originator - Customer's IVMS101 data for withdrawals (customer is the sender)
|
|
440
|
+
* @param config.beneficiary - Customer's IVMS101 data for deposits (customer is the receiver)
|
|
410
441
|
* @returns Object with `createTx`, `ivms101`, and optional `confirmRelationship` properties containing the respective request bodies
|
|
411
442
|
*
|
|
412
443
|
* @example
|
|
413
444
|
* ```typescript
|
|
414
445
|
* import { componentResponseToTxRequests } from '$lib/notabene-tx-transformer';
|
|
415
446
|
*
|
|
447
|
+
* // For withdrawals: pass originator (customer is sending)
|
|
416
448
|
* withdrawal.on('complete', async (result) => {
|
|
417
|
-
* const { createTx, ivms101
|
|
449
|
+
* const { createTx, ivms101 } = componentResponseToTxRequests(
|
|
418
450
|
* result.response,
|
|
419
|
-
*
|
|
420
|
-
* { originator:
|
|
451
|
+
* delegateToken,
|
|
452
|
+
* { originator: customerIvmsData }
|
|
421
453
|
* );
|
|
454
|
+
* });
|
|
422
455
|
*
|
|
423
|
-
*
|
|
424
|
-
*
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
*
|
|
429
|
-
*
|
|
430
|
-
* const txId = txResponse.transfer['@id'];
|
|
431
|
-
* await fetch(`/entity/${vaspDid}/tx/${txId}/append`, {
|
|
432
|
-
* method: 'POST',
|
|
433
|
-
* body: JSON.stringify(ivms101)
|
|
434
|
-
* });
|
|
435
|
-
*
|
|
436
|
-
* // Finally, confirm relationship
|
|
437
|
-
* if (confirmRelationship) {
|
|
438
|
-
* await fetch(`/entity/${vaspDid}/relationship?to=${to}&from=${from}`, {
|
|
439
|
-
* method: 'PATCH',
|
|
440
|
-
* body: JSON.stringify({ proof: confirmRelationship.proof })
|
|
441
|
-
* });
|
|
442
|
-
* }
|
|
456
|
+
* // For deposits: pass beneficiary (customer is receiving)
|
|
457
|
+
* deposit.on('complete', async (result) => {
|
|
458
|
+
* const { createTx, ivms101 } = componentResponseToTxRequests(
|
|
459
|
+
* result.response,
|
|
460
|
+
* delegateToken,
|
|
461
|
+
* { beneficiary: customerIvmsData }
|
|
462
|
+
* );
|
|
443
463
|
* });
|
|
444
464
|
* ```
|
|
445
465
|
*/
|
|
446
|
-
export declare function componentResponseToTxRequests(response: TransactionResponse<Withdrawal>, delegateToken: string, config?: ResponseToTxRequestConfig): {
|
|
466
|
+
export declare function componentResponseToTxRequests(response: TransactionResponse<Withdrawal | Deposit>, delegateToken: string, config?: ResponseToTxRequestConfig): {
|
|
447
467
|
createTx: TransactionCreateRequestV2;
|
|
448
468
|
ivms101: TransactionIVMS101Request;
|
|
449
469
|
confirmRelationship?: {
|
|
@@ -1475,7 +1495,7 @@ declare type Originator = {
|
|
|
1475
1495
|
* @public
|
|
1476
1496
|
*/
|
|
1477
1497
|
declare type OriginatorFields = {
|
|
1478
|
-
source
|
|
1498
|
+
source: Source | Source[];
|
|
1479
1499
|
};
|
|
1480
1500
|
|
|
1481
1501
|
declare type OriginatorV2 = {
|
|
@@ -1672,13 +1692,18 @@ export declare type ResizeRequest = {
|
|
|
1672
1692
|
height: number;
|
|
1673
1693
|
};
|
|
1674
1694
|
|
|
1675
|
-
|
|
1676
|
-
originatorId?: DID_2;
|
|
1677
|
-
beneficiaryId?: DID_2;
|
|
1678
|
-
referenceId?: string;
|
|
1695
|
+
declare interface ResponseToIVMS101RequestConfig extends BaseRequestConfig {
|
|
1679
1696
|
originator?: OriginatorV2;
|
|
1697
|
+
beneficiary?: BeneficiaryV2;
|
|
1680
1698
|
}
|
|
1681
1699
|
|
|
1700
|
+
declare interface ResponseToTxCreateRequestConfig extends BaseRequestConfig {
|
|
1701
|
+
referenceId?: string;
|
|
1702
|
+
settlementAddress?: string;
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
export declare type ResponseToTxRequestConfig = ResponseToTxCreateRequestConfig & ResponseToIVMS101RequestConfig;
|
|
1706
|
+
|
|
1682
1707
|
/**
|
|
1683
1708
|
* Ownership Proof using Screenshot
|
|
1684
1709
|
* @public
|
|
@@ -1796,8 +1821,11 @@ export declare enum Status {
|
|
|
1796
1821
|
*/
|
|
1797
1822
|
export declare type Theme = {
|
|
1798
1823
|
mode: 'light' | 'dark';
|
|
1824
|
+
backgroundColor?: string;
|
|
1799
1825
|
primaryColor?: string;
|
|
1826
|
+
primaryForeground?: string;
|
|
1800
1827
|
secondaryColor?: string;
|
|
1828
|
+
secondaryForeground?: string;
|
|
1801
1829
|
fontFamily?: string;
|
|
1802
1830
|
logo?: string;
|
|
1803
1831
|
};
|
|
@@ -1922,6 +1950,7 @@ export declare interface TransactionOptions {
|
|
|
1922
1950
|
hide?: ValidationSections[];
|
|
1923
1951
|
counterpartyAssist?: CounterpartyAssistConfig;
|
|
1924
1952
|
autoSubmit?: boolean;
|
|
1953
|
+
supportUrl?: string;
|
|
1925
1954
|
}
|
|
1926
1955
|
|
|
1927
1956
|
/**
|