diff --git a/README.md b/README.md index c8f87d5c..639b07c6 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,8 @@ console.log("Token Mint Address:", result.mint.toString()); ``` ### Create NFT Collection on 3Land ```typescript -const isDevnet = true; // (Optional) if not present TX takes place in Mainnet +const isDevnet = false; // (Optional) if not present TX takes place in Mainnet +const priorityFeeParam = 1000000; // (Optional) if not present the default priority fee will be 50000 const collectionOpts: CreateCollectionOptions = { collectionName: "", @@ -146,6 +147,7 @@ const isDevnet = true; // (Optional) if not present TX takes place in Mainnet const result = await agent.create3LandCollection( collectionOpts, isDevnet, // (Optional) if not present TX takes place in Mainnet + priorityFeeParam, //(Optional) ); ``` @@ -154,6 +156,7 @@ When creating an NFT using 3Land's tool, it automatically goes for sale on 3.lan ```typescript const isDevnet = true; // (Optional) if not present TX takes place in Mainnet const withPool = true; // (Optional) only present if NFT will be created with a Liquidity Pool for a specific SPL token +const priorityFeeParam = 1000000; // (Optional) if not present the default priority fee will be 50000 const collectionAccount = ""; //hash for the collection const createItemOptions: CreateSingleOptions = { itemName: "", @@ -174,6 +177,7 @@ const result = await agent.create3LandNft( createItemOptions, isDevnet, // (Optional) if not present TX takes place in Mainnet withPool + priorityFeeParam, //(Optional) ); ``` diff --git a/package.json b/package.json index 2839083f..ab297e25 100644 --- a/package.json +++ b/package.json @@ -19,11 +19,17 @@ "node": ">=22.0.0", "pnpm": ">=8.0.0" }, - "keywords": ["solana", "agent", "ai", "solana agent kit", "sendai"], + "keywords": [ + "solana", + "agent", + "ai", + "solana agent kit", + "sendai" + ], "author": "sendaifun", "license": "Apache-2.0", "dependencies": { - "@3land/listings-sdk": "^0.0.6", + "@3land/listings-sdk": "^0.0.7", "@ai-sdk/openai": "^1.0.11", "@bonfida/spl-name-service": "^3.0.7", "@cks-systems/manifest-sdk": "0.1.59", @@ -36,6 +42,7 @@ "@langchain/openai": "^0.3.16", "@lightprotocol/compressed-token": "^0.17.1", "@lightprotocol/stateless.js": "^0.17.1", + "@mercurial-finance/dynamic-amm-sdk": "^1.1.19", "@metaplex-foundation/digital-asset-standard-api": "^1.0.4", "@metaplex-foundation/mpl-core": "^1.1.1", "@metaplex-foundation/mpl-token-metadata": "^3.3.0", @@ -43,7 +50,6 @@ "@metaplex-foundation/umi": "^0.9.2", "@metaplex-foundation/umi-bundle-defaults": "^0.9.2", "@metaplex-foundation/umi-web3js-adapters": "^0.9.2", - "@mercurial-finance/dynamic-amm-sdk": "^1.1.19", "@meteora-ag/alpha-vault": "^1.1.7", "@meteora-ag/dlmm": "^1.3.0", "@onsol/tldparser": "^0.6.7", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 06c844bb..ac69f39b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,8 +9,8 @@ importers: .: dependencies: '@3land/listings-sdk': - specifier: ^0.0.6 - version: 0.0.6(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) + specifier: ^0.0.7 + version: 0.0.7(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10) '@ai-sdk/openai': specifier: ^1.0.11 version: 1.0.11(zod@3.24.1) @@ -189,8 +189,8 @@ importers: packages: - '@3land/listings-sdk@0.0.6': - resolution: {integrity: sha512-1OG4qddbij7kLGcyRvwA9WUiif7DJi2gEWODHF4NnfgQHRl22yLSFHZeHPLlo9mE1T2LZnn0I6HtUxvUtCHCAQ==} + '@3land/listings-sdk@0.0.7': + resolution: {integrity: sha512-7hEgqBcYFTF15OzXKliG8JuO3SKKDTkFZDgyldxXwPX/HSwvVEGjnX+LorGDhhWt/9YazV7K5iEC3qyeuqibIA==} '@ai-sdk/openai@1.0.11': resolution: {integrity: sha512-qI9s7Slma5i5bB4yYVlFdcG3PNDwdqivPT1Dr8adDX92nSSpILjgFIooS5yys9sXjvvcfOi/WXbDvVhLSRRlvg==} @@ -4780,7 +4780,7 @@ packages: snapshots: - '@3land/listings-sdk@0.0.6(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': + '@3land/listings-sdk@0.0.7(@types/node@22.10.7)(arweave@1.15.5)(bufferutil@4.0.9)(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.7.2)(utf-8-validate@5.0.10)': dependencies: '@coral-xyz/borsh': 0.30.1(@solana/web3.js@1.98.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) '@irys/sdk': 0.2.11(arweave@1.15.5)(bufferutil@4.0.9)(utf-8-validate@5.0.10) diff --git a/src/agent/index.ts b/src/agent/index.ts index 5bbc8458..0df21e1f 100644 --- a/src/agent/index.ts +++ b/src/agent/index.ts @@ -718,6 +718,7 @@ export class SolanaAgentKit { async create3LandCollection( collectionOpts: CreateCollectionOptions, isDevnet: boolean = false, + priorityFeeParam?: number, ): Promise { const optionsWithBase58: StoreInitOptions = { privateKey: this.wallet.secretKey, @@ -728,7 +729,11 @@ export class SolanaAgentKit { optionsWithBase58.isMainnet = true; } - const tx = await createCollection(optionsWithBase58, collectionOpts); + const tx = await createCollection( + optionsWithBase58, + collectionOpts, + priorityFeeParam, + ); return `Transaction: ${tx}`; } @@ -737,6 +742,7 @@ export class SolanaAgentKit { createItemOptions: CreateSingleOptions, isDevnet: boolean = false, withPool: boolean = false, + priorityFeeParam?: number, ): Promise { const optionsWithBase58: StoreInitOptions = { privateKey: this.wallet.secretKey, @@ -753,6 +759,7 @@ export class SolanaAgentKit { createItemOptions, !isDevnet, withPool, + priorityFeeParam, ); return `Transaction: ${tx}`; } diff --git a/src/langchain/3land/create_collection.ts b/src/langchain/3land/create_collection.ts index 48520d66..6f39bdd1 100644 --- a/src/langchain/3land/create_collection.ts +++ b/src/langchain/3land/create_collection.ts @@ -13,6 +13,7 @@ export class Solana3LandCreateCollection extends Tool { collectionDescription (required): the description of the collection mainImageUrl (required): the image of the collection coverImageUrl (optional): the cover image of the collection + priorityFeeParam (optional): default value is 50000, if tx doesnt land this param can help it land `; constructor(private solanaKit: SolanaAgentKit) { @@ -29,6 +30,7 @@ export class Solana3LandCreateCollection extends Tool { const collectionDescription = inputFormat?.collectionDescription; const mainImageUrl = inputFormat?.mainImageUrl; const coverImageUrl = inputFormat?.coverImageUrl; + const priorityFeeParam = inputFormat?.priorityFeeParam; const collectionOpts: CreateCollectionOptions = { ...(collectionSymbol && { collectionSymbol }), @@ -41,6 +43,7 @@ export class Solana3LandCreateCollection extends Tool { const tx = await this.solanaKit.create3LandCollection( collectionOpts, !isMainnet, + priorityFeeParam, ); return JSON.stringify({ status: "success", diff --git a/src/langchain/3land/create_single.ts b/src/langchain/3land/create_single.ts index d5eee040..3d0d6127 100644 --- a/src/langchain/3land/create_single.ts +++ b/src/langchain/3land/create_single.ts @@ -20,6 +20,7 @@ export class Solana3LandCreateSingle extends Tool { poolName (optional): the name of the pool isMainnet (required): defines if the tx takes places in mainnet withPool (optional): defines if minted edition will be tied to a liquidity pool + priorityFeeParam (optional): default value is 50000, if tx doesnt land this param can help it land `; constructor(private solanaKit: SolanaAgentKit) { @@ -32,6 +33,7 @@ export class Solana3LandCreateSingle extends Tool { const isMainnet = inputFormat.isMainnet; const withPool = inputFormat.withPool; const poolName = inputFormat.poolName; + const priorityFeeParam = inputFormat?.priorityFeeParam; const collectionAccount = inputFormat.collectionAccount; @@ -78,6 +80,7 @@ export class Solana3LandCreateSingle extends Tool { createItemOptions, !isMainnet, withPool, + priorityFeeParam, ); return JSON.stringify({ status: "success", diff --git a/src/tools/3land/create_3land_collectible.ts b/src/tools/3land/create_3land_collectible.ts index 1a45b85b..942aefc6 100644 --- a/src/tools/3land/create_3land_collectible.ts +++ b/src/tools/3land/create_3land_collectible.ts @@ -14,11 +14,13 @@ import { export async function createCollection( optionsWithBase58: StoreInitOptions, collectionOpts: CreateCollectionOptions, + priorityFeeParam?: number, ) { try { const collection = await createCollectionImp( optionsWithBase58, collectionOpts, + priorityFeeParam, ); return collection; } catch (error: any) { @@ -39,6 +41,7 @@ export async function createSingle( createItemOptions: CreateSingleOptions, isMainnet: boolean = false, withPool: boolean = false, + priorityFeeParam?: number, ) { try { const landStore = isMainnet @@ -52,6 +55,7 @@ export async function createSingle( createItemOptions, true, //isAI withPool, + priorityFeeParam, ); return singleEditionTx; } catch (error: any) { diff --git a/test/tools/3land.ts b/test/tools/3land.ts index 3e4c0f76..1d8b0efe 100644 --- a/test/tools/3land.ts +++ b/test/tools/3land.ts @@ -13,7 +13,7 @@ const agent = new SolanaAgentKit( { OPENAI_API_KEY: process.env.OPENAI_API_KEY! }, ); -const isDevnet = true; +const isDevnet = false; /****************************** CREATING COLLECTION ******************************** */ @@ -24,10 +24,13 @@ const collectionOpts: CreateCollectionOptions = { mainImageUrl: "", }; +//const priorityFeeParam = 100000; + (async () => { const collection = await agent.create3LandCollection( collectionOpts, isDevnet, + //priorityFeeParam, ); console.log("collection: ", collection); @@ -42,13 +45,14 @@ const createItemOptions: CreateSingleOptions = { itemSymbol: "", itemDescription: "", traits: [{ trait_type: "", value: "" }], - price: 100000000, //100000000 == 0.1 sol, + price: 1000000, //100000000 == 0.1 sol, splHash: "", poolName: "", mainImageUrl: "", }; const withPool = true; +//const priorityFeeParam = 100000; (async () => { const result = agent.create3LandNft( @@ -56,6 +60,7 @@ const withPool = true; createItemOptions, isDevnet, withPool, + //priorityFeeParam, ); console.log("result: ", result); })();