Skip to content

Commit

Permalink
fix: Adjust withdraw funds function
Browse files Browse the repository at this point in the history
  • Loading branch information
alejandrordzl committed Sep 10, 2024
1 parent 3b83cb6 commit b7d4138
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/blockchains/base/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ export class BaseCollectionV1 implements CollectionContract {
async withdrawFunds<CollectionTransactionBaseParams>(
params: CollectionTransactionBaseParams
): Promise<TransactionResponse> {
const args = this.encodeFunctionData("setTotalEditions", [
const args = this.encodeFunctionData("withdrawFunds", [
params.collectionId,
]);
const transaction = await this.buildTransactionData("0", args);
Expand Down Expand Up @@ -289,10 +289,10 @@ export class BaseCollectionV1 implements CollectionContract {
QueryResponse<{
tokensMinted: {
allowlistCount: number;
freelistCount: number;
freelistCount: number;
};
}>
> {
> {

const tokensMinted = await this.querier.methods
.accounts(params.collectionId, params.address)
Expand All @@ -305,7 +305,7 @@ export class BaseCollectionV1 implements CollectionContract {

return {
data: {
tokensMinted: response
tokensMinted: response
},
error: null,
};
Expand Down
8 changes: 4 additions & 4 deletions src/blockchains/ethereum/v0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export class EthereumCollectionV0 implements CollectionContract {
async withdrawFunds<CollectionTransactionEthereumParams>(
params: CollectionTransactionEthereumParams,
): Promise<TransactionResponse> {
const args = this.encodeFunctionData("setTotalEditions", [
const args = this.encodeFunctionData("withdrawFunds", [
params.collectionId,
]);
const transaction = await this.buildTransactionData("0", args);
Expand Down Expand Up @@ -265,15 +265,15 @@ export class EthereumCollectionV0 implements CollectionContract {
QueryResponse<{
tokensMinted: {
allowlistCount: number;
freelistCount: number;
freelistCount: number;
};
}>
> {
> {

const tokensMinted = await this.querier.methods
.allowlistCount(params.collectionId, params.address)
.call();

const response = {
allowlistCount: Number(tokensMinted) || 0,
freelistCount: 0
Expand Down
10 changes: 5 additions & 5 deletions src/blockchains/ethereum/v1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export interface CollectionArgsEthereumV1 {

export interface RedeemParamsEthereumV1 extends CollectionQueryEthereumParams {
address: string;
}
}

export class EthereumCollectionV1 implements CollectionContract {
querier;
Expand Down Expand Up @@ -185,7 +185,7 @@ export class EthereumCollectionV1 implements CollectionContract {
async withdrawFunds<CollectionTransactionEthereumParams>(
params: CollectionTransactionEthereumParams,
): Promise<TransactionResponse> {
const args = this.encodeFunctionData("setTotalEditions", [
const args = this.encodeFunctionData("withdrawFunds", [
params.collectionId,
]);
const transaction = await this.buildTransactionData("0", args);
Expand Down Expand Up @@ -292,10 +292,10 @@ export class EthereumCollectionV1 implements CollectionContract {
QueryResponse<{
tokensMinted: {
allowlistCount: number;
freelistCount: number;
freelistCount: number;
};
}>
> {
> {

const tokensMinted = await this.querier.methods
.accounts(params.collectionId, params.address)
Expand All @@ -308,7 +308,7 @@ export class EthereumCollectionV1 implements CollectionContract {

return {
data: {
tokensMinted: response
tokensMinted: response
},
error: null,
};
Expand Down

0 comments on commit b7d4138

Please sign in to comment.