66import { PythOracle } from '@pythnetwork/client/lib/anchor'
77import { useAnchorWallet , useWallet } from '@solana/wallet-adapter-react'
88import { PublicKey } from '@solana/web3.js'
9- import Squads from '@sqds/mesh'
109import {
1110 createColumnHelper ,
1211 flexRender ,
@@ -15,8 +14,14 @@ import {
1514} from '@tanstack/react-table'
1615import copy from 'copy-to-clipboard'
1716import { useContext , useEffect , useState } from 'react'
17+ import { proposeInstructions } from 'xc-admin-common'
1818import { ClusterContext } from '../../contexts/ClusterContext'
1919import { usePythContext } from '../../contexts/PythContext'
20+ import {
21+ getMultisigCluster ,
22+ UPGRADE_MUTLTISIG ,
23+ useMultisig ,
24+ } from '../../hooks/useMultisig'
2025import CopyIcon from '../../images/icons/copy.inline.svg'
2126import ClusterSwitch from '../ClusterSwitch'
2227import EditButton from '../EditButton'
@@ -87,7 +92,12 @@ const UpdatePermissions = () => {
8792 const [ pubkeyChanges , setPubkeyChanges ] = useState < PubkeyChanges > ( { } )
8893 const [ editable , setEditable ] = useState ( false )
8994 const { cluster, setCluster } = useContext ( ClusterContext )
90- const [ sqdsClient , setSqdsClient ] = useState < Squads > ( )
95+ const {
96+ isLoading : isMultisigLoading ,
97+ error,
98+ squads,
99+ proposals,
100+ } = useMultisig ( )
91101 const { rawConfig, dataIsLoading, connection } = usePythContext ( )
92102 const anchorWallet = useAnchorWallet ( )
93103 const { publicKey, connected } = useWallet ( )
@@ -194,11 +204,26 @@ const UpdatePermissions = () => {
194204 } )
195205 . instruction ( )
196206 . then ( ( instruction ) => {
197- // TODO: propose ix
207+ if ( ! isMultisigLoading && squads ) {
208+ proposeInstructions (
209+ squads ,
210+ UPGRADE_MUTLTISIG [ getMultisigCluster ( cluster ) ] ,
211+ [ instruction ] ,
212+ false
213+ )
214+ }
198215 } )
199216 }
200217 }
201- } , [ editable , pubkeyChanges , pythProgramClient , data ] )
218+ } , [
219+ editable ,
220+ pubkeyChanges ,
221+ pythProgramClient ,
222+ data ,
223+ cluster ,
224+ isMultisigLoading ,
225+ squads ,
226+ ] )
202227
203228 // create anchor wallet when connected
204229 useEffect ( ( ) => {
0 commit comments