@audius/sdk 1.0.28 → 1.0.29
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/index.cjs.js +18 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +18 -2
- package/dist/index.esm.js.map +1 -1
- package/dist/legacy.js +18 -2
- package/dist/legacy.js.map +1 -1
- package/dist/native-libs.js +18 -2
- package/dist/native-libs.js.map +1 -1
- package/dist/utils/types.d.ts +1 -0
- package/package.json +2 -2
- package/src/services/schemaValidator/schemas/trackSchema.json +14 -0
- package/src/utils/types.ts +1 -0
- package/tests/rewardsAttesterTest.js +9 -5
package/dist/utils/types.d.ts
CHANGED
|
@@ -87,6 +87,7 @@ export declare type PremiumConditionsSolNFTCollection = {
|
|
|
87
87
|
export declare type PremiumConditions = {
|
|
88
88
|
nft_collection?: PremiumConditionsEthNFTCollection | PremiumConditionsSolNFTCollection;
|
|
89
89
|
follow_user_id?: number;
|
|
90
|
+
tip_user_id?: number;
|
|
90
91
|
};
|
|
91
92
|
export declare type PremiumContentSignature = {
|
|
92
93
|
data: string;
|
package/package.json
CHANGED
|
@@ -131,6 +131,9 @@
|
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
"$ref": "#/definitions/PremiumConditionsFollowUserId"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"$ref": "#/definitions/PremiumConditionsTipUserId"
|
|
134
137
|
}
|
|
135
138
|
]
|
|
136
139
|
}
|
|
@@ -339,6 +342,17 @@
|
|
|
339
342
|
},
|
|
340
343
|
"required": ["follow_user_id"],
|
|
341
344
|
"title": "PremiumConditionsFollowUserId"
|
|
345
|
+
},
|
|
346
|
+
"PremiumConditionsTipUserId": {
|
|
347
|
+
"type": "object",
|
|
348
|
+
"additionalProperties": false,
|
|
349
|
+
"properties": {
|
|
350
|
+
"tip_user_id": {
|
|
351
|
+
"type": "number"
|
|
352
|
+
}
|
|
353
|
+
},
|
|
354
|
+
"required": ["tip_user_id"],
|
|
355
|
+
"title": "PremiumConditionsTipUserId"
|
|
342
356
|
}
|
|
343
357
|
}
|
|
344
358
|
}
|
package/src/utils/types.ts
CHANGED
|
@@ -120,10 +120,12 @@ describe('Delay calculator tests', () => {
|
|
|
120
120
|
const solSlot = {
|
|
121
121
|
last: 100
|
|
122
122
|
}
|
|
123
|
-
// new slots every 250ms
|
|
123
|
+
// new slots every ~250ms for 4 slots/sec
|
|
124
|
+
// give it a little padding to make sure we produce
|
|
125
|
+
// a slot before the pollingInterval runs
|
|
124
126
|
const i = setInterval(() => {
|
|
125
127
|
solSlot.last += 1
|
|
126
|
-
},
|
|
128
|
+
}, 230)
|
|
127
129
|
|
|
128
130
|
const libs = new MockLibs(
|
|
129
131
|
() => solSlot.last,
|
|
@@ -138,13 +140,15 @@ describe('Delay calculator tests', () => {
|
|
|
138
140
|
})
|
|
139
141
|
calc.start()
|
|
140
142
|
const slotThreshold1 = await calc.getSolanaSlotThreshold()
|
|
141
|
-
// Initially this should be 0.5sec/slot
|
|
143
|
+
// Initially this rate should be 0.5sec/slot
|
|
144
|
+
// 100 starting - 1s * 2slot/sec
|
|
142
145
|
assert.strictEqual(slotThreshold1, 90)
|
|
143
146
|
|
|
144
|
-
// Wait for staleness interval
|
|
147
|
+
// Wait for staleness interval of 1s
|
|
145
148
|
await new Promise((res) => setTimeout(res, 1100))
|
|
146
149
|
const slotThreshold2 = await calc.getSolanaSlotThreshold()
|
|
147
|
-
// Current slot should be 104
|
|
150
|
+
// Current slot should be 104
|
|
151
|
+
// it should calculate 4 slot/sec
|
|
148
152
|
// so 5 sec lag behind = 104 - 5 * 4 = 84
|
|
149
153
|
assert.strictEqual(slotThreshold2, 84)
|
|
150
154
|
|