Skip to content

Commit

Permalink
fix: remove react deps from sdk (#11)
Browse files Browse the repository at this point in the history
* feat: remove AnchorWallet type

* feat: remove AnchorWallet
  • Loading branch information
aspnxdd authored Aug 17, 2022
1 parent 9fb2c0d commit 2989e81
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/lib/upload/arweave.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { calculate } from '@metaplex/arweave-cost'
import * as anchor from '@project-serum/anchor'
import { AnchorWallet } from '@solana/wallet-adapter-react'
import { ARWEAVE_PAYMENT_WALLET, ARWEAVE_UPLOAD_ENDPOINT,JSON_EXTENSION } from '../constants'
import { Manifest } from '../types'
import { getFileExtension } from './helpers'
Expand Down Expand Up @@ -61,7 +60,7 @@ function estimateManifestSize(filenames: string[]) {
}

export async function arweaveUpload(
walletKeyPair: AnchorWallet,
walletKeyPair: any,
anchorProgram: anchor.Program,
env: string,
image: File,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/upload/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as anchor from '@project-serum/anchor'
import { AnchorWallet } from '@solana/wallet-adapter-react'
import { Keypair, PublicKey, SystemProgram } from '@solana/web3.js'
import {
CANDY_MACHINE_PROGRAM_V2_ID,
Expand All @@ -25,7 +24,7 @@ export function uuidFromConfigPubkey(configAccount: PublicKey) {

export const createCandyMachineV2 = async function (
anchorProgram: anchor.Program,
payerWallet: AnchorWallet,
payerWallet: any,
treasuryWallet: PublicKey,
// splToken: PublicKey,
candyData: ICandyMachineData
Expand Down
3 changes: 1 addition & 2 deletions src/lib/upload/transactions.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { AnchorWallet } from '@solana/wallet-adapter-react'
import {
Blockhash,
Commitment,
Expand All @@ -21,7 +20,7 @@ interface IBlockhashAndFeeCalculator {

export const sendTransactionWithRetryWithKeypair = async (
connection: Connection,
wallet: AnchorWallet,
wallet: any,
instructions: TransactionInstruction[],
commitment: Commitment = 'singleGossip',
block?: IBlockhashAndFeeCalculator,
Expand Down
5 changes: 2 additions & 3 deletions src/lib/upload/upload.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BN, Program, web3 } from '@project-serum/anchor'
import { AnchorWallet } from '@solana/wallet-adapter-react'
import { PublicKey } from '@solana/web3.js'
import { PromisePool } from '@supercharge/promise-pool'
import { ICache, saveCache } from 'lib/cache'
Expand Down Expand Up @@ -88,7 +87,7 @@ export async function uploadV2({
hash: Uint8Array
}
// uuid: string;
walletKeyPair: AnchorWallet
walletKeyPair: any
anchorProgram: Program
// arweaveJwk: string;
rateLimit: number | null
Expand Down Expand Up @@ -351,7 +350,7 @@ async function writeIndices({
cacheName: string
env: string
candyMachine: PublicKey
walletKeyPair: AnchorWallet
walletKeyPair: any
rateLimit: number | null
}) {
let uploadSuccessful = true
Expand Down

0 comments on commit 2989e81

Please sign in to comment.