@carrot-protocol/http-client 0.2.19-dummy-provider-dev-2484a98 → 0.2.19-dummy-provider-dev-93032c8

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.
Files changed (2) hide show
  1. package/dist/index.js +5 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -31,6 +31,7 @@ exports.isValidVaultHistoricalApyInterval = isValidVaultHistoricalApyInterval;
31
31
  exports.prepareUnsignedTx = prepareUnsignedTx;
32
32
  const cross_fetch_1 = __importDefault(require("cross-fetch"));
33
33
  const anchor = __importStar(require("@coral-xyz/anchor"));
34
+ const anchor_1 = require("@coral-xyz/anchor");
34
35
  const bs58_1 = require("bs58");
35
36
  class Client {
36
37
  constructor(baseUrl, provider) {
@@ -40,8 +41,11 @@ class Client {
40
41
  this.provider = provider;
41
42
  }
42
43
  else {
44
+ const kp = anchor.web3.Keypair.generate();
45
+ const wallet = new anchor_1.Wallet(kp);
46
+ const connection = new anchor.web3.Connection("http://localhost:8899", "processed");
43
47
  // if no provider is passed in, create a dummy provider, aka read only mode
44
- this.provider = new anchor.AnchorProvider(new anchor.web3.Connection("http://localhost:8899", "processed"), new anchor.Wallet(anchor.web3.Keypair.generate()), {});
48
+ this.provider = new anchor.AnchorProvider(connection, wallet, {});
45
49
  }
46
50
  }
47
51
  async index() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carrot-protocol/http-client",
3
- "version": "0.2.19-dummy-provider-dev-2484a98",
3
+ "version": "0.2.19-dummy-provider-dev-93032c8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",