@raac/rpc 1.0.1-beta.3 → 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.
@@ -17,7 +17,7 @@
17
17
  "raachouseprices": {
18
18
  "id": "raachouseprices",
19
19
  "name": "RAAC House Prices",
20
- "contract": "0xA151fE9b3F225Ed575D0775c3Db096F14Ead5A0c"
20
+ "contract": "0x0f497bE68f0F96c40d4007d9848cCD933dAB3C38"
21
21
  },
22
22
  "raacprimerateoracle": {
23
23
  "id": "raacprimerateoracle",
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 tx = await raacNFTContract.mint(tokenId, ethers_1.ethers.parseEther(amount.toString()));
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;
@@ -9,16 +9,21 @@ const chains_1 = __importDefault(require("../configs/chains"));
9
9
  const RPCLibrary_1 = __importDefault(require("../RPCLibrary"));
10
10
  const contracts_1 = require("../utils/contracts");
11
11
  const artifacts_1 = require("../utils/artifacts");
12
- const chainId = 8453;
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 = ethers_1.ethers.Wallet.fromPhrase(mnemonic, provider);
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.contracts.indexToken.getNextRandomNFT(chainId, provider));
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();
@@ -132,7 +137,7 @@ const fulfillRequest = async () => {
132
137
  const redemptionToken = await rpc.contracts.indexToken.getNextRandomNFT(chainId, provider);
133
138
  console.log("Redemption token", redemptionToken);
134
139
  };
135
- // execute();
140
+ execute();
136
141
  // setup();
137
- fulfillRequest();
142
+ // fulfillRequest();
138
143
  // updateNFTPrice("7", "1650000");
@@ -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: bigint, signer: Signer): Promise<ethers.ContractTransactionResponse>;
3
+ declare function mint(chainId: ChainId, tokenId: string, amount: string, signer: Signer): Promise<ethers.ContractTransactionResponse>;
4
4
  export default mint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raac/rpc",
3
- "version": "1.0.1-beta.3",
3
+ "version": "1.0.1-beta.5",
4
4
  "description": "RPC Library for RAAC ",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",