-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First step for creating a layered architecture for connector interledger-deprecated/five-bells-ledger#112
- Loading branch information
Alan Cohen
committed
Mar 21, 2016
1 parent
cf896e6
commit 9e65f7a
Showing
8 changed files
with
210 additions
and
168 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
'use strict' | ||
|
||
const config = require('../services/config') | ||
|
||
function getMetadata () { | ||
return { | ||
public_key: config.getIn(['keys', 'ed25519', 'public']), | ||
urls: { | ||
health: '/health', | ||
pairs: '/pairs', | ||
payment: '/payments/:uuid', | ||
quote: '/quote', | ||
notifications: '/notifications' | ||
} | ||
} | ||
} | ||
|
||
module.exports = { | ||
getMetadata: getMetadata | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
'use strict' | ||
|
||
const Payments = require('../services/payments') | ||
|
||
function * processNotification (notification) { | ||
if (notification.event === 'transfer.update') { | ||
yield Payments.updateTransfer(notification.resource, notification.related_resources) | ||
} | ||
} | ||
|
||
module.exports = { | ||
processNotification: processNotification | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
'use strict' | ||
|
||
const config = require('../services/config') | ||
|
||
function getPairs () { | ||
const tradingPairs = config.get('tradingPairs') | ||
return tradingPairs.map((pair) => { | ||
const currencies = pair.map(function (currencyLedgerString) { | ||
return currencyLedgerString.split('@') | ||
}) | ||
return { | ||
source_asset: currencies[0][0], | ||
source_ledger: currencies[0][1], | ||
destination_asset: currencies[1][0], | ||
destination_ledger: currencies[1][1] | ||
} | ||
}) | ||
} | ||
|
||
module.exports = { | ||
getPairs: getPairs | ||
} |
Oops, something went wrong.