Documentation for SolanaAgentKit
solana-agent-kit / SolanaAgentKit
Defined in: agent/index.ts:89
Main class for interacting with Solana blockchain Provides a unified interface for token operations, NFT management, trading and more
SolanaAgentKit
new SolanaAgentKit(
private_key
,rpc_url
,openai_api_key
):SolanaAgentKit
Defined in: agent/index.ts:103
string
string
null
| string
Using openai_api_key directly in constructor is deprecated. Please use the new constructor with Config object instead:
new SolanaAgentKit(
private_key
,rpc_url
,config
):SolanaAgentKit
Defined in: agent/index.ts:108
string
string
requestFaucetFunds():
Promise
<string
>
Defined in: agent/index.ts:129
Promise
<string
>
deployToken(
name
,uri
,symbol
,decimals
,initialSupply
?):Promise
<{mint
:PublicKey
; }>
Defined in: agent/index.ts:133
string
string
string
number
= DEFAULT_OPTIONS.TOKEN_DECIMALS
number
Promise
<{ mint
: PublicKey
; }>
deployCollection(
options
):Promise
<CollectionDeployment
>
Defined in: agent/index.ts:143
Promise
<CollectionDeployment
>
getBalance(
token_address
?):Promise
<number
>
Defined in: agent/index.ts:149
PublicKey
Promise
<number
>
getBalanceOther(
walletAddress
,tokenAddress
?):Promise
<number
>
Defined in: agent/index.ts:153
PublicKey
PublicKey
Promise
<number
>
mintNFT(
collectionMint
,metadata
,recipient
?):Promise
<MintCollectionNFTResponse
>
Defined in: agent/index.ts:160
PublicKey
string
string
number
object
[]
PublicKey
Promise
<MintCollectionNFTResponse
>
transfer(
to
,amount
,mint
?):Promise
<string
>
Defined in: agent/index.ts:168
PublicKey
number
PublicKey
Promise
<string
>
registerDomain(
name
,spaceKB
?):Promise
<string
>
Defined in: agent/index.ts:176
string
number
Promise
<string
>
resolveSolDomain(
domain
):Promise
<PublicKey
>
Defined in: agent/index.ts:180
string
Promise
<PublicKey
>
getPrimaryDomain(
account
):Promise
<string
>
Defined in: agent/index.ts:184
PublicKey
Promise
<string
>
trade(
outputMint
,inputAmount
,inputMint
?,slippageBps
?):Promise
<string
>
Defined in: agent/index.ts:188
PublicKey
number
PublicKey
number
= DEFAULT_OPTIONS.SLIPPAGE_BPS
Promise
<string
>
limitOrder(
marketId
,quantity
,side
,price
):Promise
<string
>
Defined in: agent/index.ts:197
PublicKey
number
string
number
Promise
<string
>
batchOrder(
marketId
,orders
):Promise
<string
>
Defined in: agent/index.ts:206
PublicKey
Promise
<string
>
cancelAllOrders(
marketId
):Promise
<string
>
Defined in: agent/index.ts:213
PublicKey
Promise
<string
>
withdrawAll(
marketId
):Promise
<string
>
Defined in: agent/index.ts:217
PublicKey
Promise
<string
>
openPerpTradeLong(
args
):Promise
<string
>
Defined in: agent/index.ts:221
Omit
<{ agent
: SolanaAgentKit
; price
: number
; collateralAmount
: number
; collateralMint
: PublicKey
; leverage
: number
; tradeMint
: PublicKey
; slippage
: number
; }, "agent"
>
Promise
<string
>
openPerpTradeShort(
args
):Promise
<string
>
Defined in: agent/index.ts:230
Omit
<{ agent
: SolanaAgentKit
; price
: number
; collateralAmount
: number
; collateralMint
: PublicKey
; leverage
: number
; tradeMint
: PublicKey
; slippage
: number
; }, "agent"
>
Promise
<string
>
closePerpTradeShort(
args
):Promise
<string
>
Defined in: agent/index.ts:239
Omit
<{ agent
: SolanaAgentKit
; price
: number
; tradeMint
: PublicKey
; }, "agent"
>
Promise
<string
>
closePerpTradeLong(
args
):Promise
<string
>
Defined in: agent/index.ts:248
Omit
<{ agent
: SolanaAgentKit
; price
: number
; tradeMint
: PublicKey
; }, "agent"
>
Promise
<string
>
lendAssets(
amount
):Promise
<string
>
Defined in: agent/index.ts:257
number
Promise
<string
>
getTPS():
Promise
<number
>
Defined in: agent/index.ts:261
Promise
<number
>
getTokenDataByAddress(
mint
):Promise
<undefined
|JupiterTokenData
>
Defined in: agent/index.ts:265
string
Promise
<undefined
| JupiterTokenData
>
getTokenDataByTicker(
ticker
):Promise
<undefined
|JupiterTokenData
>
Defined in: agent/index.ts:271
string
Promise
<undefined
| JupiterTokenData
>
fetchTokenPrice(
mint
):Promise
<string
>
Defined in: agent/index.ts:277
string
Promise
<string
>
launchPumpFunToken(
tokenName
,tokenTicker
,description
,imageUrl
,options
?):Promise
<PumpfunLaunchResponse
>
Defined in: agent/index.ts:281
string
string
string
string
Promise
<PumpfunLaunchResponse
>
stake(
amount
):Promise
<string
>
Defined in: agent/index.ts:298
number
Promise
<string
>
restake(
amount
):Promise
<string
>
Defined in: agent/index.ts:302
number
Promise
<string
>
sendCompressedAirdrop(
mintAddress
,amount
,decimals
,recipients
,priorityFeeInLamports
,shouldLog
):Promise
<string
[]>
Defined in: agent/index.ts:306
string
number
number
string
[]
number
boolean
Promise
<string
[]>
orcaClosePosition(
positionMintAddress
):Promise
<string
>
Defined in: agent/index.ts:325
PublicKey
Promise
<string
>
orcaCreateCLMM(
mintDeploy
,mintPair
,initialPrice
,feeTier
):Promise
<string
>
Defined in: agent/index.ts:329
PublicKey
PublicKey
Decimal
1
| 2
| 4
| 5
| 16
| 30
| 65
| 100
| 200
Promise
<string
>
orcaCreateSingleSidedLiquidityPool(
depositTokenAmount
,depositTokenMint
,otherTokenMint
,initialPrice
,maxPrice
,feeTier
):Promise
<string
>
Defined in: agent/index.ts:338
number
PublicKey
PublicKey
Decimal
Decimal
1
| 2
| 4
| 5
| 16
| 30
| 65
| 100
| 200
Promise
<string
>
orcaFetchPositions():
Promise
<string
>
Defined in: agent/index.ts:357
Promise
<string
>
orcaOpenCenteredPositionWithLiquidity(
whirlpoolAddress
,priceOffsetBps
,inputTokenMint
,inputAmount
):Promise
<string
>
Defined in: agent/index.ts:361
PublicKey
number
PublicKey
Decimal
Promise
<string
>
orcaOpenSingleSidedPosition(
whirlpoolAddress
,distanceFromCurrentPriceBps
,widthBps
,inputTokenMint
,inputAmount
):Promise
<string
>
Defined in: agent/index.ts:376
PublicKey
number
number
PublicKey
Decimal
Promise
<string
>
resolveAllDomains(
domain
):Promise
<undefined
|PublicKey
>
Defined in: agent/index.ts:393
string
Promise
<undefined
| PublicKey
>
getOwnedAllDomains(
owner
):Promise
<string
[]>
Defined in: agent/index.ts:397
PublicKey
Promise
<string
[]>
getOwnedDomainsForTLD(
tld
):Promise
<string
[]>
Defined in: agent/index.ts:401
string
Promise
<string
[]>
getAllDomainsTLDs():
Promise
<string
[]>
Defined in: agent/index.ts:405
Promise
<string
[]>
getAllRegisteredAllDomains():
Promise
<string
[]>
Defined in: agent/index.ts:409
Promise
<string
[]>
getMainAllDomainsDomain(
owner
):Promise
<null
|string
>
Defined in: agent/index.ts:413
PublicKey
Promise
<null
| string
>
raydiumCreateAmmV4(
marketId
,baseAmount
,quoteAmount
,startTime
):Promise
<string
>
Defined in: agent/index.ts:417
PublicKey
BN
BN
BN
Promise
<string
>
raydiumCreateClmm(
mint1
,mint2
,configId
,initialPrice
,startTime
):Promise
<string
>
Defined in: agent/index.ts:434
PublicKey
PublicKey
PublicKey
Decimal
BN
Promise
<string
>
raydiumCreateCpmm(
mint1
,mint2
,configId
,mintAAmount
,mintBAmount
,startTime
):Promise
<string
>
Defined in: agent/index.ts:451
PublicKey
PublicKey
PublicKey
BN
BN
BN
Promise
<string
>
openbookCreateMarket(
baseMint
,quoteMint
,lotSize
,tickSize
):Promise
<string
[]>
Defined in: agent/index.ts:471
PublicKey
PublicKey
number
= 1
number
= 0.01
Promise
<string
[]>
manifestCreateMarket(
baseMint
,quoteMint
):Promise
<string
[]>
Defined in: agent/index.ts:487
PublicKey
PublicKey
Promise
<string
[]>
getPythPriceFeedID(
tokenSymbol
):Promise
<string
>
Defined in: agent/index.ts:494
string
Promise
<string
>
getPythPrice(
priceFeedID
):Promise
<string
>
Defined in: agent/index.ts:498
string
Promise
<string
>
createGibworkTask(
title
,content
,requirements
,tags
,tokenMintAddress
,tokenAmount
,payer
?):Promise
<GibworkCreateTaskReponse
>
Defined in: agent/index.ts:502
string
string
string
string
[]
string
number
string
Promise
<GibworkCreateTaskReponse
>
rockPaperScissors(
amount
,choice
):Promise
<string
>
Defined in: agent/index.ts:523
number
"rock"
| "paper"
| "scissors"
Promise
<string
>
createTiplink(
amount
,splmintAddress
?):Promise
<{url
:string
;signature
:string
; }>
Defined in: agent/index.ts:529
number
PublicKey
Promise
<{ url
: string
; signature
: string
; }>
tensorListNFT(
nftMint
,price
):Promise
<string
>
Defined in: agent/index.ts:533
PublicKey
number
Promise
<string
>
tensorCancelListing(
nftMint
):Promise
<string
>
Defined in: agent/index.ts:537
PublicKey
Promise
<string
>
fetchTokenReportSummary(
mint
):Promise
<TokenCheck
>
Defined in: agent/index.ts:541
string
Promise
<TokenCheck
>
fetchTokenDetailedReport(
mint
):Promise
<TokenCheck
>
Defined in: agent/index.ts:545
string
Promise
<TokenCheck
>
flashOpenTrade(
params
):Promise
<string
>
Defined in: agent/index.ts:554
Opens a new trading position on Flash.Trade
Flash trade parameters including market, side, collateral, leverage, and pool name
Promise
<string
>
Transaction signature
flashCloseTrade(
params
):Promise
<string
>
Defined in: agent/index.ts:563
Closes an existing trading position on Flash.Trade
Flash trade close parameters
Promise
<string
>
Transaction signature
connection:
Connection
Defined in: agent/index.ts:90
Solana RPC connection
wallet:
Keypair
Defined in: agent/index.ts:91
Wallet keypair for signing transactions
wallet_address:
PublicKey
Defined in: agent/index.ts:92
Public key of the wallet
config:
Config
Defined in: agent/index.ts:93
Configuration object