Skip to content

Commit 3663832

Browse files
kleyowgeka-evk
andauthored
chore: support sdk added expiration (#219)
* chore: support sdk added expiration * chore: fixed ilp expiration * chore: extended codeowners list * chore(snapshot): 19.3.1-snapshot.0 --------- Co-authored-by: geka.evk <geka.evk@gmail.com>
1 parent d68ef3f commit 3663832

5 files changed

Lines changed: 54 additions & 48 deletions

File tree

‎CODEOWNERS‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# These owners will be the default owners for everything in
22
# the repo. Unless a later match takes precedence,
3-
# @kirgene @mdebarros @elnyry-sam-k @lewisdaly @bushjames @kleyow
3+
# @kirgene @elnyry-sam-k @lewisdaly @bushjames @kleyow @mdebarros @vijayg10 @oderayi @geka-evk
44
# will be requested for review when someone opens a pull request.
55

6-
* @kirgene @elnyry-sam-k @lewisdaly @bushjames @kleyow @mdebarros
6+
* @kirgene @elnyry-sam-k @lewisdaly @bushjames @kleyow @mdebarros @vijayg10 @oderayi @geka-evk

‎package-lock.json‎

Lines changed: 33 additions & 33 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@mojaloop/sdk-standard-components",
3-
"version": "19.3.0",
3+
"version": "19.3.1-snapshot.0",
44
"description": "A set of standard components for connecting to Mojaloop API enabled Switches",
55
"main": "src/index.js",
66
"types": "src/index.d.ts",
@@ -40,7 +40,7 @@
4040
}
4141
],
4242
"dependencies": {
43-
"@mojaloop/ml-schema-transformer-lib": "^2.0.1",
43+
"@mojaloop/ml-schema-transformer-lib": "^2.1.0",
4444
"base64url": "3.0.1",
4545
"fast-safe-stringify": "^2.1.1",
4646
"ilp-packet": "3.1.3",
@@ -61,17 +61,17 @@
6161
}
6262
},
6363
"devDependencies": {
64-
"@mojaloop/api-snippets": "^17.7.2",
64+
"@mojaloop/api-snippets": "^17.7.3",
6565
"@types/jest": "^29.5.14",
66-
"@types/node": "^22.8.1",
66+
"@types/node": "^22.8.4",
6767
"audit-ci": "^7.1.0",
6868
"eslint": "8.57.0",
6969
"eslint-config-airbnb-base": "15.0.0",
7070
"eslint-plugin-import": "2.31.0",
7171
"jest": "^29.7.0",
7272
"jest-junit": "^16.0.0",
7373
"nock": "^13.5.5",
74-
"npm-check-updates": "^17.1.8",
74+
"npm-check-updates": "^17.1.9",
7575
"pre-commit": "^1.2.2",
7676
"replace": "^1.2.2",
7777
"standard-version": "^9.5.0",

‎src/lib/dto.js‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
/**
2-
* Creates an immutable transaction object.
3-
*
4-
* @param {Object} quoteRequest - The request object containing quote payload.
2+
* @typedef {Object} QuoteRequest
53
* @property {string} quoteId - Common ID between the FSPs for the quote object.
64
* @property {string} transactionId - Common ID (decided by the Payer FSP) between the FSPs for the future transaction object.
75
* @property {TransactionType} transactionType - Type of transaction for which the quote is requested.
86
* @property {Party} payee - Information about the Payee.
97
* @property {Party} payer - Information about the Payer.
10-
* @property {string} expiration - Expiration date and time of the quote (Date string).
11-
*
12-
* @param {Object} quoteResponse - The response object containing additional transaction details.
8+
*/
9+
/**
10+
* @typedef {Object} QuoteResponse
1311
* @property {Money} transferAmount - The amount of Money that the Payer FSP should transfer to the Payee FSP.
12+
* @property {string} expiration - Expiration date and time of the quote (Date string).
1413
* @property {string} [note] - note // no such param in API spec
14+
*/
15+
16+
/**
17+
* Creates an immutable transaction object.
1518
*
19+
* @param {QuoteRequest} quoteRequest - The request object containing quote payload.
20+
* @param {QuoteResponse} quoteResponse - The response object containing additional transaction details.
1621
* @returns {Object} The immutable transaction object.
1722
*/
1823
const transactionObjectDto = (quoteRequest, quoteResponse) => {
19-
const { quoteId, transactionId, transactionType, payee, payer, expiration } = quoteRequest;
20-
const { transferAmount, note } = quoteResponse;
24+
const { quoteId, transactionId, transactionType, payee, payer } = quoteRequest;
25+
const { transferAmount, expiration, note } = quoteResponse;
2126
return Object.freeze({
2227
quoteId,
2328
transactionId,

‎test/unit/lib/ilp/IlpV4.test.js‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ describe('IlpV4 Tests -->', () => {
203203
expect(transaction.payee).toEqual(quoteRequest.payee);
204204
expect(transaction.payer).toEqual(quoteRequest.payer);
205205
expect(transaction.amount).toEqual(partialResponse.transferAmount);
206+
expect(transaction.expiration).toEqual(partialResponse.expiration);
206207
});
207208

208209
test('should validate the transfer request against the decoded Ilp packet', () => {

0 commit comments

Comments
 (0)