psf-multisig-approval 2.0.6 → 2.0.8

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.
Files changed (2) hide show
  1. package/index.js +20 -3
  2. package/package.json +1 -1
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
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psf-multisig-approval",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Utility library implementing the PS009 specification",
5
5
  "main": "index.js",
6
6
  "scripts": {