@nina-protocol/nina-db 0.0.74 → 0.0.76
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/dist/models/Release.js +4 -3
- package/package.json +1 -1
- package/src/models/Release.js +4 -3
package/dist/models/Release.js
CHANGED
|
@@ -16,7 +16,7 @@ export default class Release extends Model {
|
|
|
16
16
|
static idColumn = 'id';
|
|
17
17
|
static jsonSchema = {
|
|
18
18
|
type: 'object',
|
|
19
|
-
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'
|
|
19
|
+
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'],
|
|
20
20
|
properties: {
|
|
21
21
|
publicKey: { type: 'string' },
|
|
22
22
|
mint: { type: 'string' },
|
|
@@ -58,10 +58,10 @@ export default class Release extends Model {
|
|
|
58
58
|
let metadataAccount = (await metaplex.nfts().findAllByMintList({ mints: [releaseAccount.releaseMint] }, { commitment: 'confirmed' }))[0];
|
|
59
59
|
let json;
|
|
60
60
|
try {
|
|
61
|
-
json = (await axios.get(metadataAccount.uri)).data;
|
|
61
|
+
json = (await axios.get(metadataAccount.uri).replace('www.', '').replace('arweave.net', 'gateway.irys.xyz')).data;
|
|
62
62
|
}
|
|
63
63
|
catch (error) {
|
|
64
|
-
json = (await axios.get(metadataAccount.uri.replace('
|
|
64
|
+
json = (await axios.get(metadataAccount.uri.replace('gateway.irys.xyz', 'arweave.net'))).data;
|
|
65
65
|
}
|
|
66
66
|
const slug = await this.generateSlug(json);
|
|
67
67
|
let publisher = await Account.findOrCreate(releaseAccount.authority.toBase58());
|
|
@@ -96,6 +96,7 @@ export default class Release extends Model {
|
|
|
96
96
|
publisherId,
|
|
97
97
|
price: `${price}`,
|
|
98
98
|
paymentMint,
|
|
99
|
+
archived: false
|
|
99
100
|
});
|
|
100
101
|
if (metadata.properties.tags) {
|
|
101
102
|
for await (let tag of metadata.properties.tags) {
|
package/package.json
CHANGED
package/src/models/Release.js
CHANGED
|
@@ -18,7 +18,7 @@ export default class Release extends Model {
|
|
|
18
18
|
static idColumn = 'id';
|
|
19
19
|
static jsonSchema = {
|
|
20
20
|
type: 'object',
|
|
21
|
-
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'
|
|
21
|
+
required: ['publicKey', 'mint', 'metadata', 'datetime', 'slug', 'price'],
|
|
22
22
|
properties: {
|
|
23
23
|
publicKey: { type: 'string' },
|
|
24
24
|
mint: { type: 'string' },
|
|
@@ -65,9 +65,9 @@ export default class Release extends Model {
|
|
|
65
65
|
let metadataAccount = (await metaplex.nfts().findAllByMintList({mints: [releaseAccount.releaseMint]}, { commitment: 'confirmed' }))[0];
|
|
66
66
|
let json
|
|
67
67
|
try {
|
|
68
|
-
json = (await axios.get(metadataAccount.uri)).data
|
|
68
|
+
json = (await axios.get(metadataAccount.uri).replace('www.','').replace('arweave.net', 'gateway.irys.xyz')).data
|
|
69
69
|
} catch (error) {
|
|
70
|
-
json = (await axios.get(metadataAccount.uri.replace('
|
|
70
|
+
json = (await axios.get(metadataAccount.uri.replace('gateway.irys.xyz', 'arweave.net'))).data
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
const slug = await this.generateSlug(json);
|
|
@@ -107,6 +107,7 @@ export default class Release extends Model {
|
|
|
107
107
|
publisherId,
|
|
108
108
|
price: `${price}`,
|
|
109
109
|
paymentMint,
|
|
110
|
+
archived: false
|
|
110
111
|
})
|
|
111
112
|
if (metadata.properties.tags) {
|
|
112
113
|
for await (let tag of metadata.properties.tags) {
|