This repository was archived by the owner on Aug 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Expand file tree Collapse file tree 4 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -119,9 +119,12 @@ export async function prepareClaim(
119
119
*/
120
120
export async function fetchSnapshot (
121
121
merkleRoot : string ,
122
- merkleMetadata : Record < string , string > ,
122
+ merkleMetadata : Record < string , string > | undefined ,
123
123
storage : IStorage ,
124
124
) {
125
+ if ( ! merkleMetadata ) {
126
+ return undefined ;
127
+ }
125
128
const snapshotUri = merkleMetadata [ merkleRoot ] ;
126
129
let snapshot = undefined ;
127
130
if ( snapshotUri ) {
@@ -336,10 +339,11 @@ export async function transformResultToClaimCondition(
336
339
pm : IDropClaimCondition . ClaimConditionStructOutput ,
337
340
tokenDecimals : number ,
338
341
provider : providers . Provider ,
339
- merkleMetadata : Record < string , string > ,
342
+ merkleMetadata : Record < string , string > | undefined ,
340
343
storage : IStorage ,
341
344
) : Promise < ClaimCondition > {
342
345
const cv = await fetchCurrencyValue ( provider , pm . currency , pm . pricePerToken ) ;
346
+
343
347
const claims = await fetchSnapshot ( pm . merkleRoot , merkleMetadata , storage ) ;
344
348
const maxClaimableSupply = convertToReadableQuantity (
345
349
pm . maxClaimableSupply ,
Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ function extractCommentFromMetadata(
87
87
metadata : Record < string , any > | undefined ,
88
88
type : "methods" | "events" ,
89
89
) {
90
- // console.log(metadata?.output?.userdoc);
91
90
return (
92
91
metadata ?. output ?. userdoc ?. [ type ] ?. [
93
92
Object . keys ( metadata ?. output ?. userdoc [ type ] || { } ) . find ( ( fn ) =>
Original file line number Diff line number Diff line change @@ -206,7 +206,7 @@ export class DropClaimConditions<
206
206
reasons . push ( ClaimEligibility . NoClaimConditionSet ) ;
207
207
return reasons ;
208
208
}
209
- console . log ( "failed to get active claim condition" , err ) ;
209
+ console . warn ( "failed to get active claim condition" , err ) ;
210
210
reasons . push ( ClaimEligibility . Unknown ) ;
211
211
return reasons ;
212
212
}
Original file line number Diff line number Diff line change @@ -378,7 +378,7 @@ export class ThirdwebSDK extends RPCConnectionHandler {
378
378
try {
379
379
metadata = ( await this . getContract ( address ) ) . metadata ;
380
380
} catch ( e ) {
381
- console . log (
381
+ console . warn (
382
382
`Couldn't get contract metadata for custom contract: ${ address } ` ,
383
383
) ;
384
384
}
You can’t perform that action at this time.
0 commit comments