emblem-vault-sdk 1.9.0 → 1.9.1

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
@@ -711195,7 +711195,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
711195
711195
  Object.defineProperty(exports, "__esModule", { value: true });
711196
711196
  const bignumber_1 = require("@ethersproject/bignumber");
711197
711197
  const utils_1 = require("./utils");
711198
- const SDK_VERSION = '1.9.0';
711198
+ const SDK_VERSION = '1.9.1';
711199
711199
  class EmblemVaultSDK {
711200
711200
  constructor(apiKey, baseUrl) {
711201
711201
  this.apiKey = apiKey;
@@ -711265,6 +711265,7 @@ class EmblemVaultSDK {
711265
711265
  createCuratedVault(template, callback = null) {
711266
711266
  return __awaiter(this, void 0, void 0, function* () {
711267
711267
  (0, utils_1.templateGuard)(template);
711268
+ template.chainId == 1 ? delete template.targetContract[5] : delete template.targetContract[1];
711268
711269
  let url = `${this.baseUrl}/create-curated`;
711269
711270
  if (callback) {
711270
711271
  callback(`creating Vault for user`, template.toAddress);
@@ -712108,7 +712109,7 @@ function generateTemplate(record) {
712108
712109
  let template = {
712109
712110
  fromAddress: { type: "user-provided" },
712110
712111
  toAddress: { type: "user-provided" },
712111
- chainId: 1,
712112
+ chainId: { type: "user-provided" },
712112
712113
  experimental: true,
712113
712114
  targetContract: Object.assign(Object.assign({}, _this.contracts), { name: _this.name, description: _this.loadTypes.includes('detailed') ? null : _this.description }),
712114
712115
  targetAsset: {
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
34
34
  Object.defineProperty(exports, "__esModule", { value: true });
35
35
  const bignumber_1 = require("@ethersproject/bignumber");
36
36
  const utils_1 = require("./utils");
37
- const SDK_VERSION = '1.9.0';
37
+ const SDK_VERSION = '1.9.1';
38
38
  class EmblemVaultSDK {
39
39
  constructor(apiKey, baseUrl) {
40
40
  this.apiKey = apiKey;
@@ -104,6 +104,7 @@ class EmblemVaultSDK {
104
104
  createCuratedVault(template, callback = null) {
105
105
  return __awaiter(this, void 0, void 0, function* () {
106
106
  (0, utils_1.templateGuard)(template);
107
+ template.chainId == 1 ? delete template.targetContract[5] : delete template.targetContract[1];
107
108
  let url = `${this.baseUrl}/create-curated`;
108
109
  if (callback) {
109
110
  callback(`creating Vault for user`, template.toAddress);
package/dist/utils.js CHANGED
@@ -478,7 +478,7 @@ function generateTemplate(record) {
478
478
  let template = {
479
479
  fromAddress: { type: "user-provided" },
480
480
  toAddress: { type: "user-provided" },
481
- chainId: 1,
481
+ chainId: { type: "user-provided" },
482
482
  experimental: true,
483
483
  targetContract: Object.assign(Object.assign({}, _this.contracts), { name: _this.name, description: _this.loadTypes.includes('detailed') ? null : _this.description }),
484
484
  targetAsset: {
package/docs/DeGods.html CHANGED
@@ -27,6 +27,7 @@
27
27
  "experimental":true,
28
28
  "targetContract":{
29
29
  "1":"0x345eF9d7E75aEEb979053AA41BB6330683353B7b",
30
+ "5":"0x582699d2c58A38056Cf02875540705137f0bbbF7",
30
31
  "name":"Bitcoin DeGods",
31
32
  "description":"Bitcoin DeGods is a collection of 535 Bitcoin Ordinals inscribed in the 77236 to 77770 range. This collection is curated by Emblem Vault. "
32
33
  },
@@ -50,10 +51,11 @@
50
51
  defaultAccount = await web3.eth.getAccounts().then(accounts => accounts[0]).catch(err=>console) // Minter's address
51
52
  }
52
53
  if (!vaultData) {
54
+ let chainId = Number(await web3.eth.net.getId())
53
55
  // populate the template
54
56
  contractTemplate.toAddress = defaultAccount;
55
57
  contractTemplate.fromAddress = defaultAccount;
56
-
58
+ contractTemplate.chainId = chainId;
57
59
  // Create a vault
58
60
  vaultData = await sdk.createCuratedVault(contractTemplate, updateLogCallback).catch(err=>console.log(err));
59
61
  if (!vaultData || vaultData.err) { // Temporary fix while I fix a race condition
package/docs/bundle.js CHANGED
@@ -711195,7 +711195,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
711195
711195
  Object.defineProperty(exports, "__esModule", { value: true });
711196
711196
  const bignumber_1 = require("@ethersproject/bignumber");
711197
711197
  const utils_1 = require("./utils");
711198
- const SDK_VERSION = '1.9.0';
711198
+ const SDK_VERSION = '1.9.1';
711199
711199
  class EmblemVaultSDK {
711200
711200
  constructor(apiKey, baseUrl) {
711201
711201
  this.apiKey = apiKey;
@@ -711265,6 +711265,7 @@ class EmblemVaultSDK {
711265
711265
  createCuratedVault(template, callback = null) {
711266
711266
  return __awaiter(this, void 0, void 0, function* () {
711267
711267
  (0, utils_1.templateGuard)(template);
711268
+ template.chainId == 1 ? delete template.targetContract[5] : delete template.targetContract[1];
711268
711269
  let url = `${this.baseUrl}/create-curated`;
711269
711270
  if (callback) {
711270
711271
  callback(`creating Vault for user`, template.toAddress);
@@ -712108,7 +712109,7 @@ function generateTemplate(record) {
712108
712109
  let template = {
712109
712110
  fromAddress: { type: "user-provided" },
712110
712111
  toAddress: { type: "user-provided" },
712111
- chainId: 1,
712112
+ chainId: { type: "user-provided" },
712112
712113
  experimental: true,
712113
712114
  targetContract: Object.assign(Object.assign({}, _this.contracts), { name: _this.name, description: _this.loadTypes.includes('detailed') ? null : _this.description }),
712114
712115
  targetAsset: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emblem-vault-sdk",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "description": "Emblem Vault Software Development Kit",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -78,6 +78,7 @@ class EmblemVaultSDK {
78
78
 
79
79
  async createCuratedVault(template: any, callback: any = null): Promise<Vault> {
80
80
  templateGuard(template);
81
+ template.chainId == 1? delete template.targetContract[5]: delete template.targetContract[1]
81
82
  let url = `${this.baseUrl}/create-curated`;
82
83
  if (callback) { callback(`creating Vault for user`, template.toAddress)}
83
84
  let vaultCreationResponse = await fetchData(url, this.apiKey, 'POST', template);
package/src/utils.ts CHANGED
@@ -455,7 +455,7 @@ export function generateTemplate(record: any) {
455
455
  let template: any = {
456
456
  fromAddress: { type: "user-provided" },
457
457
  toAddress: { type: "user-provided" },
458
- chainId: 1,
458
+ chainId: { type: "user-provided" },
459
459
  experimental: true,
460
460
  targetContract: {
461
461
  ..._this.contracts,
@@ -93,7 +93,7 @@ const mocks = {
93
93
  emblemopen_create_template: {
94
94
  "fromAddress": { "type": "user-provided" },
95
95
  "toAddress": { "type": "user-provided" },
96
- "chainId": 1,
96
+ "chainId": { "type": "user-provided" },
97
97
  "experimental": true,
98
98
  "targetContract": {
99
99
  "1": "0x184ddb67E2EF517f6754F055b56905f2A9b29b6A",
@@ -109,7 +109,8 @@ const mocks = {
109
109
  empty_create_template: {
110
110
  "fromAddress": { "type": "user-provided" },
111
111
  "toAddress": { "type": "user-provided" },
112
- "chainId": 1, "experimental": true,
112
+ "chainId": { "type": "user-provided" },
113
+ "experimental": true,
113
114
  "targetContract": {
114
115
  "1": "0xEAD67175CDb9CBDeA5bDDC36015e52f4A954E3fD",
115
116
  "name": "BitcoinOrdinals",