@7kprotocol/sdk-ts 3.0.1 → 3.0.2
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.
|
@@ -122,16 +122,16 @@ const buildTx = async ({ quoteResponse, accountAddress, slippage, commission: __
|
|
|
122
122
|
};
|
|
123
123
|
exports.buildTx = buildTx;
|
|
124
124
|
const getPythPriceFeeds = (res) => {
|
|
125
|
-
const ids =
|
|
125
|
+
const ids = new Set();
|
|
126
126
|
for (const s of res.swaps) {
|
|
127
127
|
for (const o of s.extra?.oracles || []) {
|
|
128
128
|
const bytes = o.Pyth?.price_identifier?.bytes;
|
|
129
129
|
if (bytes) {
|
|
130
|
-
ids.
|
|
130
|
+
ids.add("0x" + (0, utils_1.toHex)(Uint8Array.from(bytes)));
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
-
return ids;
|
|
134
|
+
return Array.from(ids);
|
|
135
135
|
};
|
|
136
136
|
const updatePythPriceFeedsIfAny = async (tx, quoteResponse) => {
|
|
137
137
|
// update oracles price if any
|
|
@@ -85,7 +85,7 @@ exports.DEFAULT_CONFIG = {
|
|
|
85
85
|
steamm: {
|
|
86
86
|
name: "Steamm",
|
|
87
87
|
package: "0x4454d95507deb17d5017db11105bd95027d434776af1d0049ce27a3510a9a1ba",
|
|
88
|
-
script: "
|
|
88
|
+
script: "0xbef015f8fe24f324cc4a7939a88c164e78d2d859aa925a75bd8f8472b6ae7d0e",
|
|
89
89
|
oracle: "0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b",
|
|
90
90
|
},
|
|
91
91
|
magma: {
|
|
@@ -118,16 +118,16 @@ export const buildTx = async ({ quoteResponse, accountAddress, slippage, commiss
|
|
|
118
118
|
return { tx, coinOut };
|
|
119
119
|
};
|
|
120
120
|
const getPythPriceFeeds = (res) => {
|
|
121
|
-
const ids =
|
|
121
|
+
const ids = new Set();
|
|
122
122
|
for (const s of res.swaps) {
|
|
123
123
|
for (const o of s.extra?.oracles || []) {
|
|
124
124
|
const bytes = o.Pyth?.price_identifier?.bytes;
|
|
125
125
|
if (bytes) {
|
|
126
|
-
ids.
|
|
126
|
+
ids.add("0x" + toHex(Uint8Array.from(bytes)));
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
return ids;
|
|
130
|
+
return Array.from(ids);
|
|
131
131
|
};
|
|
132
132
|
const updatePythPriceFeedsIfAny = async (tx, quoteResponse) => {
|
|
133
133
|
// update oracles price if any
|
|
@@ -81,7 +81,7 @@ export const DEFAULT_CONFIG = {
|
|
|
81
81
|
steamm: {
|
|
82
82
|
name: "Steamm",
|
|
83
83
|
package: "0x4454d95507deb17d5017db11105bd95027d434776af1d0049ce27a3510a9a1ba",
|
|
84
|
-
script: "
|
|
84
|
+
script: "0xbef015f8fe24f324cc4a7939a88c164e78d2d859aa925a75bd8f8472b6ae7d0e",
|
|
85
85
|
oracle: "0xe84b649199654d18c38e727212f5d8dacfc3cf78d60d0a7fc85fd589f280eb2b",
|
|
86
86
|
},
|
|
87
87
|
magma: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@7kprotocol/sdk-ts",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"build:esm": "tsc -p ./configs/tsconfig.esm.json && mv lib/esm/index.js lib/esm/index.mjs",
|
|
41
41
|
"build:cjs": "tsc -p ./configs/tsconfig.cjs.json",
|
|
42
42
|
"prepack": "npm run build",
|
|
43
|
-
"test": "mocha --timeout
|
|
43
|
+
"test": "mocha --timeout 10000",
|
|
44
44
|
"publish:patch": "npm version patch --no-git-tag-version && npm publish --access public",
|
|
45
45
|
"publish:minor": "npm version minor --no-git-tag-version && npm publish --access public",
|
|
46
46
|
"publish:major": "npm version major --no-git-tag-version && npm publish --access public",
|