-
Notifications
You must be signed in to change notification settings - Fork 3
/
osf-read.ts
60 lines (51 loc) · 1.39 KB
/
osf-read.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { ThirdwebSDK } from "@thirdweb-dev/sdk";
import { ThirdwebStorage } from "@thirdweb-dev/storage";
import dotenv from "dotenv";
dotenv.config();
const run = async () => {
// Instantiate thirdweb SDK for read/write
// PRIVATE_KEY should be put into environment variable
const PRIVATE_KEY = process.env.KEY as string;
let sdkOptions = {
gasless: {
biconomy: {
apiKey: "different key",
apiId: "different api ID",
},
},
};
let sdk = ThirdwebSDK.fromPrivateKey(
PRIVATE_KEY, // Your wallet private key
"mumbai", // configure this to your network
sdkOptions
);
sdkOptions = {
gasless: {
biconomy: {
apiKey: "<api-Key-from-Biconomy>",
apiId: "<api-Id-from-Biconomy>",
},
},
};
sdk = ThirdwebSDK.fromPrivateKey(
PRIVATE_KEY, // Your wallet private key
"goerli", // configure this to your network
sdkOptions
);
console.log(sdk);
const contract = await sdk.getContract(
"0x22CC74e471517C599e819ff2808729d5796Aa0ae"
);
const tx = await contract.erc721.claim(1);
//const cp = await contract.erc721.claimConditions.getActive();
//console.log(cp);
//console.log(contract.erc721);
// const res = await storage.downloadJSON(cc.metadata as string);
// console.log(res.name);
};
run()
.then(() => process.exit(0))
.catch((err) => {
console.error(err);
process.exit(1);
});