TokenEdit: remove bank_num arg
This commit is contained in:
parent
14913c70d2
commit
3fbc3ca32d
|
@ -27,6 +27,7 @@ pub struct PerpSettlePnl<'info> {
|
||||||
#[account(mut, has_one = group)]
|
#[account(mut, has_one = group)]
|
||||||
pub account_b: AccountLoaderDynamic<'info, MangoAccount>,
|
pub account_b: AccountLoaderDynamic<'info, MangoAccount>,
|
||||||
|
|
||||||
|
/// CHECK: Oracle can have different account types, constrained by address in perp_market
|
||||||
pub oracle: UncheckedAccount<'info>,
|
pub oracle: UncheckedAccount<'info>,
|
||||||
|
|
||||||
#[account(mut, has_one = group)]
|
#[account(mut, has_one = group)]
|
||||||
|
|
|
@ -12,7 +12,6 @@ use crate::state::*;
|
||||||
/// In addition to these accounts, all banks must be passed as remaining_accounts
|
/// In addition to these accounts, all banks must be passed as remaining_accounts
|
||||||
/// in MintInfo order.
|
/// in MintInfo order.
|
||||||
#[derive(Accounts)]
|
#[derive(Accounts)]
|
||||||
#[instruction(bank_num: u64)]
|
|
||||||
pub struct TokenEdit<'info> {
|
pub struct TokenEdit<'info> {
|
||||||
#[account(
|
#[account(
|
||||||
has_one = admin,
|
has_one = admin,
|
||||||
|
@ -31,7 +30,6 @@ pub struct TokenEdit<'info> {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn token_edit(
|
pub fn token_edit(
|
||||||
ctx: Context<TokenEdit>,
|
ctx: Context<TokenEdit>,
|
||||||
bank_num: u64,
|
|
||||||
oracle_opt: Option<Pubkey>,
|
oracle_opt: Option<Pubkey>,
|
||||||
oracle_config_opt: Option<OracleConfig>,
|
oracle_config_opt: Option<OracleConfig>,
|
||||||
group_insurance_fund_opt: Option<bool>,
|
group_insurance_fund_opt: Option<bool>,
|
||||||
|
|
|
@ -101,7 +101,6 @@ pub mod mango_v4 {
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
pub fn token_edit(
|
pub fn token_edit(
|
||||||
ctx: Context<TokenEdit>,
|
ctx: Context<TokenEdit>,
|
||||||
bank_num: u64,
|
|
||||||
oracle_opt: Option<Pubkey>,
|
oracle_opt: Option<Pubkey>,
|
||||||
oracle_config_opt: Option<OracleConfig>,
|
oracle_config_opt: Option<OracleConfig>,
|
||||||
group_insurance_fund_opt: Option<bool>,
|
group_insurance_fund_opt: Option<bool>,
|
||||||
|
@ -116,7 +115,6 @@ pub mod mango_v4 {
|
||||||
) -> Result<()> {
|
) -> Result<()> {
|
||||||
instructions::token_edit(
|
instructions::token_edit(
|
||||||
ctx,
|
ctx,
|
||||||
bank_num,
|
|
||||||
oracle_opt,
|
oracle_opt,
|
||||||
oracle_config_opt,
|
oracle_config_opt,
|
||||||
group_insurance_fund_opt,
|
group_insurance_fund_opt,
|
||||||
|
|
|
@ -294,7 +294,6 @@ export class MangoClient {
|
||||||
|
|
||||||
return await this.program.methods
|
return await this.program.methods
|
||||||
.tokenEdit(
|
.tokenEdit(
|
||||||
new BN(0),
|
|
||||||
oracle,
|
oracle,
|
||||||
oracleConf,
|
oracleConf,
|
||||||
groupInsuranceFund,
|
groupInsuranceFund,
|
||||||
|
|
|
@ -502,10 +502,6 @@ export type MangoV4 = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
{
|
|
||||||
"name": "bankNum",
|
|
||||||
"type": "u64"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "oracleOpt",
|
"name": "oracleOpt",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -2692,6 +2688,49 @@ export type MangoV4 = {
|
||||||
],
|
],
|
||||||
"args": []
|
"args": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "perpSettlePnl",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "perpMarket",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accountA",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accountB",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oracle",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quoteBank",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "maxSettleAmount",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "computeAccountData",
|
"name": "computeAccountData",
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -5308,6 +5347,31 @@ export type MangoV4 = {
|
||||||
"code": 6016,
|
"code": 6016,
|
||||||
"name": "BeingLiquidated",
|
"name": "BeingLiquidated",
|
||||||
"msg": "account is currently being liquidated"
|
"msg": "account is currently being liquidated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6017,
|
||||||
|
"name": "InvalidBank",
|
||||||
|
"msg": "invalid bank"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6018,
|
||||||
|
"name": "ProfitabilityMismatch",
|
||||||
|
"msg": "account profitability is mismatched"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6019,
|
||||||
|
"name": "CannotSettleWithSelf",
|
||||||
|
"msg": "cannot settle with self"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6020,
|
||||||
|
"name": "PerpPositionDoesNotExist",
|
||||||
|
"msg": "perp position does not exist"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6021,
|
||||||
|
"name": "MaxSettleAmountMustBeGreaterThanZero",
|
||||||
|
"msg": "max settle amount must be greater than zero"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
@ -5816,10 +5880,6 @@ export const IDL: MangoV4 = {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"args": [
|
"args": [
|
||||||
{
|
|
||||||
"name": "bankNum",
|
|
||||||
"type": "u64"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "oracleOpt",
|
"name": "oracleOpt",
|
||||||
"type": {
|
"type": {
|
||||||
|
@ -8006,6 +8066,49 @@ export const IDL: MangoV4 = {
|
||||||
],
|
],
|
||||||
"args": []
|
"args": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "perpSettlePnl",
|
||||||
|
"accounts": [
|
||||||
|
{
|
||||||
|
"name": "group",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "perpMarket",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accountA",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "accountB",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "oracle",
|
||||||
|
"isMut": false,
|
||||||
|
"isSigner": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "quoteBank",
|
||||||
|
"isMut": true,
|
||||||
|
"isSigner": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"args": [
|
||||||
|
{
|
||||||
|
"name": "maxSettleAmount",
|
||||||
|
"type": {
|
||||||
|
"defined": "I80F48"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "computeAccountData",
|
"name": "computeAccountData",
|
||||||
"accounts": [
|
"accounts": [
|
||||||
|
@ -10622,6 +10725,31 @@ export const IDL: MangoV4 = {
|
||||||
"code": 6016,
|
"code": 6016,
|
||||||
"name": "BeingLiquidated",
|
"name": "BeingLiquidated",
|
||||||
"msg": "account is currently being liquidated"
|
"msg": "account is currently being liquidated"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6017,
|
||||||
|
"name": "InvalidBank",
|
||||||
|
"msg": "invalid bank"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6018,
|
||||||
|
"name": "ProfitabilityMismatch",
|
||||||
|
"msg": "account profitability is mismatched"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6019,
|
||||||
|
"name": "CannotSettleWithSelf",
|
||||||
|
"msg": "cannot settle with self"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6020,
|
||||||
|
"name": "PerpPositionDoesNotExist",
|
||||||
|
"msg": "perp position does not exist"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"code": 6021,
|
||||||
|
"name": "MaxSettleAmountMustBeGreaterThanZero",
|
||||||
|
"msg": "max settle amount must be greater than zero"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue