mirror of
https://github.com/d0zingcat/solana-agent-kit.git
synced 2026-05-14 07:26:46 +00:00
fix
This commit is contained in:
@@ -63,6 +63,15 @@ import {
|
||||
fetchPythPriceFeedID,
|
||||
flashOpenTrade,
|
||||
flashCloseTrade,
|
||||
createCollection,
|
||||
createSingle,
|
||||
multisig_transfer_from_treasury,
|
||||
create_squads_multisig,
|
||||
multisig_create_proposal,
|
||||
multisig_deposit_to_treasury,
|
||||
multisig_reject_proposal,
|
||||
multisig_approve_proposal,
|
||||
multisig_execute_proposal,
|
||||
} from "../tools";
|
||||
import {
|
||||
CollectionDeployment,
|
||||
@@ -76,22 +85,11 @@ import {
|
||||
FlashTradeParams,
|
||||
FlashCloseTradeParams,
|
||||
} from "../types";
|
||||
import {
|
||||
createCollection,
|
||||
createSingle,
|
||||
} from "../tools/create_3land_collectible";
|
||||
import {
|
||||
CreateCollectionOptions,
|
||||
CreateSingleOptions,
|
||||
StoreInitOptions,
|
||||
} from "@3land/listings-sdk/dist/types/implementation/implementationTypes";
|
||||
import { create_squads_multisig } from "../tools/squads_multisig/create_multisig";
|
||||
import { deposit_to_multisig } from "../tools/squads_multisig/deposit_to_multisig";
|
||||
import { transfer_from_multisig } from "../tools/squads_multisig/transfer_from_multisig";
|
||||
import { create_proposal } from "../tools/squads_multisig/create_proposal";
|
||||
import { approve_proposal } from "../tools/squads_multisig/approve_proposal";
|
||||
import { execute_transaction } from "../tools/squads_multisig/execute_proposal";
|
||||
import { reject_proposal } from "../tools/squads_multisig/reject_proposal";
|
||||
|
||||
/**
|
||||
* Main class for interacting with Solana blockchain
|
||||
@@ -620,7 +618,7 @@ export class SolanaAgentKit {
|
||||
vaultIndex: number = 0,
|
||||
mint?: PublicKey,
|
||||
): Promise<string> {
|
||||
return deposit_to_multisig(this, amount, vaultIndex, mint);
|
||||
return multisig_deposit_to_treasury(this, amount, vaultIndex, mint);
|
||||
}
|
||||
|
||||
async transferFromMultisig(
|
||||
@@ -629,30 +627,30 @@ export class SolanaAgentKit {
|
||||
vaultIndex: number = 0,
|
||||
mint?: PublicKey,
|
||||
): Promise<string> {
|
||||
return transfer_from_multisig(this, amount, to, vaultIndex, mint);
|
||||
return multisig_transfer_from_treasury(this, amount, to, vaultIndex, mint);
|
||||
}
|
||||
|
||||
async createMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return create_proposal(this, transactionIndex);
|
||||
return multisig_create_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async approveMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return approve_proposal(this, transactionIndex);
|
||||
return multisig_approve_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async rejectMultisigProposal(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return reject_proposal(this, transactionIndex);
|
||||
return multisig_reject_proposal(this, transactionIndex);
|
||||
}
|
||||
|
||||
async executeMultisigTransaction(
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
return execute_transaction(this, transactionIndex);
|
||||
return multisig_execute_proposal(this, transactionIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as multisig from "@sqds/multisig";
|
||||
import { PublicKey } from "@solana/web3.js";
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import * as multisig from "@sqds/multisig";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
|
||||
/**
|
||||
* Creates a new Squads multisig account.
|
||||
@@ -1,10 +1,21 @@
|
||||
export * from "./adrena_perp_trading";
|
||||
export * from "./close_empty_token_accounts";
|
||||
export * from "./create_3land_collectible";
|
||||
export * from "./create_gibwork_task";
|
||||
export * from "./create_image";
|
||||
export * from "./create_multisig";
|
||||
export * from "./multisig_approve_proposal";
|
||||
export * from "./multisig_create_proposal";
|
||||
export * from "./multisig_deposit_to_treasury";
|
||||
export * from "./multisig_execute_proposal";
|
||||
export * from "./multisig_reject_proposal";
|
||||
export * from "./multisig_transfer_from_treasury";
|
||||
export * from "./create_tiplinks";
|
||||
export * from "./deploy_collection";
|
||||
export * from "./deploy_token";
|
||||
export * from "./fetch_price";
|
||||
export * from "./flash_close_trade";
|
||||
export * from "./flash_open_trade";
|
||||
export * from "./get_all_domains_tlds";
|
||||
export * from "./get_all_registered_all_domains";
|
||||
export * from "./get_balance";
|
||||
@@ -41,12 +52,5 @@ export * from "./send_compressed_airdrop";
|
||||
export * from "./stake_with_jup";
|
||||
export * from "./stake_with_solayer";
|
||||
export * from "./tensor_trade";
|
||||
|
||||
export * from "./close_empty_token_accounts";
|
||||
|
||||
export * from "./trade";
|
||||
export * from "./transfer";
|
||||
export * from "./flash_open_trade";
|
||||
export * from "./flash_close_trade";
|
||||
|
||||
export * from "./create_3land_collectible";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import * as multisig from "@sqds/multisig";
|
||||
const { Multisig } = multisig.accounts;
|
||||
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - A promise that resolves to the transaction ID of the approved proposal.
|
||||
* @throws {Error} - Throws an error if the approval process fails.
|
||||
*/
|
||||
export async function approve_proposal(
|
||||
export async function multisig_approve_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import * as multisig from "@sqds/multisig";
|
||||
const { Multisig } = multisig.accounts;
|
||||
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - The transaction ID of the created proposal.
|
||||
* @throws {Error} - Throws an error if the proposal creation fails.
|
||||
*/
|
||||
export async function create_proposal(
|
||||
export async function multisig_create_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import { PublicKey, SystemProgram, Transaction } from "@solana/web3.js";
|
||||
import { LAMPORTS_PER_SOL } from "@solana/web3.js";
|
||||
import {
|
||||
@@ -10,14 +10,14 @@ import {
|
||||
import * as multisig from "@sqds/multisig";
|
||||
|
||||
/**
|
||||
* Transfer SOL or SPL tokens to a multisig vault.
|
||||
* Transfer SOL or SPL tokens to a multisig treasury vault.
|
||||
* @param agent SolanaAgentKit instance
|
||||
* @param amount Amount to transfer
|
||||
* @param vaultIndex Optional vault index, default is 0
|
||||
* @param mint Optional mint address for SPL tokens
|
||||
* @returns Transaction signature
|
||||
*/
|
||||
export async function deposit_to_multisig(
|
||||
export async function multisig_deposit_to_treasury(
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
vaultIndex?: number,
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import * as multisig from "@sqds/multisig";
|
||||
const { Multisig } = multisig.accounts;
|
||||
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns {Promise<string>} - A promise that resolves to the transaction signature string.
|
||||
* @throws {Error} - Throws an error if the transaction execution fails.
|
||||
*/
|
||||
export async function execute_transaction(
|
||||
export async function multisig_execute_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import * as multisig from "@sqds/multisig";
|
||||
const { Multisig } = multisig.accounts;
|
||||
|
||||
@@ -10,7 +10,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @returns A promise that resolves to the transaction ID of the rejection transaction.
|
||||
* @throws Will throw an error if the transaction fails.
|
||||
*/
|
||||
export async function reject_proposal(
|
||||
export async function multisig_reject_proposal(
|
||||
agent: SolanaAgentKit,
|
||||
transactionIndex?: number | bigint,
|
||||
): Promise<string> {
|
||||
@@ -1,4 +1,4 @@
|
||||
import { SolanaAgentKit } from "../../index";
|
||||
import { SolanaAgentKit } from "../agent";
|
||||
import {
|
||||
PublicKey,
|
||||
SystemProgram,
|
||||
@@ -15,7 +15,7 @@ import * as multisig from "@sqds/multisig";
|
||||
const { Multisig } = multisig.accounts;
|
||||
|
||||
/**
|
||||
* Transfer SOL or SPL tokens to a recipient from a multisig vault.
|
||||
* Transfer SOL or SPL tokens to a recipient from a multisig treasury vault.
|
||||
* @param agent - SolanaAgentKit instance.
|
||||
* @param amount - Amount to transfer.
|
||||
* @param to - Recipient's public key.
|
||||
@@ -23,7 +23,7 @@ const { Multisig } = multisig.accounts;
|
||||
* @param mint - Optional mint address for SPL tokens.
|
||||
* @returns Transaction signature.
|
||||
*/
|
||||
export async function transfer_from_multisig(
|
||||
export async function multisig_transfer_from_treasury(
|
||||
agent: SolanaAgentKit,
|
||||
amount: number,
|
||||
to: PublicKey,
|
||||
Reference in New Issue
Block a user