From 8f2ab5b4eaaaf5bbc3b1390220212c06d8dac5c6 Mon Sep 17 00:00:00 2001 From: Conner Gallagher Date: Wed, 3 Aug 2022 15:36:38 -0600 Subject: [PATCH] updated spl-token to an npm alias --- cli/package.json | 2 +- cli/src/commands/aggregator/create/copy.ts | 2 +- cli/src/commands/aggregator/create/index.ts | 2 +- cli/src/commands/oracle/create.ts | 2 +- cli/src/commands/oracle/deposit.ts | 2 +- cli/src/commands/queue/create.ts | 2 +- cli/src/commands/test.ts | 2 +- cli/src/commands/vrf/create/example.ts | 2 +- cli/src/commands/vrf/create/index.ts | 2 +- cli/src/commands/vrf/request.ts | 2 +- .../clients/feed-walkthrough/package.json | 2 +- examples/clients/feed-walkthrough/src/main.ts | 2 +- .../programs/anchor-buffer-parser/Cargo.toml | 2 +- .../programs/anchor-feed-parser/Cargo.toml | 2 +- .../programs/anchor-vrf-parser/Cargo.toml | 2 +- .../programs/anchor-vrf-parser/package.json | 2 +- .../tests/anchor-vrf-parser.test.ts | 2 +- libraries/sbv2-utils/package.json | 2 +- libraries/sbv2-utils/src/feed.ts | 2 +- libraries/sbv2-utils/src/queue.ts | 2 +- libraries/sbv2-utils/src/test/context.ts | 2 +- libraries/sbv2-utils/src/token.ts | 2 +- libraries/ts/package.json | 3 +- libraries/ts/src/sbv2.ts | 78 ++++++++++--------- yarn.lock | 10 +++ 25 files changed, 73 insertions(+), 62 deletions(-) diff --git a/cli/package.json b/cli/package.json index 325975a..b6a2963 100644 --- a/cli/package.json +++ b/cli/package.json @@ -31,7 +31,7 @@ "@oclif/plugin-version": "^1.0.4", "@oclif/plugin-warn-if-update-available": "^2.0.4", "@project-serum/anchor": "^0.24.2", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token-v2": "npm:@solana/spl-token@^0.2.0", "@solana/web3.js": "^1.43.5", "@switchboard-xyz/sbv2-utils": "^0.1.39", "@switchboard-xyz/switchboard-v2": "^0.0.126", diff --git a/cli/src/commands/aggregator/create/copy.ts b/cli/src/commands/aggregator/create/copy.ts index 7b6f97b..4d2351e 100644 --- a/cli/src/commands/aggregator/create/copy.ts +++ b/cli/src/commands/aggregator/create/copy.ts @@ -1,7 +1,7 @@ /* eslint-disable unicorn/no-array-push-push */ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { AccountInfo, Keypair, diff --git a/cli/src/commands/aggregator/create/index.ts b/cli/src/commands/aggregator/create/index.ts index 636effb..efbf14c 100644 --- a/cli/src/commands/aggregator/create/index.ts +++ b/cli/src/commands/aggregator/create/index.ts @@ -1,6 +1,6 @@ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { AccountInfo, Keypair, diff --git a/cli/src/commands/oracle/create.ts b/cli/src/commands/oracle/create.ts index 7da8abb..dddb336 100644 --- a/cli/src/commands/oracle/create.ts +++ b/cli/src/commands/oracle/create.ts @@ -1,6 +1,6 @@ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Keypair, PublicKey, diff --git a/cli/src/commands/oracle/deposit.ts b/cli/src/commands/oracle/deposit.ts index cab52f0..dbdc9d6 100644 --- a/cli/src/commands/oracle/deposit.ts +++ b/cli/src/commands/oracle/deposit.ts @@ -1,6 +1,6 @@ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { PublicKey } from "@solana/web3.js"; import { chalkString, diff --git a/cli/src/commands/queue/create.ts b/cli/src/commands/queue/create.ts index 7fb6a10..f7d123d 100644 --- a/cli/src/commands/queue/create.ts +++ b/cli/src/commands/queue/create.ts @@ -2,7 +2,7 @@ /* eslint-disable unicorn/new-for-builtins */ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { AccountInfo, Keypair, diff --git a/cli/src/commands/test.ts b/cli/src/commands/test.ts index ed49c56..0f0ae8e 100644 --- a/cli/src/commands/test.ts +++ b/cli/src/commands/test.ts @@ -1,5 +1,5 @@ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { LAMPORTS_PER_SOL, NONCE_ACCOUNT_LENGTH, diff --git a/cli/src/commands/vrf/create/example.ts b/cli/src/commands/vrf/create/example.ts index 5a219d9..5872143 100644 --- a/cli/src/commands/vrf/create/example.ts +++ b/cli/src/commands/vrf/create/example.ts @@ -1,6 +1,6 @@ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Keypair, PublicKey, diff --git a/cli/src/commands/vrf/create/index.ts b/cli/src/commands/vrf/create/index.ts index c07c2de..fbb3a30 100644 --- a/cli/src/commands/vrf/create/index.ts +++ b/cli/src/commands/vrf/create/index.ts @@ -1,6 +1,6 @@ import { Flags } from "@oclif/core"; import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Keypair, PublicKey, diff --git a/cli/src/commands/vrf/request.ts b/cli/src/commands/vrf/request.ts index 9f80a84..cc1b71f 100644 --- a/cli/src/commands/vrf/request.ts +++ b/cli/src/commands/vrf/request.ts @@ -1,5 +1,5 @@ import { Flags } from "@oclif/core"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { PublicKey, SYSVAR_RECENT_BLOCKHASHES_PUBKEY } from "@solana/web3.js"; import { getOrCreateSwitchboardTokenAccount } from "@switchboard-xyz/sbv2-utils"; import { diff --git a/examples/clients/feed-walkthrough/package.json b/examples/clients/feed-walkthrough/package.json index 5097b1c..6255db7 100644 --- a/examples/clients/feed-walkthrough/package.json +++ b/examples/clients/feed-walkthrough/package.json @@ -18,7 +18,7 @@ }, "dependencies": { "@project-serum/anchor": "^0.24.2", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token-v2": "npm:@solana/spl-token@^0.2.0", "@solana/web3.js": "^1.37.1", "@switchboard-xyz/switchboard-v2": "^0.0.126", "chalk": "^4.1.2", diff --git a/examples/clients/feed-walkthrough/src/main.ts b/examples/clients/feed-walkthrough/src/main.ts index ab8d80b..0800e02 100644 --- a/examples/clients/feed-walkthrough/src/main.ts +++ b/examples/clients/feed-walkthrough/src/main.ts @@ -1,5 +1,5 @@ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { clusterApiUrl, Connection, Keypair } from "@solana/web3.js"; import { AggregatorAccount, diff --git a/examples/programs/anchor-buffer-parser/Cargo.toml b/examples/programs/anchor-buffer-parser/Cargo.toml index cb61c14..0c11d58 100644 --- a/examples/programs/anchor-buffer-parser/Cargo.toml +++ b/examples/programs/anchor-buffer-parser/Cargo.toml @@ -17,6 +17,6 @@ default = [] [dependencies] # switchboard-v2 = { path = "../../../libraries/rs", features = ["devnet"] } -switchboard-v2 = { version = "^0.1.13", features = ["devnet"] } +switchboard-v2 = { version = "^0.1.14", features = ["devnet"] } anchor-lang = "^0.25.0" solana-program = "~1.10.29" \ No newline at end of file diff --git a/examples/programs/anchor-feed-parser/Cargo.toml b/examples/programs/anchor-feed-parser/Cargo.toml index ad5ef68..2806fb2 100644 --- a/examples/programs/anchor-feed-parser/Cargo.toml +++ b/examples/programs/anchor-feed-parser/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies] # switchboard-v2 = { path = "../../../libraries/rs", features = ["devnet"] } -switchboard-v2 = { version = "^0.1.13", features = ["devnet"] } +switchboard-v2 = { version = "^0.1.14", features = ["devnet"] } anchor-lang = "^0.25.0" solana-program = "~1.10.29" bytemuck = "1.7.2" \ No newline at end of file diff --git a/examples/programs/anchor-vrf-parser/Cargo.toml b/examples/programs/anchor-vrf-parser/Cargo.toml index 3b87cc2..240d4e5 100644 --- a/examples/programs/anchor-vrf-parser/Cargo.toml +++ b/examples/programs/anchor-vrf-parser/Cargo.toml @@ -17,7 +17,7 @@ default = [] [dependencies] # switchboard-v2 = { path = "../../../libraries/rs", features = ["devnet"] } -switchboard-v2 = { version = "^0.1.13", features = ["devnet"] } +switchboard-v2 = { version = "^0.1.14", features = ["devnet"] } anchor-lang = "^0.25.0" anchor-spl = "^0.25.0" solana-program = "~1.10.29" diff --git a/examples/programs/anchor-vrf-parser/package.json b/examples/programs/anchor-vrf-parser/package.json index ff4767b..1755247 100644 --- a/examples/programs/anchor-vrf-parser/package.json +++ b/examples/programs/anchor-vrf-parser/package.json @@ -17,7 +17,7 @@ "dependencies": { "@project-serum/anchor": "^0.24.2", "@project-serum/borsh": "^0.2.5", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token-v2": "npm:@solana/spl-token@^0.2.0", "@solana/web3.js": "^1.42.0", "@switchboard-xyz/sbv2-utils": "^0.1.39", "@switchboard-xyz/switchboard-v2": "^0.0.126", diff --git a/examples/programs/anchor-vrf-parser/tests/anchor-vrf-parser.test.ts b/examples/programs/anchor-vrf-parser/tests/anchor-vrf-parser.test.ts index 3d772fb..07bf449 100644 --- a/examples/programs/anchor-vrf-parser/tests/anchor-vrf-parser.test.ts +++ b/examples/programs/anchor-vrf-parser/tests/anchor-vrf-parser.test.ts @@ -1,6 +1,6 @@ import * as anchor from "@project-serum/anchor"; import { AnchorProvider } from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { SystemProgram, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, diff --git a/libraries/sbv2-utils/package.json b/libraries/sbv2-utils/package.json index eedeb40..435a677 100644 --- a/libraries/sbv2-utils/package.json +++ b/libraries/sbv2-utils/package.json @@ -36,7 +36,7 @@ "@orca-so/sdk": "^1.2.24", "@project-serum/anchor": "^0.24.2", "@saberhq/token-utils": "^1.13.32", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token-v2": "npm:@solana/spl-token@^0.2.0", "@solana/web3.js": "^1.43.5", "@switchboard-xyz/switchboard-v2": "^0.0.126", "big.js": "^6.1.1", diff --git a/libraries/sbv2-utils/src/feed.ts b/libraries/sbv2-utils/src/feed.ts index 07ac264..6767aac 100644 --- a/libraries/sbv2-utils/src/feed.ts +++ b/libraries/sbv2-utils/src/feed.ts @@ -1,5 +1,5 @@ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { PublicKey, sendAndConfirmTransaction, diff --git a/libraries/sbv2-utils/src/queue.ts b/libraries/sbv2-utils/src/queue.ts index a9f92aa..b7d3668 100644 --- a/libraries/sbv2-utils/src/queue.ts +++ b/libraries/sbv2-utils/src/queue.ts @@ -1,5 +1,5 @@ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Keypair, PublicKey, diff --git a/libraries/sbv2-utils/src/test/context.ts b/libraries/sbv2-utils/src/test/context.ts index f170871..15dc563 100644 --- a/libraries/sbv2-utils/src/test/context.ts +++ b/libraries/sbv2-utils/src/test/context.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-shadow */ /* eslint-disable @typescript-eslint/no-var-requires */ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Keypair, PublicKey } from "@solana/web3.js"; import * as sbv2 from "@switchboard-xyz/switchboard-v2"; import Big from "big.js"; diff --git a/libraries/sbv2-utils/src/token.ts b/libraries/sbv2-utils/src/token.ts index dfba1e8..e5e2a2d 100644 --- a/libraries/sbv2-utils/src/token.ts +++ b/libraries/sbv2-utils/src/token.ts @@ -1,5 +1,5 @@ import type * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { Connection, Keypair, diff --git a/libraries/ts/package.json b/libraries/ts/package.json index 9878f66..0752c2e 100644 --- a/libraries/ts/package.json +++ b/libraries/ts/package.json @@ -45,13 +45,12 @@ }, "peerDependencies": { "@solana/spl-governance": "^0.0.34", - "@solana/spl-token": "^0.2.0", "@solana/web3.js": "^1.44.3" }, "dependencies": { "@project-serum/anchor": "^0.24.2", "@solana/spl-governance": "^0.0.34", - "@solana/spl-token": "^0.2.0", + "@solana/spl-token-v2": "npm:@solana/spl-token@^0.2.0", "@solana/web3.js": "^1.44.3", "@types/big.js": "^6.1.4", "assert": "^2.0.0", diff --git a/libraries/ts/src/sbv2.ts b/libraries/ts/src/sbv2.ts index 3701c05..10aeac6 100644 --- a/libraries/ts/src/sbv2.ts +++ b/libraries/ts/src/sbv2.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-non-null-assertion */ /* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */ import * as anchor from "@project-serum/anchor"; -import * as spl from "@solana/spl-token"; +import * as spl from "@solana/spl-token-v2"; import { AccountInfo, AccountMeta, @@ -25,6 +25,8 @@ import * as crypto from "crypto"; /*eslint-disable import/extensions */ import protos from "./protos/index.js"; +export type SwitchboardProgram = anchor.Program; + /** * Switchboard Devnet Program ID * 2TfB33aLaneQb5TNVwyDz3jSZXS6jdW2ARw1Dgf84XCG @@ -78,7 +80,7 @@ export async function loadSwitchboardProgram( confirmOptions: ConfirmOptions = { commitment: "confirmed", } -): Promise { +): Promise { const DEFAULT_KEYPAIR = Keypair.fromSeed(new Uint8Array(32).fill(1)); const programId = getSwitchboardPid(cluster); const wallet: AnchorWallet = payerKeypair @@ -100,7 +102,7 @@ export async function loadSwitchboardProgram( // should also check if pubkey is a token account export const findAccountName = ( - program: anchor.Program, + program: SwitchboardProgram, accountInfo: AccountInfo ): string => { const accountDiscriminator = accountInfo.data.slice( @@ -124,7 +126,7 @@ export const findAccountName = ( export type OnAccountChangeCallback = (accountData: any) => void; export function watchSwitchboardAccount( - program: anchor.Program, + program: SwitchboardProgram, publicKey: PublicKey, accountName: string, callback: OnAccountChangeCallback @@ -255,7 +257,7 @@ export interface AccountParams { /** * program referencing the Switchboard program and IDL. */ - program: anchor.Program; + program: SwitchboardProgram; /** * Public key of the account being referenced. This will always be populated * within the account wrapper. @@ -292,7 +294,7 @@ export interface VaultTransferParams { export class ProgramStateAccount { static accountName = "SbState"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -324,7 +326,7 @@ export class ProgramStateAccount { * Constructs ProgramStateAccount from the static seed from which it was generated. * @return ProgramStateAccount and PDA bump tuple. */ - static fromSeed(program: anchor.Program): [ProgramStateAccount, number] { + static fromSeed(program: SwitchboardProgram): [ProgramStateAccount, number] { const [statePubkey, stateBump] = anchor.utils.publicKey.findProgramAddressSync( [Buffer.from("STATE")], @@ -368,7 +370,7 @@ export class ProgramStateAccount { } static async getOrCreate( - program: anchor.Program, + program: SwitchboardProgram, params: ProgramInitParams ): Promise<[ProgramStateAccount, number]> { const [account, seed] = ProgramStateAccount.fromSeed(program); @@ -389,7 +391,7 @@ export class ProgramStateAccount { * @return newly generated ProgramStateAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: ProgramInitParams ): Promise { const payerKeypair = programWallet(program); @@ -638,7 +640,7 @@ export class SwitchboardError { /** * The program containing the Switchboard IDL specifying error codes. */ - program: anchor.Program; + program: SwitchboardProgram; /** * Stringified name of the error type. @@ -662,7 +664,7 @@ export class SwitchboardError { * @param code Error code to convert to a SwitchboardError object. * @return SwitchboardError */ - static fromCode(program: anchor.Program, code: number): SwitchboardError { + static fromCode(program: SwitchboardProgram, code: number): SwitchboardError { for (const e of program.idl.errors ?? []) { if (code === e.code) { const r = new SwitchboardError(); @@ -735,7 +737,7 @@ export interface AggregatorSetUpdateIntervalParams { export class AggregatorAccount { static accountName = "AggregatorAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -764,7 +766,7 @@ export class AggregatorAccount { } static decode( - program: anchor.Program, + program: SwitchboardProgram, accountInfo: AccountInfo ): any { const coder = new anchor.BorshAccountsCoder(program.idl); @@ -1094,7 +1096,7 @@ export class AggregatorAccount { * @return newly generated AggregatorAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: AggregatorInitParams ): Promise { const payerKeypair = programWallet(program); @@ -1594,7 +1596,7 @@ export interface JobInitParams { export class JobAccount { static accountName = "JobAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -1648,7 +1650,7 @@ export class JobAccount { * @return newly generated JobAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: JobInitParams ): Promise { const payerKeypair = programWallet(program); @@ -1694,7 +1696,7 @@ export class JobAccount { } static decode( - program: anchor.Program, + program: SwitchboardProgram, accountInfo: AccountInfo ): any { const coder = new anchor.BorshAccountsCoder(program.idl); @@ -1703,7 +1705,7 @@ export class JobAccount { } static decodeJob( - program: anchor.Program, + program: SwitchboardProgram, accountInfo: AccountInfo ): protos.OracleJob { return protos.OracleJob.decodeDelimited( @@ -1752,7 +1754,7 @@ export interface PermissionSetParams { export interface PermissionSetVoterWeightParams { govProgram: PublicKey; pubkeySigner?: PublicKey; - addinProgram: anchor.Program; + addinProgram: SwitchboardProgram; realm: PublicKey; } @@ -1776,7 +1778,7 @@ export enum SwitchboardPermissionValue { export class PermissionAccount { static accountName = "PermissionAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -1841,7 +1843,7 @@ export class PermissionAccount { * @return newly generated PermissionAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: PermissionInitParams ): Promise { const authorityInfo = await program.provider.connection.getAccountInfo( @@ -1882,7 +1884,7 @@ export class PermissionAccount { * @return PermissionAccount and PDA bump. */ static fromSeed( - program: anchor.Program, + program: SwitchboardProgram, authority: PublicKey, granter: PublicKey, grantee: PublicKey @@ -2129,7 +2131,7 @@ export interface OracleQueueSetVrfSettingsParams { export class OracleQueueAccount { static accountName = "OracleQueueAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -2212,7 +2214,7 @@ export class OracleQueueAccount { * @return newly generated OracleQueueAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: OracleQueueInitParams ): Promise { const payerKeypair = programWallet(program); @@ -2376,7 +2378,7 @@ export interface LeaseWithdrawParams { * for fulfilling feed updates. */ export class LeaseAccount { - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -2411,7 +2413,7 @@ export class LeaseAccount { * @return LeaseAccount and PDA bump. */ static fromSeed( - program: anchor.Program, + program: SwitchboardProgram, queueAccount: OracleQueueAccount, aggregatorAccount: AggregatorAccount ): [LeaseAccount, number] { @@ -2454,7 +2456,7 @@ export class LeaseAccount { * @return newly generated LeaseAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: LeaseInitParams ): Promise { const payerKeypair = programWallet(program); @@ -2780,7 +2782,7 @@ export class CrankRow { export class CrankAccount { static accountName = "CrankAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -2850,7 +2852,7 @@ export class CrankAccount { * @return newly generated CrankAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: CrankInitParams ): Promise { const payerKeypair = programWallet(program); @@ -3160,7 +3162,7 @@ export interface OracleWithdrawParams { export class OracleAccount { static accountName = "OracleAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -3216,7 +3218,7 @@ export class OracleAccount { * @return newly generated OracleAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: OracleInitParams ): Promise { const payerKeypair = programWallet(program); @@ -3274,7 +3276,7 @@ export class OracleAccount { } static decode( - program: anchor.Program, + program: SwitchboardProgram, accountInfo: AccountInfo ): any { const coder = new anchor.BorshAccountsCoder(program.idl); @@ -3288,7 +3290,7 @@ export class OracleAccount { * @return OracleAccount and PDA bump tuple. */ static fromSeed( - program: anchor.Program, + program: SwitchboardProgram, queueAccount: OracleQueueAccount, wallet: PublicKey ): [OracleAccount, number] { @@ -3521,7 +3523,7 @@ export interface VrfProveParams { export class VrfAccount { static accountName = "VrfAccountData"; - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -3589,7 +3591,7 @@ export class VrfAccount { * @return newly generated VrfAccount. */ static async create( - program: anchor.Program, + program: SwitchboardProgram, params: VrfInitParams ): Promise { const payerKeypair = programWallet(program); @@ -3869,7 +3871,7 @@ export class VrfAccount { } export class BufferRelayerAccount { - program: anchor.Program; + program: SwitchboardProgram; publicKey: PublicKey; @@ -3915,7 +3917,7 @@ export class BufferRelayerAccount { } static async create( - program: anchor.Program, + program: SwitchboardProgram, params: { name: Buffer; minUpdateDelaySeconds: number; @@ -4297,7 +4299,7 @@ export function signTransactions( return transactions; } -export function programWallet(program: anchor.Program): Keypair { +export function programWallet(program: SwitchboardProgram): Keypair { return ((program.provider as anchor.AnchorProvider).wallet as AnchorWallet) .payer; } diff --git a/yarn.lock b/yarn.lock index 396d6ad..53f542b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3834,6 +3834,16 @@ "@solana/web3.js" "^1.42.0" bn.js "^5.1.3" +"@solana/spl-token-v2@npm:@solana/spl-token@^0.2.0": + version "0.2.0" + resolved "https://registry.npmjs.org/@solana/spl-token/-/spl-token-0.2.0.tgz#329bb6babb5de0f9c40035ddb1657f01a8347acd" + integrity sha512-RWcn31OXtdqIxmkzQfB2R+WpsJOVS6rKuvpxJFjvik2LyODd+WN58ZP3Rpjpro03fscGAkzlFuP3r42doRJgyQ== + dependencies: + "@solana/buffer-layout" "^4.0.0" + "@solana/buffer-layout-utils" "^0.2.0" + "@solana/web3.js" "^1.32.0" + start-server-and-test "^1.14.0" + "@solana/spl-token@^0.0.13": version "0.0.13" resolved "https://registry.yarnpkg.com/@solana/spl-token/-/spl-token-0.0.13.tgz#5e0b235b1f8b34643280401dbfddeb34d13d1acd"