Preparing search index...
The search index is not available
Carrot Protocol Documentation
Carrot Protocol Documentation
@carrot-protocol/rpc-client
RpcClient
Class RpcClient
Index
Constructors
constructor
Properties
fee
Amount
instructions
lut
Address
provider
skip
Preflight
Checks
use
Jito
Methods
add
Asset
address
begin
And
Complete
Chest
Redemption
chest
Strategy
Deposit
chest
Strategy
Init
chest
Strategy
Request
Withdraw
chest
Strategy
Withdraw
claim
Emissions
distribute
Vault
Fees
drift
Insurance
Fund
Strategy
Init
drift
Insurance
Fund
Strategy
Stake
drift
Insurance
Fund
Strategy
Unstake
drift
Insurance
Fund
Strategy
Withdraw
drift
Supply
Strategy
Init
get
Asset
get
Cu
Limit
Ix
get
Events
get
Jito
Tip
Ix
get
Luts
get
Priority
Fee
Ix
get
Strategy
get
Vault
initialize
issue
klend
Supply
Strategy
Init
mango
Supply
Strategy
Init
marginfi
Supply
Strategy
Init
migrate
Vault
Account
pause
Vault
prepare
Issue
prepare
Redeem
rebalance
redeem
remove
Asset
remove
Strategy
send
solend
Supply
Strategy
Init
transfer
Vault
Authority
update
Asset
update
Fee
update
Strategy
update
Switchboard
Oracle
Price
Constructors
constructor
new
RpcClient
(
cfg
:
RpcClientConfig
)
:
RpcClient
Parameters
cfg
:
RpcClientConfig
Returns
RpcClient
Properties
Readonly
fee
Amount
feeAmount
:
number
Readonly
instructions
instructions
:
Instructions
Readonly
lut
Address
lutAddress
:
undefined
|
PublicKey
Readonly
provider
provider
:
AnchorProvider
Readonly
skip
Preflight
Checks
skipPreflightChecks
:
boolean
Readonly
use
Jito
useJito
:
boolean
Methods
add
Asset
addAsset
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
assetOracle
:
PublicKey
,
assetTokenProgram
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
assetOracle
:
PublicKey
assetTokenProgram
:
PublicKey
Returns
Promise
<
string
>
address
address
()
:
PublicKey
Returns
PublicKey
begin
And
Complete
Chest
Redemption
beginAndCompleteChestRedemption
(
chest
:
PublicKey
)
:
Promise
<
string
>
Parameters
chest
:
PublicKey
Returns
Promise
<
string
>
chest
Strategy
Deposit
chestStrategyDeposit
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
chest
Strategy
Init
chestStrategyInit
(
vault
:
PublicKey
,
chest
:
PublicKey
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
chest
:
PublicKey
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
chest
Strategy
Request
Withdraw
chestStrategyRequestWithdraw
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
chest
Strategy
Withdraw
chestStrategyWithdraw
(
vault
:
PublicKey
,
strategy
:
PublicKey
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
Returns
Promise
<
string
>
claim
Emissions
claimEmissions
(
vault
:
PublicKey
,
strategy
:
PublicKey
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
Returns
Promise
<
string
>
distribute
Vault
Fees
distributeVaultFees
(
vault
:
PublicKey
,
feeDestinationOwner
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
feeDestinationOwner
:
PublicKey
Returns
Promise
<
string
>
drift
Insurance
Fund
Strategy
Init
driftInsuranceFundStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
driftState
:
PublicKey
,
driftSpotMarket
:
PublicKey
,
driftSpotMarketVault
:
PublicKey
,
driftMarketIndex
:
number
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
driftState
:
PublicKey
driftSpotMarket
:
PublicKey
driftSpotMarketVault
:
PublicKey
driftMarketIndex
:
number
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
drift
Insurance
Fund
Strategy
Stake
driftInsuranceFundStrategyStake
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
drift
Insurance
Fund
Strategy
Unstake
driftInsuranceFundStrategyUnstake
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
drift
Insurance
Fund
Strategy
Withdraw
driftInsuranceFundStrategyWithdraw
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
Returns
Promise
<
string
>
drift
Supply
Strategy
Init
driftSupplyStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
driftState
:
PublicKey
,
driftSpotMarket
:
PublicKey
,
driftSpotMarketVault
:
PublicKey
,
driftPerpMarket
:
PublicKey
,
spotPythOracle
:
PublicKey
,
perpPythOracle
:
PublicKey
,
driftMarketIndex
:
number
,
driftSubAccountId
:
number
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
driftState
:
PublicKey
driftSpotMarket
:
PublicKey
driftSpotMarketVault
:
PublicKey
driftPerpMarket
:
PublicKey
spotPythOracle
:
PublicKey
perpPythOracle
:
PublicKey
driftMarketIndex
:
number
driftSubAccountId
:
number
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
get
Asset
getAsset
(
assetRaw
:
any
)
:
Promise
<
Common
.
Asset
>
Parameters
assetRaw
:
any
Returns
Promise
<
Common
.
Asset
>
get
Cu
Limit
Ix
getCuLimitIx
(
ixCount
?:
number
)
:
Promise
<
TransactionInstruction
>
Parameters
ixCount
:
number
= 3
Returns
Promise
<
TransactionInstruction
>
get
Events
getEvents
(
txSigs
:
string
[]
)
:
Promise
<
Common
.
CarrotEvent
[]
>
Parameters
txSigs
:
string
[]
Returns
Promise
<
Common
.
CarrotEvent
[]
>
get
Jito
Tip
Ix
getJitoTipIx
(
tipper
?:
PublicKey
)
:
TransactionInstruction
Parameters
Optional
tipper
:
PublicKey
Returns
TransactionInstruction
get
Luts
getLuts
()
:
Promise
<
AddressLookupTableAccount
[]
>
Returns
Promise
<
AddressLookupTableAccount
[]
>
get
Priority
Fee
Ix
getPriorityFeeIx
()
:
Promise
<
TransactionInstruction
>
Returns
Promise
<
TransactionInstruction
>
get
Strategy
getStrategy
(
vault
:
PublicKey
,
record
:
Common
.
StrategyRecord
,
strategyAccountInfoData
:
Buffer
,
)
:
Promise
<
Common
.
Strategy
>
Parameters
vault
:
PublicKey
record
:
Common
.
StrategyRecord
strategyAccountInfoData
:
Buffer
Returns
Promise
<
Common
.
Strategy
>
get
Vault
getVault
(
vault
:
PublicKey
)
:
Promise
<
Common
.
Vault
>
Parameters
vault
:
PublicKey
Returns
Promise
<
Common
.
Vault
>
initialize
initialize
(
redemptionFeeBps
?:
number
,
managementFeeBps
?:
number
,
performanceFeeBps
?:
number
,
sharesMint
?:
PublicKey
,
)
:
Promise
<
{
txSig
:
string
;
vault
:
PublicKey
}
>
Parameters
redemptionFeeBps
:
number
= 20
managementFeeBps
:
number
= 20
performanceFeeBps
:
number
= 20
Optional
sharesMint
:
PublicKey
Returns
Promise
<
{
txSig
:
string
;
vault
:
PublicKey
}
>
issue
issue
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
amount
:
BN
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
klend
Supply
Strategy
Init
klendSupplyStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
assetPythOracle
:
PublicKey
,
lendingMarket
:
PublicKey
,
reserve
:
PublicKey
,
reserveFarmState
:
PublicKey
,
reserveCollateralMint
:
PublicKey
,
reserveLiquiditySupply
:
PublicKey
,
reserveDestinationDepositCollateral
:
PublicKey
,
scopePrices
:
PublicKey
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
assetPythOracle
:
PublicKey
lendingMarket
:
PublicKey
reserve
:
PublicKey
reserveFarmState
:
PublicKey
reserveCollateralMint
:
PublicKey
reserveLiquiditySupply
:
PublicKey
reserveDestinationDepositCollateral
:
PublicKey
scopePrices
:
PublicKey
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
mango
Supply
Strategy
Init
mangoSupplyStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
mangoGroup
:
PublicKey
,
mangoBank
:
PublicKey
,
mangoVault
:
PublicKey
,
pythOracle
:
PublicKey
,
switchboardOracle
:
PublicKey
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
mangoGroup
:
PublicKey
mangoBank
:
PublicKey
mangoVault
:
PublicKey
pythOracle
:
PublicKey
switchboardOracle
:
PublicKey
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
marginfi
Supply
Strategy
Init
marginfiSupplyStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
marginfiGroup
:
PublicKey
,
marginfiBank
:
PublicKey
,
marginfiBankLiquidityVault
:
PublicKey
,
marginfiBankLiquidityVaultAuthority
:
PublicKey
,
marginfiOracle
:
PublicKey
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
marginfiGroup
:
PublicKey
marginfiBank
:
PublicKey
marginfiBankLiquidityVault
:
PublicKey
marginfiBankLiquidityVaultAuthority
:
PublicKey
marginfiOracle
:
PublicKey
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
migrate
Vault
Account
migrateVaultAccount
(
vault
:
PublicKey
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
Returns
Promise
<
string
>
pause
Vault
pauseVault
(
vault
:
PublicKey
,
paused
:
boolean
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
paused
:
boolean
Returns
Promise
<
string
>
prepare
Issue
prepareIssue
(
vault
:
PublicKey
,
user
:
PublicKey
,
assetMint
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
TransactionInstruction
[]
>
Parameters
vault
:
PublicKey
user
:
PublicKey
assetMint
:
PublicKey
amount
:
BN
Returns
Promise
<
TransactionInstruction
[]
>
prepare
Redeem
prepareRedeem
(
vault
:
PublicKey
,
user
:
PublicKey
,
assetMint
:
PublicKey
,
amount
:
BN
,
)
:
Promise
<
TransactionInstruction
[]
>
Parameters
vault
:
PublicKey
user
:
PublicKey
assetMint
:
PublicKey
amount
:
BN
Returns
Promise
<
TransactionInstruction
[]
>
rebalance
rebalance
(
vault
:
PublicKey
,
rebalanceRequest
:
Common
.
RebalanceRequest
[]
,
)
:
Promise
<
string
[]
>
Parameters
vault
:
PublicKey
rebalanceRequest
:
Common
.
RebalanceRequest
[]
Returns
Promise
<
string
[]
>
redeem
redeem
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
amount
:
BN
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
amount
:
BN
Returns
Promise
<
string
>
remove
Asset
removeAsset
(
vault
:
PublicKey
,
assetMint
:
PublicKey
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
Returns
Promise
<
string
>
remove
Strategy
removeStrategy
(
vault
:
PublicKey
,
strategy
:
PublicKey
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
Returns
Promise
<
string
>
send
send
(
ixBatches
:
TransactionInstruction
[]
[]
,
additionalSigners
?:
Signer
[]
[]
,
)
:
Promise
<
string
[]
>
Parameters
ixBatches
:
TransactionInstruction
[]
[]
additionalSigners
:
Signer
[]
[]
= []
Returns
Promise
<
string
[]
>
solend
Supply
Strategy
Init
solendSupplyStrategyInit
(
vault
:
PublicKey
,
assetMint
:
PublicKey
,
assetPythOracle
:
PublicKey
,
assetSwitchboardOracle
:
PublicKey
,
reserve
:
PublicKey
,
reserveCollateralMint
:
PublicKey
,
reserveLiquiditySupply
:
PublicKey
,
depositCollateralAta
:
PublicKey
,
lendingMarket
:
PublicKey
,
lendingMarketAuthority
:
PublicKey
,
strategyName
:
string
,
)
:
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
Parameters
vault
:
PublicKey
assetMint
:
PublicKey
assetPythOracle
:
PublicKey
assetSwitchboardOracle
:
PublicKey
reserve
:
PublicKey
reserveCollateralMint
:
PublicKey
reserveLiquiditySupply
:
PublicKey
depositCollateralAta
:
PublicKey
lendingMarket
:
PublicKey
lendingMarketAuthority
:
PublicKey
strategyName
:
string
Returns
Promise
<
{
strategy
:
PublicKey
;
txSig
:
string
}
>
transfer
Vault
Authority
transferVaultAuthority
(
vault
:
PublicKey
,
newAuthority
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
newAuthority
:
PublicKey
Returns
Promise
<
string
>
update
Asset
updateAsset
(
vault
:
PublicKey
,
assetId
:
number
,
assetNewOracle
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
assetId
:
number
assetNewOracle
:
PublicKey
Returns
Promise
<
string
>
update
Fee
updateFee
(
vault
:
PublicKey
,
newRedemptionFeeBps
:
null
|
number
,
newManagementFeeBps
:
null
|
number
,
newPerformanceFeeBps
:
null
|
number
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
newRedemptionFeeBps
:
null
|
number
newManagementFeeBps
:
null
|
number
newPerformanceFeeBps
:
null
|
number
Returns
Promise
<
string
>
update
Strategy
updateStrategy
(
vault
:
PublicKey
,
strategy
:
PublicKey
,
newStrategyType
:
Common
.
StrategyType
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
strategy
:
PublicKey
newStrategyType
:
Common
.
StrategyType
Returns
Promise
<
string
>
update
Switchboard
Oracle
Price
updateSwitchboardOraclePrice
(
vault
:
PublicKey
,
queue
:
PublicKey
,
feed
:
PublicKey
,
)
:
Promise
<
string
>
Parameters
vault
:
PublicKey
queue
:
PublicKey
feed
:
PublicKey
Returns
Promise
<
string
>
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
On This Page
Constructors
constructor
Properties
fee
Amount
instructions
lut
Address
provider
skip
Preflight
Checks
use
Jito
Methods
add
Asset
address
begin
And
Complete
Chest
Redemption
chest
Strategy
Deposit
chest
Strategy
Init
chest
Strategy
Request
Withdraw
chest
Strategy
Withdraw
claim
Emissions
distribute
Vault
Fees
drift
Insurance
Fund
Strategy
Init
drift
Insurance
Fund
Strategy
Stake
drift
Insurance
Fund
Strategy
Unstake
drift
Insurance
Fund
Strategy
Withdraw
drift
Supply
Strategy
Init
get
Asset
get
Cu
Limit
Ix
get
Events
get
Jito
Tip
Ix
get
Luts
get
Priority
Fee
Ix
get
Strategy
get
Vault
initialize
issue
klend
Supply
Strategy
Init
mango
Supply
Strategy
Init
marginfi
Supply
Strategy
Init
migrate
Vault
Account
pause
Vault
prepare
Issue
prepare
Redeem
rebalance
redeem
remove
Asset
remove
Strategy
send
solend
Supply
Strategy
Init
transfer
Vault
Authority
update
Asset
update
Fee
update
Strategy
update
Switchboard
Oracle
Price
Carrot Protocol Documentation
Loading...