Skip to content

Commit

Permalink
upgrade client (#2430)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Aug 29, 2024
1 parent 06f2aed commit 1179372
Show file tree
Hide file tree
Showing 5 changed files with 287 additions and 161 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"dependencies": {
"@blockworks-foundation/mango-mints-redemption": "0.0.11",
"@blockworks-foundation/mango-v4": "0.32.12",
"@blockworks-foundation/mango-v4": "0.33.4",
"@blockworks-foundation/mango-v4-settings": "0.14.24",
"@blockworks-foundation/mangolana": "0.0.18",
"@bonfida/spl-name-service": "0.1.47",
Expand Down Expand Up @@ -240,6 +240,7 @@
"@nivo/bar/**/d3-color": "3.1.0",
"dset": "3.1.2",
"**/@solana/spl-token-registry/cross-fetch/node-fetch": "2.6.7",
"**/@blockworks-foundation/mangolana/node-fetch": "npm:@blockworks-foundation/[email protected]",
"@bonfida/spl-name-service": "0.1.47",
"@bundlr-network/client": "0.7.15",
"@carbon/icons-react": "11.7.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ interface EditTokenForm {
disableAssetLiquidation: boolean
collateralFeePerDay: number
forceWithdraw: boolean
tier: string
}

const defaultFormValues: EditTokenForm = {
Expand Down Expand Up @@ -190,6 +191,7 @@ const defaultFormValues: EditTokenForm = {
disableAssetLiquidation: false,
collateralFeePerDay: 0,
forceWithdraw: false,
tier: '',
}

const EditToken = ({
Expand Down Expand Up @@ -361,7 +363,8 @@ const EditToken = ({
getNullOrTransform(values.platformLiquidationFee, null, Number),
values.disableAssetLiquidation!,
getNullOrTransform(values.collateralFeePerDay, null, Number),
values.forceWithdraw!
values.forceWithdraw!,
getNullOrTransform(values.tier, null, String)
)
.accounts({
group: mangoGroup!.publicKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ const IxGateSet = ({
TokenForceWithdraw: true,
SequenceCheck: true,
HealthCheck: true,
GroupChangeInsuranceFund: true,
})
const [formErrors, setFormErrors] = useState({})
const { handleSetInstructions } = useContext(NewProposalContext)
Expand Down Expand Up @@ -661,6 +662,12 @@ const IxGateSet = ({
type: InstructionInputType.SWITCH,
name: 'HealthCheck',
},
{
label: 'Group Change Insurance Fund',
initialValue: form.GroupChangeInsuranceFund,
type: InstructionInputType.SWITCH,
name: 'GroupChangeInsuranceFund',
},
]

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ interface TokenRegisterForm {
platformLiquidationFee: number
disableAssetLiquidation: boolean
collateralFeePerDay: number
tier: string
}

const TokenRegister = ({
Expand Down Expand Up @@ -134,6 +135,7 @@ const TokenRegister = ({
platformLiquidationFee: 0,
disableAssetLiquidation: false,
collateralFeePerDay: 0,
tier: '',
})
const [formErrors, setFormErrors] = useState({})
const { handleSetInstructions } = useContext(NewProposalContext)
Expand Down Expand Up @@ -196,7 +198,8 @@ const TokenRegister = ({
Number(form.zeroUtilRate),
Number(form.platformLiquidationFee),
form.disableAssetLiquidation,
Number(form.collateralFeePerDay)
Number(form.collateralFeePerDay),
form.tier
)
.accounts({
group: mangoGroup!.publicKey,
Expand Down Expand Up @@ -591,6 +594,12 @@ const TokenRegister = ({
inputType: 'number',
name: 'collateralFeePerDay',
},
{
label: 'Token Tier',
initialValue: form.tier,
type: InstructionInputType.INPUT,
name: 'tier',
},
]

return (
Expand Down
Loading

0 comments on commit 1179372

Please sign in to comment.