@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.
@@ -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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@audius/sdk",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "audius": {
5
- "releaseSHA": "8c3013ed489dadfdef27970479247d8e7d54e299"
5
+ "releaseSHA": "874f1104db24643b2c3b41b0c2920ca25abcb47b"
6
6
  },
7
7
  "description": "",
8
8
  "main": "dist/index.cjs.js",
@@ -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
  }
@@ -104,6 +104,7 @@ export type PremiumConditions = {
104
104
  | PremiumConditionsEthNFTCollection
105
105
  | PremiumConditionsSolNFTCollection
106
106
  follow_user_id?: number
107
+ tip_user_id?: number
107
108
  }
108
109
 
109
110
  export type PremiumContentSignature = {
@@ -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
- }, 250)
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, and there should be 4 slots/sec,
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