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.
- package/index.js +13 -3
- 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
|
-
|
|
246
|
-
|
|
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
|
-
|
|
257
|
+
request = await this.axios.get(urlStr)
|
|
258
|
+
}
|
|
249
259
|
|
|
250
260
|
return request.data
|
|
251
261
|
} catch (err) {
|