@raac/rpc 1.0.1-beta.4 → 1.0.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/nfts/mint.js +3 -1
- package/dist/scripts/index.js +9 -4
- package/dist/types/nfts/mint.d.ts +1 -1
- package/package.json +1 -1
package/dist/nfts/mint.js
CHANGED
|
@@ -11,7 +11,9 @@ async function mint(chainId, tokenId, amount, signer) {
|
|
|
11
11
|
const raacNFTAddress = (0, contracts_1.getContractAddress)(chainId, "raacnft");
|
|
12
12
|
const raacNFTABI = (0, artifacts_1.getABI)("raacnft");
|
|
13
13
|
const raacNFTContract = new ethers_1.ethers.Contract(raacNFTAddress, raacNFTABI, signer);
|
|
14
|
-
const
|
|
14
|
+
const amountInWei = ethers_1.ethers.parseEther(amount);
|
|
15
|
+
console.log(`Minting RAAC NFT with token ID ${tokenId} for ${amount} tokens`);
|
|
16
|
+
const tx = await raacNFTContract.mint(tokenId, amountInWei);
|
|
15
17
|
await tx.wait();
|
|
16
18
|
console.log(`Minted RAAC NFT with token ID ${tokenId} for ${amount} tokens`);
|
|
17
19
|
return tx;
|
package/dist/scripts/index.js
CHANGED
|
@@ -12,13 +12,18 @@ const artifacts_1 = require("../utils/artifacts");
|
|
|
12
12
|
const chainId = 11155111;
|
|
13
13
|
const config = chains_1.default[chainId];
|
|
14
14
|
const TEST_MNEMONIC = process.env.TEST_MNEMONIC;
|
|
15
|
+
const TEST_PRIVATE_KEY = process.env.TEST_PRIVATE_KEY;
|
|
15
16
|
async function getProvider() {
|
|
16
17
|
return new ethers_1.ethers.JsonRpcProvider(config.rpcs[0]);
|
|
17
18
|
}
|
|
18
19
|
async function createWallet(mnemonic, provider) {
|
|
19
|
-
const wallet =
|
|
20
|
-
console.info(`[${chainId}]: Loaded wallet from mnemonic: ${wallet.address}`);
|
|
21
|
-
// the signer is the wallet
|
|
20
|
+
// const wallet = ethers.Wallet.fromPhrase(mnemonic, provider);
|
|
21
|
+
// console.info(`[${chainId}]: Loaded wallet from mnemonic: ${wallet.address}`);
|
|
22
|
+
// // the signer is the wallet
|
|
23
|
+
// return wallet;
|
|
24
|
+
// load from private key
|
|
25
|
+
const wallet = new ethers_1.ethers.Wallet(TEST_PRIVATE_KEY, provider);
|
|
26
|
+
console.info(`[${chainId}]: Loaded wallet from private key: ${wallet.address}`);
|
|
22
27
|
return wallet;
|
|
23
28
|
}
|
|
24
29
|
async function setup() {
|
|
@@ -94,7 +99,7 @@ const execute = async () => {
|
|
|
94
99
|
rpc.address = signer.address;
|
|
95
100
|
rpc.provider = provider;
|
|
96
101
|
rpc.chainId = chainId;
|
|
97
|
-
console.log(await rpc.nfts.
|
|
102
|
+
console.log(await rpc.nfts.setBaseUri(chainId, "https://gateway-staging.instruxi.dev/api/v1/vnft/metadata/public/1/0x0000000000000000000000000000", signer));
|
|
98
103
|
};
|
|
99
104
|
const updateNFTPrice = async (id, price) => {
|
|
100
105
|
const provider = await getProvider();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ethers, Signer } from "ethers";
|
|
2
2
|
import { ChainId } from "../configs/chains/index";
|
|
3
|
-
declare function mint(chainId: ChainId, tokenId: string, amount:
|
|
3
|
+
declare function mint(chainId: ChainId, tokenId: string, amount: string, signer: Signer): Promise<ethers.ContractTransactionResponse>;
|
|
4
4
|
export default mint;
|