Skip to content

Commit

Permalink
remove example delegate signer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarnadas committed Nov 1, 2024
1 parent 0528d45 commit 2698ae8
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
7 changes: 0 additions & 7 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ import { DelegateSigner } from './DelegateSigner';
import { WalletConnection } from './WalletConnection';
import {
DelegateSignerResponse,
exampleDelegateContract,
getAccountId,
loadOrderlyKey,
isTestnet,
loadBrokerId,
loadContractAddress,
saveBrokerId,
saveContractAddress,
supportedChainIds
Expand All @@ -39,10 +36,6 @@ function App() {
setAccountId(undefined);
if (connectedChain) {
setBrokerId(loadBrokerId(connectedChain.id));
const address = loadContractAddress(connectedChain.id);
if (!address && isTestnet(connectedChain.id)) {
setContractAddress(exampleDelegateContract);
}
} else {
setBrokerId('');
setContractAddress('');
Expand Down
20 changes: 1 addition & 19 deletions src/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
AbiCoder
} from 'ethers';

import { DelegateSigner__factory, Vault__factory } from '../abi';
import { Vault__factory } from '../abi';
import { VaultTypes } from '../abi/Vault';

import {
Expand Down Expand Up @@ -105,8 +105,6 @@ const MESSAGE_TYPES = {
]
};

export const exampleDelegateContract = '0xa4394b62261061c629800c6d86d153a9f38f0cbb';

export type DelegateSignerResponse = {
// TODO no GET yet available
// account_id: string;
Expand Down Expand Up @@ -208,22 +206,6 @@ export async function addOrderlyKey(
return privateKey;
}

export async function registerExampleDelegateSigner(
wallet: WalletState,
brokerId: string,
chainId: string,
address: string
): Promise<string> {
const provider = new BrowserProvider(wallet.provider);
const signer = await provider.getSigner();
const contract = DelegateSigner__factory.connect(exampleDelegateContract, signer);
const res = await contract.delegate(getVaultAddress(chainId), {
brokerHash: solidityPackedKeccak256(['string'], [brokerId]),
delegateSigner: address
});
return res.hash;
}

export async function announceDelegateSigner(
wallet: WalletState,
chainId: string,
Expand Down

0 comments on commit 2698ae8

Please sign in to comment.