2021-07-13 12:34:51 -07:00
|
|
|
/*
|
|
|
|
|
Mocks for the Adapter library.
|
|
|
|
|
*/
|
|
|
|
|
|
2022-07-24 08:06:32 -07:00
|
|
|
class IpfsAdapter {
|
|
|
|
|
constructor () {
|
2022-07-24 08:14:27 -07:00
|
|
|
this.ipfs = {
|
|
|
|
|
files: {
|
|
|
|
|
stat: () => {}
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-24 08:06:32 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class IpfsCoordAdapter {
|
|
|
|
|
constructor () {
|
|
|
|
|
this.ipfsCoord = {
|
2023-11-01 14:17:24 -07:00
|
|
|
adapters: {
|
|
|
|
|
ipfs: {
|
|
|
|
|
connectToPeer: async () => {}
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-10-01 14:01:08 -07:00
|
|
|
useCases: {
|
|
|
|
|
peer: {
|
|
|
|
|
sendPrivateMessage: () => {}
|
|
|
|
|
}
|
2024-03-07 18:54:58 -08:00
|
|
|
},
|
|
|
|
|
thisNode: {}
|
2021-10-01 14:01:08 -07:00
|
|
|
}
|
2021-07-13 12:34:51 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-24 08:06:32 -07:00
|
|
|
const ipfs = {
|
|
|
|
|
ipfsAdapter: new IpfsAdapter(),
|
2023-10-28 09:17:48 -07:00
|
|
|
ipfsCoordAdapter: new IpfsCoordAdapter(),
|
|
|
|
|
getStatus: async () => {},
|
|
|
|
|
getPeers: async () => {},
|
|
|
|
|
getRelays: async () => {}
|
2022-07-24 08:06:32 -07:00
|
|
|
}
|
2022-07-24 08:14:27 -07:00
|
|
|
ipfs.ipfs = ipfs.ipfsAdapter.ipfs
|
2022-07-24 08:06:32 -07:00
|
|
|
|
2021-07-13 12:34:51 -07:00
|
|
|
const localdb = {
|
|
|
|
|
Users: class Users {
|
|
|
|
|
static findById () {}
|
|
|
|
|
static find () {}
|
|
|
|
|
static findOne () {
|
|
|
|
|
return {
|
|
|
|
|
validatePassword: localdb.validatePassword
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async save () {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
generateToken () {
|
|
|
|
|
return '123'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toJSON () {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async remove () {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async validatePassword () {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2025-06-27 20:11:27 -04:00
|
|
|
Usage: class Usage {
|
|
|
|
|
static findById () {}
|
|
|
|
|
static find () {}
|
|
|
|
|
static findOne () {
|
|
|
|
|
return {
|
|
|
|
|
validatePassword: localdb.validatePassword
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async save () {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
generateToken () {
|
|
|
|
|
return '123'
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
toJSON () {
|
|
|
|
|
return {}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async remove () {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async validatePassword () {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
static async deleteMany(){
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
2021-07-13 12:34:51 -07:00
|
|
|
validatePassword: () => {
|
|
|
|
|
return true
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-16 18:51:38 -07:00
|
|
|
const bchjs = {
|
|
|
|
|
Electrumx: {
|
|
|
|
|
transactions: () => {},
|
2022-01-28 08:03:35 -08:00
|
|
|
balance: () => {},
|
|
|
|
|
sortAllTxs: () => {}
|
2021-07-16 18:51:38 -07:00
|
|
|
},
|
|
|
|
|
Utxo: {
|
2022-05-10 10:14:37 -07:00
|
|
|
get: () => {},
|
|
|
|
|
isValid: () => true
|
2021-07-16 18:51:38 -07:00
|
|
|
},
|
|
|
|
|
Transaction: {
|
|
|
|
|
get: () => {}
|
|
|
|
|
},
|
|
|
|
|
RawTransactions: {
|
|
|
|
|
sendRawTransaction: () => {}
|
2021-11-23 19:25:01 -04:00
|
|
|
},
|
|
|
|
|
encryption: {
|
|
|
|
|
getPubKey: () => {}
|
2022-01-28 08:03:35 -08:00
|
|
|
},
|
|
|
|
|
Util: {
|
|
|
|
|
chunk100: () => {}
|
2022-05-10 11:14:11 -07:00
|
|
|
},
|
|
|
|
|
PsfSlpIndexer: {
|
2022-10-06 21:07:12 -07:00
|
|
|
getTokenData: () => {},
|
|
|
|
|
getTokenData2: () => {}
|
2021-07-16 18:51:38 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-03-22 10:59:22 -07:00
|
|
|
export default { ipfs, localdb, bchjs };
|