1
1
import * as crypto from "crypto" ;
2
2
3
- import { AnchorProvider , BN , Program , Wallet } from "@coral-xyz/anchor" ;
3
+ import { AnchorProvider , BN , Program } from "@coral-xyz/anchor" ;
4
4
import {
5
5
getTokenOwnerRecordAddress ,
6
6
PROGRAM_VERSION_V2 ,
@@ -15,7 +15,6 @@ import {
15
15
import type { AnchorWallet } from "@solana/wallet-adapter-react" ;
16
16
import {
17
17
Connection ,
18
- Keypair ,
19
18
PublicKey ,
20
19
SystemProgram ,
21
20
Transaction ,
@@ -46,6 +45,7 @@ import {
46
45
} from "./utils/position" ;
47
46
import { sendTransaction } from "./utils/transaction" ;
48
47
import { getUnlockSchedule } from "./utils/vesting" ;
48
+ import { DummyWallet } from "./utils/wallet" ;
49
49
import * as IntegrityPoolIdl from "../idl/integrity-pool.json" ;
50
50
import * as PublisherCapsIdl from "../idl/publisher-caps.json" ;
51
51
import * as StakingIdl from "../idl/staking.json" ;
@@ -67,8 +67,10 @@ export class PythStakingClient {
67
67
publisherCapsProgram : Program < PublisherCaps > ;
68
68
69
69
constructor ( config : PythStakingClientConfig ) {
70
- this . connection = config . connection ;
71
- this . wallet = config . wallet ?? new Wallet ( Keypair . generate ( ) ) ;
70
+ const { connection, wallet = DummyWallet } = config ;
71
+
72
+ this . connection = connection ;
73
+ this . wallet = wallet ;
72
74
73
75
this . provider = new AnchorProvider ( this . connection , this . wallet , {
74
76
skipPreflight : true ,
0 commit comments