Skip to content

Commit 1aba0c7

Browse files
committed
Fix proof resp. type and adds presaleMint missing param
1 parent 3e3f128 commit 1aba0c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/DropKit.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ export default class DropKit {
174174
return await this.contract?.presaleActive()
175175
}
176176

177-
async generateProof(): Promise<ProofApiResponse> {
178-
const { data } = await axios.post<ProofApiResponse>(
177+
async generateProof(): Promise<ProofApiResponse & ErrorApiResponse> {
178+
const { data } = await axios.post<ProofApiResponse & ErrorApiResponse>(
179179
`${this.apiBaseUrl}/drops/list/${this.collectionId}`,
180180
{
181181
wallet: this.walletAddress,
@@ -243,7 +243,7 @@ export default class DropKit {
243243
amount: BigNumber
244244
): Promise<ContractReceipt> {
245245
const data = await this.generateProof()
246-
if (!data.proof) {
246+
if (data.message) {
247247
// Backwards compatibility for v2 contracts
248248
if (this.version === 3) {
249249
throw new Error(
@@ -255,6 +255,7 @@ export default class DropKit {
255255

256256
const trx: ContractTransaction = await this.contract?.presaleMint(
257257
quantity,
258+
data.proof,
258259
{
259260
value: amount,
260261
}

0 commit comments

Comments
 (0)