-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import ModuleBase from '..'; | ||
import * as Types from '../../types'; | ||
|
||
import { Client } from '@urql/core'; | ||
import { cacheExchange, fetchExchange } from '@urql/core'; | ||
|
||
class GraphQL extends ModuleBase { | ||
public gql: Client; | ||
constructor(opts: Types.ModuleOpts) { | ||
super(opts); | ||
this.gql = new Client({ | ||
url: 'https://arweave.net/graphql', | ||
exchanges: [cacheExchange, fetchExchange], | ||
maskTypename: true, | ||
}); | ||
} | ||
} | ||
|
||
export default GraphQL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import Arweave from 'arweave'; | ||
import { Warp } from 'warp-contracts'; | ||
import { JWKInterface } from 'arbundles'; | ||
import Irys, { WebIrys } from '@irys/sdk'; | ||
|
||
import * as Types from '../types'; | ||
|
||
class ModuleBase { | ||
protected warp: Warp; | ||
protected arweave: Arweave; | ||
protected irys: WebIrys | Irys | null; | ||
protected key: JWKInterface | 'use_wallet' | null; | ||
|
||
constructor(opts: Types.ModuleOpts) { | ||
this.warp = opts.warp; | ||
this.arweave = opts.arweave; | ||
this.irys = opts.irys; | ||
this.key = opts.key; | ||
} | ||
} | ||
|
||
export default ModuleBase; |