mirror of
https://github.com/Permissionless-Software-Foundation/x402-base-facilitator.git
synced 2026-09-21 16:52:01 -07:00
32 lines
821 B
JavaScript
32 lines
821 B
JavaScript
/*
|
|
This library contains business-logic for dealing with supported x402 payment transactions.
|
|
*/
|
|
|
|
import wlogger from '../adapters/wlogger.js'
|
|
|
|
class SupportedLib {
|
|
constructor (localConfig = {}) {
|
|
// console.log('User localConfig: ', localConfig)
|
|
this.adapters = localConfig.adapters
|
|
if (!this.adapters) {
|
|
throw new Error(
|
|
'Instance of adapters must be passed in when instantiating Supported Use Cases library.'
|
|
)
|
|
}
|
|
this.facilitator = this.adapters.facilitator.facilitator
|
|
}
|
|
|
|
async supported () {
|
|
try {
|
|
const response = this.facilitator.getSupported()
|
|
return response
|
|
} catch (err) {
|
|
// console.log('createUser() error: ', err)
|
|
wlogger.error('Error in lib/supported.js/supported()')
|
|
throw err
|
|
}
|
|
}
|
|
}
|
|
|
|
export default SupportedLib
|