diff --git a/.changeset/spotty-foxes-fetch.md b/.changeset/spotty-foxes-fetch.md new file mode 100644 index 0000000..9bd2219 --- /dev/null +++ b/.changeset/spotty-foxes-fetch.md @@ -0,0 +1,5 @@ +--- +"@fleet-sdk/core": patch +--- + +Set default token limit for a single box to `100` diff --git a/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts b/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts index 633f641..b66eb32 100644 --- a/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts +++ b/packages/blockchain-providers/src/ergo-graphql/ergoGraphQLProvider.ts @@ -311,10 +311,7 @@ export class ErgoGraphQLProvider implements IBlockchainProvider { signedTransaction: SignedTransaction ): Promise { 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 }; @@ -325,10 +322,7 @@ export class ErgoGraphQLProvider implements IBlockchainProvider { signedTransaction: SignedTransaction ): Promise { 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 }; diff --git a/packages/core/src/builder/transactionBuilder.spec.ts b/packages/core/src/builder/transactionBuilder.spec.ts index 4b1ca29..93757b5 100644 --- a/packages/core/src/builder/transactionBuilder.spec.ts +++ b/packages/core/src/builder/transactionBuilder.spec.ts @@ -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({}); @@ -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({}); }); diff --git a/packages/core/src/models/collections/tokensCollection.ts b/packages/core/src/models/collections/tokensCollection.ts index 5ff8ea1..aed9f1a 100644 --- a/packages/core/src/models/collections/tokensCollection.ts +++ b/packages/core/src/models/collections/tokensCollection.ts @@ -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 = {