emblem-vault-sdk 1.9.5 → 1.9.6

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/bundle.js CHANGED
@@ -709477,7 +709477,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
709477
709477
  const utils_1 = require("./utils");
709478
709478
  const sats_connect_1 = require("sats-connect");
709479
709479
  const derive_1 = require("./derive");
709480
- const SDK_VERSION = '1.9.5';
709480
+ const SDK_VERSION = '1.9.6';
709481
709481
  class EmblemVaultSDK {
709482
709482
  constructor(apiKey, baseUrl) {
709483
709483
  this.apiKey = apiKey;
@@ -709739,8 +709739,9 @@ class EmblemVaultSDK {
709739
709739
  let collection = yield this.fetchCuratedContractByName(collectionName);
709740
709740
  let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
709741
709741
  let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
709742
- let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
709743
- let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
709742
+ let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price / 1000000, callback);
709743
+ let ethToSend = quote.mul(bignumber_1.BigNumber.from(10).pow(6));
709744
+ let mintResponse = yield this.performMint(web3, ethToSend, remoteMintSig, callback);
709744
709745
  return { mintResponse };
709745
709746
  });
709746
709747
  }
@@ -709854,7 +709855,8 @@ class EmblemVaultSDK {
709854
709855
  }
709855
709856
  const accounts = yield web3.eth.getAccounts();
709856
709857
  let handlerContract = yield (0, utils_1.getHandlerContract)(web3);
709857
- let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: quote.toString() });
709858
+ const feeData = yield web3.eth.getGasPrice();
709859
+ let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: Number(quote), gasPrice: feeData });
709858
709860
  if (callback) {
709859
709861
  callback('Mint Complete');
709860
709862
  }
package/dist/index.js CHANGED
@@ -36,7 +36,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
36
36
  const utils_1 = require("./utils");
37
37
  const sats_connect_1 = require("sats-connect");
38
38
  const derive_1 = require("./derive");
39
- const SDK_VERSION = '1.9.5';
39
+ const SDK_VERSION = '1.9.6';
40
40
  class EmblemVaultSDK {
41
41
  constructor(apiKey, baseUrl) {
42
42
  this.apiKey = apiKey;
@@ -298,8 +298,9 @@ class EmblemVaultSDK {
298
298
  let collection = yield this.fetchCuratedContractByName(collectionName);
299
299
  let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
300
300
  let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
301
- let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
302
- let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
301
+ let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price / 1000000, callback);
302
+ let ethToSend = quote.mul(bignumber_1.BigNumber.from(10).pow(6));
303
+ let mintResponse = yield this.performMint(web3, ethToSend, remoteMintSig, callback);
303
304
  return { mintResponse };
304
305
  });
305
306
  }
@@ -413,7 +414,8 @@ class EmblemVaultSDK {
413
414
  }
414
415
  const accounts = yield web3.eth.getAccounts();
415
416
  let handlerContract = yield (0, utils_1.getHandlerContract)(web3);
416
- let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: quote.toString() });
417
+ const feeData = yield web3.eth.getGasPrice();
418
+ let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: Number(quote), gasPrice: feeData });
417
419
  if (callback) {
418
420
  callback('Mint Complete');
419
421
  }
package/docs/bundle.js CHANGED
@@ -709477,7 +709477,7 @@ const bignumber_1 = require("@ethersproject/bignumber");
709477
709477
  const utils_1 = require("./utils");
709478
709478
  const sats_connect_1 = require("sats-connect");
709479
709479
  const derive_1 = require("./derive");
709480
- const SDK_VERSION = '1.9.5';
709480
+ const SDK_VERSION = '1.9.6';
709481
709481
  class EmblemVaultSDK {
709482
709482
  constructor(apiKey, baseUrl) {
709483
709483
  this.apiKey = apiKey;
@@ -709739,8 +709739,9 @@ class EmblemVaultSDK {
709739
709739
  let collection = yield this.fetchCuratedContractByName(collectionName);
709740
709740
  let mintRequestSig = yield this.requestLocalMintSignature(web3, tokenId, callback);
709741
709741
  let remoteMintSig = yield this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
709742
- let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price, callback);
709743
- let mintResponse = yield this.performMint(web3, quote, remoteMintSig, callback);
709742
+ let quote = yield this.getQuote(web3, collection ? collection.price : remoteMintSig._price / 1000000, callback);
709743
+ let ethToSend = quote.mul(bignumber_1.BigNumber.from(10).pow(6));
709744
+ let mintResponse = yield this.performMint(web3, ethToSend, remoteMintSig, callback);
709744
709745
  return { mintResponse };
709745
709746
  });
709746
709747
  }
@@ -709854,7 +709855,8 @@ class EmblemVaultSDK {
709854
709855
  }
709855
709856
  const accounts = yield web3.eth.getAccounts();
709856
709857
  let handlerContract = yield (0, utils_1.getHandlerContract)(web3);
709857
- let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: quote.toString() });
709858
+ const feeData = yield web3.eth.getGasPrice();
709859
+ let mintResponse = yield handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({ from: accounts[0], value: Number(quote), gasPrice: feeData });
709858
709860
  if (callback) {
709859
709861
  callback('Mint Complete');
709860
709862
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "Emblem Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -253,8 +253,9 @@ class EmblemVaultSDK {
253
253
  let collection = await this.fetchCuratedContractByName(collectionName);
254
254
  let mintRequestSig = await this.requestLocalMintSignature(web3, tokenId, callback);
255
255
  let remoteMintSig = await this.requestRemoteMintSignature(web3, tokenId, mintRequestSig, callback);
256
- let quote = await this.getQuote(web3, collection? collection.price: remoteMintSig._price, callback);
257
- let mintResponse = await this.performMint(web3, quote, remoteMintSig, callback);
256
+ let quote = await this.getQuote(web3, collection? collection.price: remoteMintSig._price/1000000, callback);
257
+ let ethToSend = quote.mul(BigNumber.from(10).pow(6))
258
+ let mintResponse = await this.performMint(web3, ethToSend, remoteMintSig, callback);
258
259
  return {mintResponse}
259
260
  }
260
261
 
@@ -329,7 +330,8 @@ class EmblemVaultSDK {
329
330
  if (callback) { callback('performing Mint')}
330
331
  const accounts = await web3.eth.getAccounts();
331
332
  let handlerContract = await getHandlerContract(web3);
332
- let mintResponse = await handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({from: accounts[0], value: quote.toString()});
333
+ const feeData = await web3.eth.getGasPrice()
334
+ let mintResponse = await handlerContract.methods.buyWithQuote(remoteMintSig._nftAddress, remoteMintSig._price, remoteMintSig._to, remoteMintSig._tokenId, remoteMintSig._nonce, remoteMintSig._signature, remoteMintSig.serialNumber, 1).send({from: accounts[0], value: Number(quote), gasPrice: feeData });
333
335
  if (callback) { callback('Mint Complete')}
334
336
  await this.fetchMetadata(remoteMintSig._tokenId);
335
337
  return mintResponse