Skip to content

Commit

Permalink
chore: change router path parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
collin-aftermath committed Oct 12, 2024
1 parent aefc68a commit fca8586
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aftermath-ts-sdk",
"version": "1.1.91",
"version": "1.1.92",
"description": "Aftermath TypeScript SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
3 changes: 1 addition & 2 deletions src/packages/router/api/routerApiCasting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class RouterApiCasting {
const routes: RouterTradeRoute[] = paths.data.map((path) => ({
// TODO: add spot price
paths: path.path.data.map((hop) => ({
protocolName: hop.protocol,
protocolName: hop.pool.protocol.protocol,
pool: hop.pool,
coinIn: {
type: hop.input,
Expand Down Expand Up @@ -121,7 +121,6 @@ export class RouterApiCasting {
amount: Number(route.coinIn.amount),
path: {
data: route.paths.map((path) => ({
protocol: path.protocolName,
pool: path.pool,
input: path.coinIn.type,
output: path.coinOut.type,
Expand Down
5 changes: 3 additions & 2 deletions src/packages/router/routerTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export interface RouterServicePath {
}

export interface RouterServiceHop {
protocol: RouterProtocolName;
pool: RouterServicePoolMetadata;
input: CoinType;
output: CoinType;
Expand All @@ -236,7 +235,9 @@ export interface RouterServiceSwapFee {
}

export interface RouterServicePoolMetadata {
protocol: any; // ?
protocol: {
protocol: RouterProtocolName;
};
pool_id: ObjectId;
tb_data: any; // TBData
assets: [CoinType, CoinType];
Expand Down

0 comments on commit fca8586

Please sign in to comment.