Skip to content

Commit bcef602

Browse files
authored
Merge pull request #56 from skip-mev/fix-single-chain-txs
Properly track status of single chain transactions
2 parents e78ce8b + c39f6ce commit bcef602

File tree

4 files changed

+18
-19
lines changed

4 files changed

+18
-19
lines changed

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@radix-ui/react-dialog": "^1.0.4",
4040
"@radix-ui/react-toast": "^1.1.4",
4141
"@radix-ui/react-tooltip": "^1.0.6",
42-
"@skip-router/core": "^0.0.7",
42+
"@skip-router/core": "^0.0.11",
4343
"@tanstack/react-query": "^4.29.5",
4444
"@types/node": "20.1.2",
4545
"@types/react": "18.2.6",

src/solve/context.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export const SkipContext = createContext<
1818
export const SkipProvider: FC<PropsWithChildren> = ({ children }) => {
1919
const { client: walletClient } = useWalletClient();
2020

21-
const skipClient = new SkipRouter(SKIP_API_URL, {
21+
const skipClient = new SkipRouter({
22+
apiURL: SKIP_API_URL,
2223
getOfflineSigner: async (chainID) => {
2324
if (!walletClient) {
2425
throw new Error("No offline signer available");

src/solve/execute-route.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export async function executeRoute(
3333
addressList.push(address);
3434
}
3535

36-
const skipClient = new SkipRouter(SKIP_API_URL, {
36+
const skipClient = new SkipRouter({
37+
apiURL: SKIP_API_URL,
3738
getOfflineSigner: async (chainID) => {
3839
const signerIsLedger = await isLedger(walletClient, chainID);
3940

@@ -62,19 +63,16 @@ export async function executeRoute(
6263

6364
let i = 0;
6465

65-
await skipClient.executeRoute(route, userAddresses, {
66-
onTransactionSuccess: async (txStatus) => {
67-
const { sendTx } = txStatus.transferSequence[0].packetTXs;
68-
if (!sendTx) {
69-
return;
70-
}
71-
72-
const explorerLink = getExplorerLinkForTx(sendTx.chainID, sendTx.txHash);
66+
await skipClient.executeRoute({
67+
route,
68+
userAddresses,
69+
onTransactionSuccess: async (txHash, chainID) => {
70+
const explorerLink = getExplorerLinkForTx(chainID, txHash);
7371

7472
onTxSuccess(
7573
{
7674
explorerLink,
77-
txHash: sendTx.txHash,
75+
txHash,
7876
},
7977
i,
8078
);

0 commit comments

Comments
 (0)