Skip to content

Commit

Permalink
chore: ugprade and run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanofa committed Nov 13, 2023
1 parent 3aee0fb commit ced081d
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 38 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"build": "turbo run build",
"dev": "turbo run dev",
"lint": "turbo run lint",
"format": "prettier --write \"**/*\" --ignore-unknown",
"format": "prettier --write . --ignore-unknown",
"release": "turbo run build && changeset publish",
"check-exports": "turbo run check-exports"
},
"devDependencies": {
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"eslint": "^8.48.0",
"prettier": "^3.0.3",
"prettier-plugin-astro": "^0.12.0",
"prettier": "^3.1.0",
"prettier-plugin-astro": "^0.12.2",
"tsconfig": "workspace:*",
"turbo": "^1.10.15"
},
Expand Down
11 changes: 3 additions & 8 deletions packages/folks-router-js-sdk/examples/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ async function main() {
const client = new FolksRouterClient(Network.MAINNET);

// fetch quote
const quote = await client.fetchSwapQuote(
0,
31566704,
BigInt(10e6),
SwapMode.FIXED_INPUT,
);
const quote = await client.fetchSwapQuote(0, 31566704, BigInt(10e6), SwapMode.FIXED_INPUT);

// prepare swap
const base64txns = await client.prepareSwapTransactions(user.addr, BigInt(10), quote);
const unsignedTxns = base64txns.map(txn => decodeUnsignedTransaction(Buffer.from(txn, "base64")));
const signedTxns = unsignedTxns.map(txn => txn.signTxn(user.sk));
const unsignedTxns = base64txns.map((txn) => decodeUnsignedTransaction(Buffer.from(txn, "base64")));
const signedTxns = unsignedTxns.map((txn) => txn.signTxn(user.sk));

// submit
await algod.sendRawTransaction(signedTxns).do();
Expand Down
8 changes: 4 additions & 4 deletions packages/folks-router-js-sdk/src/FolksRouterClient.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import axios, { AxiosInstance} from "axios";
import axios, { AxiosInstance } from "axios";
import { Network, SwapMode, SwapQuote, SwapTransactions } from "./types";

const BASE_URL = "https://api.folksrouter.io";
Expand All @@ -18,7 +18,7 @@ export class FolksRouterClient {

// set
this.network = network;
this.api = axios.create({ baseURL: url, headers: { "x-api-key": apiKey }});
this.api = axios.create({ baseURL: url, headers: { "x-api-key": apiKey } });
}

public async fetchSwapQuote(
Expand All @@ -40,7 +40,7 @@ export class FolksRouterClient {
maxGroupSize,
feeBps,
referrer,
}
},
});
if (!data.success) throw Error(data.errors);

Expand All @@ -64,7 +64,7 @@ export class FolksRouterClient {
userAddress,
slippageBps,
txnPayload: swapQuote.txnPayload,
}
},
});
if (!data.success) throw Error(data.errors);

Expand Down
4 changes: 2 additions & 2 deletions packages/folks-router-js-sdk/src/abiContracts/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ABIContract } from "algosdk";
import routerABI from "./router.json"
import routerABI from "./router.json";

export const routerABIContract = new ABIContract(routerABI)
export const routerABIContract = new ABIContract(routerABI);
6 changes: 4 additions & 2 deletions packages/folks-router-js-sdk/src/referrer.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import {
assignGroupID,
decodeAddress, encodeAddress,
decodeAddress,
encodeAddress,
encodeUnsignedTransaction,
LogicSigAccount,
SuggestedParams, Transaction
SuggestedParams,
Transaction,
} from "algosdk";
import { ReferrerGroupTransaction } from "./types";
import { transferAlgoOrAsset } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/folks-router-js-sdk/src/swap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
getApplicationAddress,
getMethodByName,
SuggestedParams,
Transaction
Transaction,
} from "algosdk";
import { routerABIContract } from "./abiContracts";
import { signer, transferAlgoOrAsset } from "./utils";
Expand Down
2 changes: 1 addition & 1 deletion packages/folks-router-js-sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ interface SwapQuote {

type SwapTransactions = string[];

export { ReferrerGroupTransaction, Network, SwapMode, SwapQuote, SwapTransactions }
export { ReferrerGroupTransaction, Network, SwapMode, SwapQuote, SwapTransactions };
2 changes: 1 addition & 1 deletion packages/folks-router-js-sdk/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
makeAssetTransferTxnWithSuggestedParams,
makePaymentTxnWithSuggestedParams,
SuggestedParams,
Transaction
Transaction,
} from "algosdk";

const signer = async () => [];
Expand Down
2 changes: 1 addition & 1 deletion packages/folks-router-js-sdk/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"sourceMap": true,
"isolatedModules": false,
"exactOptionalPropertyTypes": false,
"resolveJsonModule": true,
"resolveJsonModule": true
},
"include": ["./src/index.ts", "./examples/*"],
"exclude": ["dist", "build", "node_modules"]
Expand Down
30 changes: 15 additions & 15 deletions pnpm-lock.yaml

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

0 comments on commit ced081d

Please sign in to comment.