Skip to content

Commit

Permalink
Set default token limit for a single box to 100
Browse files Browse the repository at this point in the history
  • Loading branch information
arobsn committed Aug 13, 2024
1 parent 6245bc9 commit ece573c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-foxes-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fleet-sdk/core": patch
---

Set default token limit for a single box to `100`
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,7 @@ export class ErgoGraphQLProvider<I = bigint> implements IBlockchainProvider<I> {
signedTransaction: SignedTransaction
): Promise<TransactionEvaluationResult> {
try {
const response = await this.#checkTransaction(
{ signedTransaction },
this.#options.url
);
const response = await this.#checkTransaction({ signedTransaction });
return { success: true, transactionId: response.data.checkTransaction };
} catch (e) {
return { success: false, message: (e as Error).message };
Expand All @@ -325,10 +322,7 @@ export class ErgoGraphQLProvider<I = bigint> implements IBlockchainProvider<I> {
signedTransaction: SignedTransaction
): Promise<TransactionEvaluationResult> {
try {
const response = await this.#sendTransaction(
{ signedTransaction },
this.#options.url
);
const response = await this.#sendTransaction({ signedTransaction });
return { success: true, transactionId: response.data.submitTransaction };
} catch (e) {
return { success: false, message: (e as Error).message };
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/builder/transactionBuilder.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ describe("Building", () => {

expect(change1.ergoTree).toBe(a1.ergoTree);
expect(change1.creationHeight).toBe(height);
expect(change1.value).toBe(3595808n);
expect(change1.value).toBe(3358208n);
expect(change1.assets).toHaveLength(MAX_TOKENS_PER_BOX);
expect(change1.additionalRegisters).toEqual({});

Expand All @@ -756,7 +756,7 @@ describe("Building", () => {
expect(change3.ergoTree).toBe(a1.ergoTree);
expect(change3.creationHeight).toBe(height);
expect(change3.value).toBe(_estimateBoxValue(change3));
expect(change3.assets).toHaveLength(32);
expect(change3.assets).toHaveLength(72);
expect(change3.additionalRegisters).toEqual({});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/models/collections/tokensCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { NotFoundError, UndefinedMintingContext } from "../../errors";
import { InsufficientTokenAmount } from "../../errors/insufficientTokenAmount";
import { MaxTokensOverflow } from "../../errors/maxTokensOverflow";

export const MAX_TOKENS_PER_BOX = 120;
export const MAX_TOKENS_PER_BOX = 100;

export type TokenAddOptions = CollectionAddOptions & { sum?: boolean };
export type OutputToken<T extends Amount = Amount> = {
Expand Down

0 comments on commit ece573c

Please sign in to comment.