Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update idl and client tokenEdit() #814

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
99 changes: 75 additions & 24 deletions mango_v4.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "0.20.0",
"version": "0.22.0",
"name": "mango_v4",
"instructions": [
{
Expand Down Expand Up @@ -485,6 +485,11 @@
"isMut": false,
"isSigner": false
},
{
"name": "fallbackOracle",
"isMut": false,
"isSigner": false
},
{
"name": "payer",
"isMut": true,
Expand Down Expand Up @@ -727,6 +732,11 @@
"isMut": false,
"isSigner": false
},
{
"name": "fallbackOracle",
"isMut": false,
"isSigner": false
},
{
"name": "payer",
"isMut": true,
Expand Down Expand Up @@ -788,6 +798,15 @@
"The oracle account is optional and only used when reset_stable_price is set.",
""
]
},
{
"name": "fallbackOracle",
"isMut": false,
"isSigner": false,
"docs": [
"The fallback oracle account is optional and only used when set_fallback_oracle is true.",
""
]
}
],
"args": [
Expand Down Expand Up @@ -993,6 +1012,10 @@
"name": "maintWeightShiftAbort",
"type": "bool"
},
{
"name": "setFallbackOracle",
"type": "bool"
},
{
"name": "depositLimitOpt",
"type": {
Expand Down Expand Up @@ -1699,27 +1722,7 @@
{
"name": "oracle",
"isMut": true,
"isSigner": false,
"pda": {
"seeds": [
{
"kind": "const",
"type": "string",
"value": "StubOracle"
},
{
"kind": "account",
"type": "publicKey",
"path": "group"
},
{
"kind": "account",
"type": "publicKey",
"account": "Mint",
"path": "mint"
}
]
}
"isSigner": true
},
{
"name": "admin",
Expand Down Expand Up @@ -7388,6 +7391,10 @@
"defined": "I80F48"
}
},
{
"name": "fallbackOracle",
"type": "publicKey"
},
{
"name": "depositLimit",
"docs": [
Expand All @@ -7400,7 +7407,7 @@
"type": {
"array": [
"u8",
2000
1968
]
}
}
Expand Down Expand Up @@ -7799,12 +7806,16 @@
"name": "registrationTime",
"type": "u64"
},
{
"name": "fallbackOracle",
"type": "publicKey"
},
{
"name": "reserved",
"type": {
"array": [
"u8",
2560
2528
]
}
}
Expand Down Expand Up @@ -12234,6 +12245,46 @@
}
]
},
{
"name": "TokenMetaDataLogV2",
"fields": [
{
"name": "mangoGroup",
"type": "publicKey",
"index": false
},
{
"name": "mint",
"type": "publicKey",
"index": false
},
{
"name": "tokenIndex",
"type": "u16",
"index": false
},
{
"name": "mintDecimals",
"type": "u8",
"index": false
},
{
"name": "oracle",
"type": "publicKey",
"index": false
},
{
"name": "fallbackOracle",
"type": "publicKey",
"index": false
},
{
"name": "mintInfo",
"type": "publicKey",
"index": false
}
]
},
{
"name": "PerpMarketMetaDataLog",
"fields": [
Expand Down
1 change: 1 addition & 0 deletions ts/client/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,7 @@ export class MangoClient {
params.maintWeightShiftAssetTarget,
params.maintWeightShiftLiabTarget,
params.maintWeightShiftAbort ?? false,
params.setFallbackOracle ?? false,
params.depositLimit,
)
.accounts({
Expand Down
2 changes: 2 additions & 0 deletions ts/client/src/clientIxParamBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ export interface TokenEditParams {
maintWeightShiftAssetTarget: number | null;
maintWeightShiftLiabTarget: number | null;
maintWeightShiftAbort: boolean | null;
setFallbackOracle: boolean | null;
depositLimit: BN | null;
}

Expand Down Expand Up @@ -141,6 +142,7 @@ export const NullTokenEditParams: TokenEditParams = {
maintWeightShiftAssetTarget: null,
maintWeightShiftLiabTarget: null,
maintWeightShiftAbort: null,
setFallbackOracle: null,
depositLimit: null,
};

Expand Down
Loading