@mento-protocol/mento-sdk 1.0.3 → 1.0.4
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/cjs/mento.d.ts +2 -2
- package/dist/cjs/mento.js +4 -5
- package/dist/esm/mento.d.ts +2 -2
- package/dist/esm/mento.js +4 -5
- package/package.json +3 -2
package/dist/cjs/mento.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare class Mento {
|
|
|
58
58
|
* Get tradable pairs for backwards compatibility
|
|
59
59
|
* @returns an array of Asset pairs
|
|
60
60
|
*/
|
|
61
|
-
getTradablePairs(
|
|
61
|
+
getTradablePairs({ cached, }?: {
|
|
62
62
|
cached?: boolean;
|
|
63
63
|
}): Promise<[Asset, Asset][]>;
|
|
64
64
|
/**
|
|
@@ -76,7 +76,7 @@ export declare class Mento {
|
|
|
76
76
|
* the two Asset objects, and an array of exchange details for each hop.
|
|
77
77
|
* @returns An array of TradablePair objects representing available trade routes.
|
|
78
78
|
*/
|
|
79
|
-
getTradablePairsWithPath(
|
|
79
|
+
getTradablePairsWithPath({ cached, }?: {
|
|
80
80
|
cached?: boolean;
|
|
81
81
|
}): Promise<readonly TradablePair[]>;
|
|
82
82
|
/**
|
package/dist/cjs/mento.js
CHANGED
|
@@ -69,10 +69,9 @@ class Mento {
|
|
|
69
69
|
* Get tradable pairs for backwards compatibility
|
|
70
70
|
* @returns an array of Asset pairs
|
|
71
71
|
*/
|
|
72
|
-
getTradablePairs(
|
|
73
|
-
var _a;
|
|
72
|
+
getTradablePairs({ cached = true, } = {}) {
|
|
74
73
|
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
-
return (yield this.getTradablePairsWithPath({ cached
|
|
74
|
+
return (yield this.getTradablePairsWithPath({ cached })).map((pair) => pair.assets);
|
|
76
75
|
});
|
|
77
76
|
}
|
|
78
77
|
/**
|
|
@@ -132,10 +131,10 @@ class Mento {
|
|
|
132
131
|
* the two Asset objects, and an array of exchange details for each hop.
|
|
133
132
|
* @returns An array of TradablePair objects representing available trade routes.
|
|
134
133
|
*/
|
|
135
|
-
getTradablePairsWithPath(
|
|
134
|
+
getTradablePairsWithPath({ cached = true, } = {}) {
|
|
136
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
137
136
|
// Get tradable pairs from cache if available.
|
|
138
|
-
if (
|
|
137
|
+
if (cached) {
|
|
139
138
|
const value = (0, tradablePairs_1.getCachedTradablePairs)(yield (0, utils_1.getChainId)(this.signerOrProvider));
|
|
140
139
|
if (value) {
|
|
141
140
|
return value;
|
package/dist/esm/mento.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare class Mento {
|
|
|
58
58
|
* Get tradable pairs for backwards compatibility
|
|
59
59
|
* @returns an array of Asset pairs
|
|
60
60
|
*/
|
|
61
|
-
getTradablePairs(
|
|
61
|
+
getTradablePairs({ cached, }?: {
|
|
62
62
|
cached?: boolean;
|
|
63
63
|
}): Promise<[Asset, Asset][]>;
|
|
64
64
|
/**
|
|
@@ -76,7 +76,7 @@ export declare class Mento {
|
|
|
76
76
|
* the two Asset objects, and an array of exchange details for each hop.
|
|
77
77
|
* @returns An array of TradablePair objects representing available trade routes.
|
|
78
78
|
*/
|
|
79
|
-
getTradablePairsWithPath(
|
|
79
|
+
getTradablePairsWithPath({ cached, }?: {
|
|
80
80
|
cached?: boolean;
|
|
81
81
|
}): Promise<readonly TradablePair[]>;
|
|
82
82
|
/**
|
package/dist/esm/mento.js
CHANGED
|
@@ -66,10 +66,9 @@ export class Mento {
|
|
|
66
66
|
* Get tradable pairs for backwards compatibility
|
|
67
67
|
* @returns an array of Asset pairs
|
|
68
68
|
*/
|
|
69
|
-
getTradablePairs(
|
|
70
|
-
var _a;
|
|
69
|
+
getTradablePairs({ cached = true, } = {}) {
|
|
71
70
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
-
return (yield this.getTradablePairsWithPath({ cached
|
|
71
|
+
return (yield this.getTradablePairsWithPath({ cached })).map((pair) => pair.assets);
|
|
73
72
|
});
|
|
74
73
|
}
|
|
75
74
|
/**
|
|
@@ -129,10 +128,10 @@ export class Mento {
|
|
|
129
128
|
* the two Asset objects, and an array of exchange details for each hop.
|
|
130
129
|
* @returns An array of TradablePair objects representing available trade routes.
|
|
131
130
|
*/
|
|
132
|
-
getTradablePairsWithPath(
|
|
131
|
+
getTradablePairsWithPath({ cached = true, } = {}) {
|
|
133
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
133
|
// Get tradable pairs from cache if available.
|
|
135
|
-
if (
|
|
134
|
+
if (cached) {
|
|
136
135
|
const value = getCachedTradablePairs(yield getChainId(this.signerOrProvider));
|
|
137
136
|
if (value) {
|
|
138
137
|
return value;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mento-protocol/mento-sdk",
|
|
3
3
|
"description": "Official SDK for interacting with the Mento Protocol",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Mento Labs",
|
|
7
7
|
"keywords": [
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
"size": "size-limit",
|
|
32
32
|
"test": "jest --runInBand --verbose",
|
|
33
33
|
"coverage": "jest --coverage",
|
|
34
|
-
"cacheTradablePairs": "ts-node scripts/cacheTradablePairs.ts"
|
|
34
|
+
"cacheTradablePairs": "ts-node scripts/cacheTradablePairs.ts",
|
|
35
|
+
"printTradablePairs": "ts-node scripts/printTradablePairs.ts"
|
|
35
36
|
},
|
|
36
37
|
"husky": {
|
|
37
38
|
"hooks": {
|