@wireio/stake 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +114 -0
- package/README.md +28 -0
- package/lib/stake.browser.js +6875 -0
- package/lib/stake.browser.js.map +1 -0
- package/lib/stake.d.ts +6759 -0
- package/lib/stake.js +7178 -0
- package/lib/stake.js.map +1 -0
- package/lib/stake.m.js +6875 -0
- package/lib/stake.m.js.map +1 -0
- package/package.json +102 -0
- package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.dbg.json +4 -0
- package/src/assets/ethereum/ABI/token/ERC1155Token.sol/ERC1155Token.json +472 -0
- package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.dbg.json +4 -0
- package/src/assets/ethereum/ABI/token/ERC20Token.sol/ERC20Token.json +330 -0
- package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.dbg.json +4 -0
- package/src/assets/ethereum/ABI/token/ERC721Token.sol/ERC721Token.json +449 -0
- package/src/assets/solana/idl/deposit.json +260 -0
- package/src/assets/solana/idl/distribution.json +736 -0
- package/src/assets/solana/idl/liq_sol_token.json +275 -0
- package/src/assets/solana/idl/stake_controller.json +1788 -0
- package/src/assets/solana/idl/stake_registry.json +435 -0
- package/src/assets/solana/idl/treasury.json +336 -0
- package/src/assets/solana/idl/validator_leaderboard.json +528 -0
- package/src/assets/solana/idl/validator_registry.json +418 -0
- package/src/assets/solana/idl/yield_oracle.json +32 -0
- package/src/assets/solana/types/deposit.ts +266 -0
- package/src/assets/solana/types/distribution.ts +742 -0
- package/src/assets/solana/types/liq_sol_token.ts +281 -0
- package/src/assets/solana/types/stake_controller.ts +1794 -0
- package/src/assets/solana/types/stake_registry.ts +441 -0
- package/src/assets/solana/types/treasury.ts +342 -0
- package/src/assets/solana/types/validator_leaderboard.ts +534 -0
- package/src/assets/solana/types/validator_registry.ts +424 -0
- package/src/assets/solana/types/yield_oracle.ts +38 -0
- package/src/index.ts +21 -0
- package/src/networks/ethereum/contract.ts +167 -0
- package/src/networks/ethereum/ethereum.ts +64 -0
- package/src/networks/ethereum/types.ts +6 -0
- package/src/networks/solana/clients/deposit.client.ts +178 -0
- package/src/networks/solana/clients/distribution.client.ts +230 -0
- package/src/networks/solana/clients/leaderboard.client.ts +179 -0
- package/src/networks/solana/constants.ts +73 -0
- package/src/networks/solana/program.ts +113 -0
- package/src/networks/solana/solana.ts +84 -0
- package/src/networks/solana/utils.ts +122 -0
- package/src/staker/staker.ts +38 -0
- package/src/staker/types.ts +26 -0
- package/src/utils.ts +9 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// src/solana/programService.ts
|
|
2
|
+
|
|
3
|
+
import { AnchorProvider, Program } from '@coral-xyz/anchor';
|
|
4
|
+
import { PublicKey } from '@solana/web3.js';
|
|
5
|
+
|
|
6
|
+
// 1) pull in all your on-chain IDLs (must match lowercase `src/assets/solana/idl`)
|
|
7
|
+
import depositJson from '../../assets/solana/idl/deposit.json';
|
|
8
|
+
import distributionJson from '../../assets/solana/idl/distribution.json';
|
|
9
|
+
import liqSolTokenJson from '../../assets/solana/idl/liq_sol_token.json';
|
|
10
|
+
import stakeControllerJson from '../../assets/solana/idl/stake_controller.json';
|
|
11
|
+
import stakeRegistryJson from '../../assets/solana/idl/stake_registry.json';
|
|
12
|
+
import treasuryJson from '../../assets/solana/idl/treasury.json';
|
|
13
|
+
import validatorLeaderboardJson from '../../assets/solana/idl/validator_leaderboard.json';
|
|
14
|
+
import validatorRegistryJson from '../../assets/solana/idl/validator_registry.json';
|
|
15
|
+
import yieldOracleJson from '../../assets/solana/idl/yield_oracle.json';
|
|
16
|
+
|
|
17
|
+
// 2) import their companion TS types
|
|
18
|
+
import type { Deposit } from '../../assets/solana/types/deposit';
|
|
19
|
+
import type { Distribution } from '../../assets/solana/types/distribution';
|
|
20
|
+
import type { LiqSolToken } from '../../assets/solana/types/liq_sol_token';
|
|
21
|
+
import type { StakeController } from '../../assets/solana/types/stake_controller';
|
|
22
|
+
import type { StakeRegistry } from '../../assets/solana/types/stake_registry';
|
|
23
|
+
import type { Treasury } from '../../assets/solana/types/treasury';
|
|
24
|
+
import type { ValidatorLeaderboard } from '../../assets/solana/types/validator_leaderboard';
|
|
25
|
+
import type { ValidatorRegistry } from '../../assets/solana/types/validator_registry';
|
|
26
|
+
import type { YieldOracle } from '../../assets/solana/types/yield_oracle';
|
|
27
|
+
|
|
28
|
+
type IdlEntry<IDL> = {
|
|
29
|
+
idl: IDL & { address: string };
|
|
30
|
+
address: PublicKey;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const PROGRAM_IDLS = {
|
|
34
|
+
deposit: {
|
|
35
|
+
idl: depositJson,
|
|
36
|
+
address: new PublicKey(depositJson.address),
|
|
37
|
+
} as IdlEntry<Deposit>,
|
|
38
|
+
|
|
39
|
+
distribution: {
|
|
40
|
+
idl: distributionJson,
|
|
41
|
+
address: new PublicKey(distributionJson.address),
|
|
42
|
+
} as IdlEntry<Distribution>,
|
|
43
|
+
|
|
44
|
+
liqSolToken: {
|
|
45
|
+
idl: liqSolTokenJson,
|
|
46
|
+
address: new PublicKey(liqSolTokenJson.address),
|
|
47
|
+
} as IdlEntry<LiqSolToken>,
|
|
48
|
+
|
|
49
|
+
stakeController: {
|
|
50
|
+
idl: stakeControllerJson,
|
|
51
|
+
address: new PublicKey(stakeControllerJson.address),
|
|
52
|
+
} as IdlEntry<StakeController>,
|
|
53
|
+
|
|
54
|
+
stakeRegistry: {
|
|
55
|
+
idl: stakeRegistryJson,
|
|
56
|
+
address: new PublicKey(stakeRegistryJson.address),
|
|
57
|
+
} as IdlEntry<StakeRegistry>,
|
|
58
|
+
|
|
59
|
+
treasury: {
|
|
60
|
+
idl: treasuryJson,
|
|
61
|
+
address: new PublicKey(treasuryJson.address),
|
|
62
|
+
} as IdlEntry<Treasury>,
|
|
63
|
+
|
|
64
|
+
validatorLeaderboard: {
|
|
65
|
+
idl: validatorLeaderboardJson,
|
|
66
|
+
address: new PublicKey(validatorLeaderboardJson.address),
|
|
67
|
+
} as IdlEntry<ValidatorLeaderboard>,
|
|
68
|
+
|
|
69
|
+
validatorRegistry: {
|
|
70
|
+
idl: validatorRegistryJson,
|
|
71
|
+
address: new PublicKey(validatorRegistryJson.address),
|
|
72
|
+
} as IdlEntry<ValidatorRegistry>,
|
|
73
|
+
|
|
74
|
+
yieldOracle: {
|
|
75
|
+
idl: yieldOracleJson,
|
|
76
|
+
address: new PublicKey(yieldOracleJson.address),
|
|
77
|
+
} as IdlEntry<YieldOracle>,
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Factory for Anchor Program clients.
|
|
82
|
+
*
|
|
83
|
+
* Anchor v0.28+ reads the program ID from `idl.address`, so
|
|
84
|
+
* we call the 2-arg constructor: `new Program(idl, provider)`.
|
|
85
|
+
*/
|
|
86
|
+
export class SolanaProgramService {
|
|
87
|
+
constructor(private provider: AnchorProvider) { }
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns a typed Anchor Program instance for the given key.
|
|
91
|
+
*/
|
|
92
|
+
getProgram<K extends keyof typeof PROGRAM_IDLS>(
|
|
93
|
+
name: K
|
|
94
|
+
): Program<(typeof PROGRAM_IDLS)[K]['idl']> {
|
|
95
|
+
const entry = PROGRAM_IDLS[name];
|
|
96
|
+
// stamp the correct address into a fresh copy of the IDL
|
|
97
|
+
const idlWithAddr = { ...entry.idl, address: entry.address.toString() };
|
|
98
|
+
// use the two-arg signature: (idl, provider)
|
|
99
|
+
return new Program(idlWithAddr as any, this.provider) as Program<
|
|
100
|
+
(typeof PROGRAM_IDLS)[K]['idl']
|
|
101
|
+
>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** List all program keys */
|
|
105
|
+
listProgramNames(): Array<keyof typeof PROGRAM_IDLS> {
|
|
106
|
+
return Object.keys(PROGRAM_IDLS) as Array<keyof typeof PROGRAM_IDLS>;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** Raw PublicKey of a program */
|
|
110
|
+
getProgramId(name: keyof typeof PROGRAM_IDLS): PublicKey {
|
|
111
|
+
return PROGRAM_IDLS[name].address;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Connection,
|
|
3
|
+
PublicKey as SolPubKey,
|
|
4
|
+
Transaction,
|
|
5
|
+
VersionedTransaction,
|
|
6
|
+
TransactionSignature,
|
|
7
|
+
Commitment,
|
|
8
|
+
} from '@solana/web3.js';
|
|
9
|
+
import { AnchorProvider } from '@coral-xyz/anchor';
|
|
10
|
+
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
11
|
+
import { IStakingClient, SolanaTransaction, StakerConfig } from '../../staker/types';
|
|
12
|
+
import { KeyType, PublicKey } from '@wireio/core';
|
|
13
|
+
import { DepositClient } from './clients/deposit.client';
|
|
14
|
+
import { DistributionClient } from './clients/distribution.client';
|
|
15
|
+
import { ValidatorLeaderboardClient } from './clients/leaderboard.client';
|
|
16
|
+
|
|
17
|
+
const commitment: Commitment = 'confirmed';
|
|
18
|
+
|
|
19
|
+
export class SolanaStakingClient implements IStakingClient {
|
|
20
|
+
public pubKey: PublicKey;
|
|
21
|
+
|
|
22
|
+
private connection: Connection;
|
|
23
|
+
private anchorProvider: AnchorProvider;
|
|
24
|
+
|
|
25
|
+
private depositClient: DepositClient;
|
|
26
|
+
private distributionClient: DistributionClient;
|
|
27
|
+
private leaderboardClient: ValidatorLeaderboardClient;
|
|
28
|
+
|
|
29
|
+
constructor(private config: StakerConfig) {
|
|
30
|
+
// 1) unwrap & validate wallet adapter
|
|
31
|
+
const adapter = config.provider as BaseSignerWalletAdapter;
|
|
32
|
+
if (!adapter.publicKey) {
|
|
33
|
+
throw new Error('Solana wallet adapter not connected');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// 2) sanity‐check wire ↔ solana pubkey
|
|
37
|
+
const solPub = adapter.publicKey;
|
|
38
|
+
const wirePub = new PublicKey(KeyType.ED, solPub.toBytes());
|
|
39
|
+
if (!wirePub.equals(config.pubKey)) {
|
|
40
|
+
throw new Error('Passed-in pubKey doesn’t match adapter.publicKey');
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
this.pubKey = wirePub;
|
|
44
|
+
this.connection = new Connection(config.network.rpcUrls[0], commitment);
|
|
45
|
+
|
|
46
|
+
const anchorWallet = {
|
|
47
|
+
publicKey: solPub,
|
|
48
|
+
async signTransaction<T extends SolanaTransaction>(tx: T): Promise<T> {
|
|
49
|
+
return adapter.signTransaction(tx);
|
|
50
|
+
},
|
|
51
|
+
async signAllTransactions<T extends SolanaTransaction>(txs: T[]): Promise<T[]> {
|
|
52
|
+
return Promise.all(txs.map((tx) => adapter.signTransaction(tx)));
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
this.anchorProvider = new AnchorProvider(
|
|
57
|
+
this.connection,
|
|
58
|
+
anchorWallet,
|
|
59
|
+
{ commitment }
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// 4) staking clients
|
|
63
|
+
this.depositClient = new DepositClient(this.anchorProvider);
|
|
64
|
+
this.distributionClient = new DistributionClient(this.anchorProvider);
|
|
65
|
+
this.leaderboardClient = new ValidatorLeaderboardClient(this.anchorProvider);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
async deposit(amount: number): Promise<string> {
|
|
69
|
+
const tx = await this.depositClient.buildDepositTx(
|
|
70
|
+
new SolPubKey(this.pubKey.data.array),
|
|
71
|
+
amount,
|
|
72
|
+
);
|
|
73
|
+
const signed = await this.signTransaction(tx.transaction);
|
|
74
|
+
return this.sendTransaction(signed);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async signTransaction(tx: SolanaTransaction): Promise<SolanaTransaction> {
|
|
78
|
+
return await this.anchorProvider.wallet.signTransaction(tx);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
async sendTransaction(signed: SolanaTransaction): Promise<TransactionSignature> {
|
|
82
|
+
return await this.anchorProvider.sendAndConfirm(signed);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// src/solana/utils.ts
|
|
2
|
+
import { AnchorProvider, Program } from '@coral-xyz/anchor'
|
|
3
|
+
import { PublicKey } from '@solana/web3.js'
|
|
4
|
+
import { getAssociatedTokenAddressSync, TOKEN_2022_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID } from '@solana/spl-token'
|
|
5
|
+
import {
|
|
6
|
+
DEPOSIT_PROGRAM_ID,
|
|
7
|
+
DISTRIBUTION_PROGRAM_ID,
|
|
8
|
+
STAKE_CONTROLLER_PROGRAM_ID,
|
|
9
|
+
VALIDATOR_LEADERBOARD_PROGRAM_ID,
|
|
10
|
+
LIQSOL_MINT_ADDRESS,
|
|
11
|
+
DepositIDL,
|
|
12
|
+
Deposit
|
|
13
|
+
} from './constants'
|
|
14
|
+
|
|
15
|
+
// -- Program factories ------------------------------------------------------
|
|
16
|
+
/**
|
|
17
|
+
* Create an Anchor Program client for the Deposit program
|
|
18
|
+
*/
|
|
19
|
+
export function getDepositProgram(provider: AnchorProvider): Program<Deposit> {
|
|
20
|
+
// Ensure the IDL has the correct program address
|
|
21
|
+
const idlWithAddress = {
|
|
22
|
+
...JSON.parse(JSON.stringify(DepositIDL)),
|
|
23
|
+
address: DEPOSIT_PROGRAM_ID.toString(),
|
|
24
|
+
}
|
|
25
|
+
return new Program(idlWithAddress as any, provider) as Program<Deposit>
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// (Other program factories can go here if needed)
|
|
29
|
+
|
|
30
|
+
// -- PDA derivation helpers ------------------------------------------------
|
|
31
|
+
export function deriveDepositAuthorityPDA(
|
|
32
|
+
programId: PublicKey = DEPOSIT_PROGRAM_ID
|
|
33
|
+
): [PublicKey, number] {
|
|
34
|
+
return PublicKey.findProgramAddressSync(
|
|
35
|
+
[Buffer.from('program_authority')],
|
|
36
|
+
programId
|
|
37
|
+
)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function deriveLiqsolMintAuthorityPDA(
|
|
41
|
+
programId: PublicKey = LIQSOL_MINT_ADDRESS
|
|
42
|
+
): [PublicKey, number] {
|
|
43
|
+
return PublicKey.findProgramAddressSync(
|
|
44
|
+
[Buffer.from('mint_authority')],
|
|
45
|
+
programId
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function deriveStakeControllerVaultPDA(): [PublicKey, number] {
|
|
50
|
+
return PublicKey.findProgramAddressSync(
|
|
51
|
+
[Buffer.from('vault')],
|
|
52
|
+
STAKE_CONTROLLER_PROGRAM_ID
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function deriveStakeControllerReservePoolPDA(): [PublicKey, number] {
|
|
57
|
+
return PublicKey.findProgramAddressSync(
|
|
58
|
+
[Buffer.from('reserve_pool')],
|
|
59
|
+
STAKE_CONTROLLER_PROGRAM_ID
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function deriveStakeControllerStatePDA(): [PublicKey, number] {
|
|
64
|
+
return PublicKey.findProgramAddressSync(
|
|
65
|
+
[Buffer.from('stake_controller')],
|
|
66
|
+
STAKE_CONTROLLER_PROGRAM_ID
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function deriveDistributionStatePDA(): [PublicKey, number] {
|
|
71
|
+
return PublicKey.findProgramAddressSync(
|
|
72
|
+
[Buffer.from('distribution_state')],
|
|
73
|
+
DISTRIBUTION_PROGRAM_ID
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function deriveUserRecordPDA(
|
|
78
|
+
user: PublicKey
|
|
79
|
+
): [PublicKey, number] {
|
|
80
|
+
return PublicKey.findProgramAddressSync(
|
|
81
|
+
[Buffer.from('user_record'), user.toBuffer()],
|
|
82
|
+
DISTRIBUTION_PROGRAM_ID
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function deriveLeaderboardHeadPDA(): [PublicKey, number] {
|
|
87
|
+
return PublicKey.findProgramAddressSync(
|
|
88
|
+
[Buffer.from('leaderboard_head')],
|
|
89
|
+
VALIDATOR_LEADERBOARD_PROGRAM_ID
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function deriveValidatorRecordPDA(
|
|
94
|
+
voteAccount: PublicKey
|
|
95
|
+
): [PublicKey, number] {
|
|
96
|
+
return PublicKey.findProgramAddressSync(
|
|
97
|
+
[Buffer.from('validator_record'), voteAccount.toBuffer()],
|
|
98
|
+
VALIDATOR_LEADERBOARD_PROGRAM_ID
|
|
99
|
+
)
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export function deriveTop10CachePDA(): [PublicKey, number] {
|
|
103
|
+
return PublicKey.findProgramAddressSync(
|
|
104
|
+
[Buffer.from('top_10_cache')],
|
|
105
|
+
VALIDATOR_LEADERBOARD_PROGRAM_ID
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// -- SPL Token helper -------------------------------------------------------
|
|
110
|
+
export function getUserLiqsolATA(
|
|
111
|
+
user: PublicKey
|
|
112
|
+
): PublicKey {
|
|
113
|
+
return getAssociatedTokenAddressSync(
|
|
114
|
+
LIQSOL_MINT_ADDRESS,
|
|
115
|
+
user,
|
|
116
|
+
false,
|
|
117
|
+
TOKEN_2022_PROGRAM_ID,
|
|
118
|
+
ASSOCIATED_TOKEN_PROGRAM_ID
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// seedToPID(seed: string): PublicKey
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// src/staker/staker.ts
|
|
2
|
+
|
|
3
|
+
import { ChainID, Curve, EvmChainID, SolChainID } from '@wireio/core';
|
|
4
|
+
import { IStakingClient, StakerConfig } from './types';
|
|
5
|
+
import { SolanaStakingClient } from '../networks/solana/solana';
|
|
6
|
+
import { EthereumStakingClient } from '../networks/ethereum/ethereum';
|
|
7
|
+
|
|
8
|
+
export class Staker {
|
|
9
|
+
private clients: Map<ChainID, IStakingClient> = new Map();
|
|
10
|
+
|
|
11
|
+
constructor(config: StakerConfig | StakerConfig[]) {
|
|
12
|
+
if (!Array.isArray(config)) config = [config];
|
|
13
|
+
|
|
14
|
+
config.forEach((cfg) => {
|
|
15
|
+
switch (cfg.network.chainId) {
|
|
16
|
+
case SolChainID.Testnet:
|
|
17
|
+
this.clients.set(SolChainID.Testnet, new SolanaStakingClient(cfg));
|
|
18
|
+
break;
|
|
19
|
+
|
|
20
|
+
// case EvmChainID.Sepolia:
|
|
21
|
+
// this.clients.set(EvmChainID.Sepolia, new EthereumStakingClient(cfg));
|
|
22
|
+
// break;
|
|
23
|
+
default:
|
|
24
|
+
throw new Error(`Unsupported network curve: ${cfg.network.name}`);
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
deposit(amount: number): Promise<string> {
|
|
31
|
+
if (!this.clients.has(SolChainID.Testnet)) {
|
|
32
|
+
throw new Error('Staker not initialized for Solana Testnet');
|
|
33
|
+
}
|
|
34
|
+
return this.clients.get(SolChainID.Testnet)!.deposit(amount);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// …withdraw, claimRewards, etc…
|
|
38
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// types.ts
|
|
2
|
+
|
|
3
|
+
import { BaseSignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
4
|
+
import { Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
5
|
+
import { Curve, ExternalNetwork, ProviderType, PublicKey } from '@wireio/core';
|
|
6
|
+
import { ethers } from 'ethers';
|
|
7
|
+
|
|
8
|
+
export type SolanaTransaction = Transaction | VersionedTransaction
|
|
9
|
+
export interface IStakingClient{
|
|
10
|
+
pubKey: PublicKey;
|
|
11
|
+
|
|
12
|
+
deposit(amount: number): Promise<string>;
|
|
13
|
+
// TODO add more shared functions to implement
|
|
14
|
+
|
|
15
|
+
// signTransaction<T, R>(tx: T): Promise<R>;
|
|
16
|
+
// sendTransaction<T, R>(signed: T): Promise<R>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Union config for our unified Staker
|
|
21
|
+
*/
|
|
22
|
+
export type StakerConfig = {
|
|
23
|
+
network: ExternalNetwork;
|
|
24
|
+
provider: BaseSignerWalletAdapter | ethers.providers.Web3Provider;
|
|
25
|
+
pubKey: PublicKey;
|
|
26
|
+
}
|