Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: build issue #106

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
- name: Install 🔧
run: npm install

- name: Build 🔨
run: npm run build

- name: Test 🚨
run: npm test
env:
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/payPerDeal/fund/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default async (amount: number, network: string, token: string) => {
if(!config) {
throw new Error("Unsupported Network!!!")
}
//@ts-ignore
const provider = new ethers.BrowserProvider((window as any).ethereum)
const signer = await provider.getSigner()
if(token.toLowerCase()==="native") {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/payPerDeal/fund/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import browser from './browser'

export default async (amount: number, network: string, token: string, privateKey?: string) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await node(amount, network, token, privateKey)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/payPerDeal/getPrice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import web from './web'

export default async (pathOrSize: string|number|any, network: string, token?: string) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await node(pathOrSize, network, token)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/payPerDeal/oneTimeAuth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import web from './web'

export default async (privateKey?: string) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await node(privateKey )
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/payPerDeal/oneTimeAuth/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { lighthouseConfig } from '../../../lighthouse.config'

export default async (): Promise<string> => {
try {
//@ts-ignore
const provider = new ethers.BrowserProvider((window as any).ethereum)
const signer = await provider.getSigner()
const message = (await axios.get(
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/upload/buffer/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export default async (
apiKey: string
) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await uploadBuffer(buffer, apiKey)
} else {
Expand Down
2 changes: 2 additions & 0 deletions src/Lighthouse/upload/files/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ async function uploadFiles(
// Upload File to IPFS

if (multi) {
//@ts-ignore
if (typeof window === 'undefined') {
return await uploadFile(path, apiKey, true, dealParameters)
} else {
Expand All @@ -43,6 +44,7 @@ async function uploadFiles(
)
}
} else {
//@ts-ignore
if (typeof window === 'undefined') {
return await uploadFile(path, apiKey, false, dealParameters)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/upload/text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import uploadTextBrowser from './browser'

export default async (text: string, apiKey: string, name='text') => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await uploadTextServer(text, apiKey, name)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/uploadEncrypted/decrypt/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default async (
mimeType = 'null'
) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === "undefined") {
return await node(cid, fileEncryptionKey)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/uploadEncrypted/encrypt/file/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default async (
uploadProgressCallback?: (data: any) => void
) => {
// Upload File to IPFS
//@ts-ignore
if (typeof window === 'undefined') {
return await uploadFile(path, apiKey, publicKey, signedMessage)
} else {
Expand Down
1 change: 1 addition & 0 deletions src/Lighthouse/uploadEncrypted/encrypt/text/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export default async (
signedMessage: string,
name = 'text'
) => {
//@ts-ignore
if (typeof window === 'undefined') {
return await serverSide(text, apiKey, publicKey, signedMessage, name)
} else {
Expand Down