psf-multisig-approval 2.0.5 → 2.0.7
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/LICENSE.md +1 -1
- package/index.js +21 -4
- package/package.json +1 -1
package/LICENSE.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
|
-
Copyright (c) 2021 Chris Troutner <chris.troutner@gmail.com>
|
|
2
|
+
Copyright (c) 2021-2024 Chris Troutner <chris.troutner@gmail.com>
|
|
3
3
|
|
|
4
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
5
5
|
|
package/index.js
CHANGED
|
@@ -23,7 +23,8 @@ class MultisigApproval {
|
|
|
23
23
|
// is instantiated.
|
|
24
24
|
this.ipfsGateway = localConfig.ipfsGateway
|
|
25
25
|
if (!this.ipfsGateway) {
|
|
26
|
-
this.ipfsGateway = 'https://p2wdb-gateway-678.fullstack.cash'
|
|
26
|
+
// this.ipfsGateway = 'https://p2wdb-gateway-678.fullstack.cash'
|
|
27
|
+
this.ipfsGateway = 'https://pin.fullstack.cash'
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
// Encapsulate dependencies
|
|
@@ -135,7 +136,7 @@ class MultisigApproval {
|
|
|
135
136
|
|
|
136
137
|
// Get the transaction history for the address
|
|
137
138
|
const txHistory = await this.wallet.getTransactions(address)
|
|
138
|
-
|
|
139
|
+
console.log('txHistory: ', JSON.stringify(txHistory, null, 2))
|
|
139
140
|
|
|
140
141
|
// Loop through the transaction history
|
|
141
142
|
for (let i = 0; i < txHistory.length; i++) {
|
|
@@ -181,7 +182,7 @@ class MultisigApproval {
|
|
|
181
182
|
|
|
182
183
|
return null
|
|
183
184
|
} catch (err) {
|
|
184
|
-
console.error('Error in getApprovedData()')
|
|
185
|
+
console.error('Error in getApprovedData(): ', err)
|
|
185
186
|
throw err
|
|
186
187
|
}
|
|
187
188
|
}
|
|
@@ -237,7 +238,7 @@ class MultisigApproval {
|
|
|
237
238
|
throw new Error('cid a required input')
|
|
238
239
|
}
|
|
239
240
|
|
|
240
|
-
const urlStr = `${this.ipfsGateway}/ipfs/${cid}/data.json`
|
|
241
|
+
const urlStr = `${this.ipfsGateway}/ipfs/view/${cid}/data.json`
|
|
241
242
|
// console.log('urlStr: ', urlStr)
|
|
242
243
|
|
|
243
244
|
const request = await this.axios.get(urlStr)
|
|
@@ -324,6 +325,22 @@ class MultisigApproval {
|
|
|
324
325
|
throw err
|
|
325
326
|
}
|
|
326
327
|
}
|
|
328
|
+
|
|
329
|
+
// ToDo: This function will return an array of objects, where each object is
|
|
330
|
+
// a validated update transaction. It will provide a validated historical list
|
|
331
|
+
// of all the price updates.
|
|
332
|
+
// Each object in the array should contain a timestamp, a block height of the
|
|
333
|
+
// validated update transaction, and the price that was set with that tx.
|
|
334
|
+
//
|
|
335
|
+
getUpdateHistory () {
|
|
336
|
+
// address is an input value.
|
|
337
|
+
|
|
338
|
+
// Loop through the transaction history, and retrieve all APPROVAL transactions
|
|
339
|
+
|
|
340
|
+
// For each APPROVAL transaction, retrieve the UPDATE tx that it points to.
|
|
341
|
+
|
|
342
|
+
// Validate the UPDATE tx, if it passes, then add it to the output array
|
|
343
|
+
}
|
|
327
344
|
}
|
|
328
345
|
|
|
329
346
|
module.exports = MultisigApproval
|