forked from solana-labs/governance-ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from UXDProtocol/uxd_upgrade
UXD admin calls integration
- Loading branch information
Showing
29 changed files
with
2,737 additions
and
169 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,362 @@ | ||
import { Connection } from '@solana/web3.js' | ||
import { struct, u8, u48 } from 'buffer-layout' | ||
import { AccountMetaData } from '../../../models/accounts' | ||
|
||
export const UXD_PROGRAM_INSTRUCTIONS = { | ||
'73yvDSPxhtXmi8Gaheobm32n3jMdbvQzCahXgqqE12My': { | ||
1: { | ||
name: 'UXD - Initialize Controller', | ||
accounts: [ | ||
'authority', | ||
'payer', | ||
'controller', | ||
'redeemableMint', | ||
'systemProgram', | ||
'tokenProgram', | ||
'rent', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([ | ||
u8('bump'), | ||
u8('redeemableBump'), | ||
u8('redeemableMintDecimals'), | ||
]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
2: { | ||
name: 'UXD - Set Redeemable Global Supply Cap', | ||
accounts: ['authority', 'controller'], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
3: { | ||
name: 'UXD - Set Mango Depositories Redeemable Supply Soft Cap', | ||
accounts: ['authority', 'controller'], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
4: { | ||
name: 'UXD - Register Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'payer', | ||
'controller', | ||
'depository', | ||
'collateralMint', // BTC/ WSOL..... | ||
'insuranceMint', // USDC | ||
'depositoryCollateralPassthroughAccount', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
'mangoGroup', | ||
'rent', | ||
'systemProgram', | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
5: { | ||
name: 'UXD - Deposit Insurance To Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'controller', | ||
'depository', | ||
'insuranceMint', | ||
'authorityInsurance', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
// mango accounts for CPI | ||
'mangoGroup', | ||
'mangoCache', | ||
'mangoRootBank', | ||
'mangoNodeBank', | ||
'mangoVault', | ||
// | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
6: { | ||
name: 'UXD - Withdraw Insurance From Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'controller', | ||
'depository', | ||
'insuranceMint', | ||
'authorityInsurance', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
// mango accounts for CPI | ||
'mangoGroup', | ||
'mangoCache', | ||
'mangoSigner', | ||
'mangoRootBank', | ||
'mangoNodeBank', | ||
'mangoVault', | ||
// | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
}, | ||
CBSkoqgGtB4772H7FqeE6wz56rLbsxxbVjxEG6JmHzwG: { | ||
1: { | ||
name: 'UXD - Initialize Controller', | ||
accounts: [ | ||
'authority', | ||
'payer', | ||
'controller', | ||
'redeemableMint', | ||
'systemProgram', | ||
'tokenProgram', | ||
'rent', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([ | ||
u8('bump'), | ||
u8('redeemableBump'), | ||
u8('redeemableMintDecimals'), | ||
]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
2: { | ||
name: 'UXD - Set Redeemable Global Supply Cap', | ||
accounts: ['authority', 'controller'], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
3: { | ||
name: 'UXD - Set Mango Depositories Redeemable Supply Soft Cap', | ||
accounts: ['authority', 'controller'], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
4: { | ||
name: 'UXD - Register Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'payer', | ||
'controller', | ||
'depository', | ||
'collateralMint', // BTC/ WSOL..... | ||
'insuranceMint', // USDC | ||
'depositoryCollateralPassthroughAccount', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
'mangoGroup', | ||
'rent', | ||
'systemProgram', | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
5: { | ||
name: 'UXD - Deposit Insurance To Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'controller', | ||
'depository', | ||
'insuranceMint', | ||
'authorityInsurance', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
// mango accounts for CPI | ||
'mangoGroup', | ||
'mangoCache', | ||
'mangoSigner', | ||
'mangoRootBank', | ||
'mangoNodeBank', | ||
'mangoVault', | ||
// | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
6: { | ||
name: 'UXD - Withdraw Insurance From Mango Depository', | ||
accounts: [ | ||
'authority', | ||
'controller', | ||
'depository', | ||
'insuranceMint', | ||
'authorityInsurance', | ||
'depositoryInsurancePassthroughAccount', | ||
'depositoryMangoAccount', | ||
// mango accounts for CPI | ||
'mangoGroup', | ||
'mangoCache', | ||
'mangoRootBank', | ||
'mangoNodeBank', | ||
'mangoVault', | ||
// | ||
'tokenProgram', | ||
'mangoProgram', | ||
], | ||
getDataUI: ( | ||
_connection: Connection, | ||
data: Uint8Array, | ||
_accounts: AccountMetaData[] | ||
) => { | ||
const dataLayout = struct([u48('redeemable_global_supply_cap')]) | ||
|
||
const args = dataLayout.decode(Buffer.from(data)) as any | ||
console.log('args', args) | ||
return ( | ||
<> | ||
<p>{args}</p> | ||
</> | ||
) | ||
}, | ||
}, | ||
}, | ||
} |
Oops, something went wrong.
7c3a9bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployment failed with the following error:
7c3a9bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
governance-ui – ./
governance-ui-one.vercel.app
governance.uxd.fi
governance-ui-uxdprotocol.vercel.app
governance-ui-git-main-uxdprotocol.vercel.app