psf-multisig-approval 2.0.9 → 2.0.10

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 +13 -3
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -242,10 +242,20 @@ class MultisigApproval {
242
242
  throw new Error('cid a required input')
243
243
  }
244
244
 
245
- const urlStr = `${this.ipfsGateway}/ipfs/view/${cid}/data.json`
246
- // console.log('urlStr: ', urlStr)
245
+ let request = null
246
+ try {
247
+ // Try older token-tiger format first (directory-based CID)
248
+ const urlStr = `${this.ipfsGateway}/ipfs/view/${cid}/data.json`
249
+ // console.log('urlStr: ', urlStr)
250
+
251
+ request = await this.axios.get(urlStr)
252
+ } catch (err) {
253
+ // Try the new format (single file CID)
254
+ const urlStr = `${this.ipfsGateway}/ipfs/view/${cid}`
255
+ // console.log('urlStr: ', urlStr)
247
256
 
248
- const request = await this.axios.get(urlStr)
257
+ request = await this.axios.get(urlStr)
258
+ }
249
259
 
250
260
  return request.data
251
261
  } catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "psf-multisig-approval",
3
- "version": "2.0.9",
3
+ "version": "2.0.10",
4
4
  "description": "Utility library implementing the PS009 specification",
5
5
  "main": "index.js",
6
6
  "scripts": {