@interest-protocol/vortex-sdk 11.0.0 → 11.2.0
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/constants.d.ts.map +1 -1
- package/dist/index.js +22 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -15
- package/dist/index.mjs.map +1 -1
- package/dist/vortex-api.d.ts.map +1 -1
- package/dist/vortex-api.types.d.ts +7 -2
- package/dist/vortex-api.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/constants.ts +2 -1
- package/src/vortex-api.ts +35 -17
- package/src/vortex-api.types.ts +7 -2
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iFACgD,CAAC;AAGjF,eAAO,MAAM,UAAU,iFACyD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iFAAa,CAAC;AAE3C,eAAO,MAAM,oBAAoB,UAiChC,CAAC;AAEF,oBAAY,OAAO;IACjB,OAAO,oBAAoB;IAC3B,KAAK,iBAAiB;IACtB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;CAgBvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,uEACwC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,uEACmC,CAAC;AAEvE,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE,eAAO,MAAM,iBAAiB,uEACwC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,uBAAuB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,iFACgD,CAAC;AAGjF,eAAO,MAAM,UAAU,iFACyD,CAAC;AAEjF,eAAO,MAAM,gBAAgB,iFAAa,CAAC;AAE3C,eAAO,MAAM,oBAAoB,UAiChC,CAAC;AAEF,oBAAY,OAAO;IACjB,OAAO,oBAAoB;IAC3B,KAAK,iBAAiB;IACtB,MAAM,WAAW;CAClB;AAED,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;CAgBvB,CAAC;AAEF,eAAO,MAAM,iBAAiB,uEACwC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,kBAAkB,uEACuC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,uEACmC,CAAC;AAEvE,eAAO,MAAM,uBAAuB,uEACkC,CAAC;AAEvE,eAAO,MAAM,iBAAiB,uEACwC,CAAC;AAEvE,eAAO,MAAM,sBAAsB,cAAc,CAAC;AAElD,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAE/C,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAEzD,eAAO,MAAM,uBAAuB,QAC4C,CAAC;AAEjF,eAAO,MAAM,gBAAgB,uEACyC,CAAC;AAGvE,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,eAAO,MAAM,YAAY,SAAU,CAAC;AAEpC,eAAO,MAAM,eAAe;;CAG3B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -3380,7 +3380,7 @@ const SECRET_PACKAGE_ID = '0x2d57ed0dd0d5f44d91f865fee3bc33d13ef3ce97c7daf88ad5f
|
|
|
3380
3380
|
const INITIAL_SHARED_VERSION = '692442863';
|
|
3381
3381
|
const LSK_FETCH_OFFSET = 'fetch_offset';
|
|
3382
3382
|
const LSK_ENCRYPTED_OUTPUTS = 'encrypted_outputs';
|
|
3383
|
-
const VORTEX_SIGNATURE_DOMAIN = 'https://vortexfi.xyz/'.toUpperCase();
|
|
3383
|
+
const VORTEX_SIGNATURE_DOMAIN = 'https://vortexfi.xyz/ | https://vtx.cash/ | https://vtx.money/'.toUpperCase();
|
|
3384
3384
|
const TREASURY_ADDRESS = '0x894261575b948c035d002adc3ca4d73c683c01a1bfafac183870940bf9afef1a';
|
|
3385
3385
|
// 0.5% deposit fee
|
|
3386
3386
|
const DEPOSIT_FEE_IN_BASIS_POINTS = 50n;
|
|
@@ -39593,7 +39593,7 @@ class VortexAPI {
|
|
|
39593
39593
|
if (args.excludeHidden !== undefined) {
|
|
39594
39594
|
params.set('exclude_hidden', args.excludeHidden.toString());
|
|
39595
39595
|
}
|
|
39596
|
-
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}
|
|
39596
|
+
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/accounts?${params.toString()}`, args.apiKey);
|
|
39597
39597
|
__classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
|
|
39598
39598
|
return response;
|
|
39599
39599
|
}
|
|
@@ -39601,7 +39601,7 @@ class VortexAPI {
|
|
|
39601
39601
|
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_post).call(this, '/api/v1/accounts', {
|
|
39602
39602
|
owner: args.owner,
|
|
39603
39603
|
hashedSecret: args.hashedSecret,
|
|
39604
|
-
});
|
|
39604
|
+
}, args.apiKey);
|
|
39605
39605
|
__classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
|
|
39606
39606
|
return response;
|
|
39607
39607
|
}
|
|
@@ -39630,7 +39630,7 @@ class VortexAPI {
|
|
|
39630
39630
|
}
|
|
39631
39631
|
const query = params.toString();
|
|
39632
39632
|
const path = query ? `/api/v1/pools?${query}` : '/api/v1/pools';
|
|
39633
|
-
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path);
|
|
39633
|
+
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, path, args.apiKey);
|
|
39634
39634
|
__classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
|
|
39635
39635
|
return response;
|
|
39636
39636
|
}
|
|
@@ -39648,7 +39648,7 @@ class VortexAPI {
|
|
|
39648
39648
|
if (args.limit) {
|
|
39649
39649
|
params.set('limit', args.limit.toString());
|
|
39650
39650
|
}
|
|
39651
|
-
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}
|
|
39651
|
+
const response = await __classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_get).call(this, `/api/v1/commitments?${params.toString()}`, args.apiKey);
|
|
39652
39652
|
__classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
|
|
39653
39653
|
return response;
|
|
39654
39654
|
}
|
|
@@ -39657,7 +39657,7 @@ class VortexAPI {
|
|
|
39657
39657
|
let page = 1;
|
|
39658
39658
|
let hasNext = true;
|
|
39659
39659
|
while (hasNext) {
|
|
39660
|
-
const response = await this.getCommitments({ ...args, page });
|
|
39660
|
+
const response = await this.getCommitments({ ...args, page, apiKey: args.apiKey });
|
|
39661
39661
|
allCommitments.push(...response.data.items);
|
|
39662
39662
|
hasNext = response.data.pagination.hasNext;
|
|
39663
39663
|
page++;
|
|
@@ -39672,7 +39672,7 @@ class VortexAPI {
|
|
|
39672
39672
|
public_key: args.publicKey,
|
|
39673
39673
|
blinding: args.blinding,
|
|
39674
39674
|
vortex_pool: args.vortexPool,
|
|
39675
|
-
});
|
|
39675
|
+
}, args.apiKey);
|
|
39676
39676
|
__classPrivateFieldGet(this, _VortexAPI_instances, "m", _VortexAPI_assertSuccess).call(this, response);
|
|
39677
39677
|
return response;
|
|
39678
39678
|
}
|
|
@@ -39689,21 +39689,28 @@ class VortexAPI {
|
|
|
39689
39689
|
return response;
|
|
39690
39690
|
}
|
|
39691
39691
|
}
|
|
39692
|
-
_VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path) {
|
|
39692
|
+
_VortexAPI_apiUrl = new WeakMap(), _VortexAPI_instances = new WeakSet(), _VortexAPI_get = async function _VortexAPI_get(path, apiKey) {
|
|
39693
|
+
const headers = {
|
|
39694
|
+
'Content-Type': 'application/json',
|
|
39695
|
+
};
|
|
39696
|
+
if (apiKey) {
|
|
39697
|
+
headers['x-api-key'] = apiKey;
|
|
39698
|
+
}
|
|
39693
39699
|
const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
|
|
39694
39700
|
method: 'GET',
|
|
39695
|
-
headers
|
|
39696
|
-
'Content-Type': 'application/json',
|
|
39697
|
-
},
|
|
39701
|
+
headers,
|
|
39698
39702
|
});
|
|
39699
39703
|
return response.json();
|
|
39700
39704
|
}, _VortexAPI_post = async function _VortexAPI_post(path, body, apiKey) {
|
|
39705
|
+
const headers = {
|
|
39706
|
+
'Content-Type': 'application/json',
|
|
39707
|
+
};
|
|
39708
|
+
if (apiKey) {
|
|
39709
|
+
headers['x-api-key'] = apiKey;
|
|
39710
|
+
}
|
|
39701
39711
|
const response = await fetch(`${__classPrivateFieldGet(this, _VortexAPI_apiUrl, "f")}${path}`, {
|
|
39702
39712
|
method: 'POST',
|
|
39703
|
-
headers
|
|
39704
|
-
'Content-Type': 'application/json',
|
|
39705
|
-
'x-api-key': apiKey ?? '',
|
|
39706
|
-
},
|
|
39713
|
+
headers,
|
|
39707
39714
|
body: JSON.stringify(body),
|
|
39708
39715
|
});
|
|
39709
39716
|
return response.json();
|