Skip to content

Commit

Permalink
feat: add wagmi
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff-CCH committed Sep 10, 2024
1 parent e0e78b7 commit 11e909f
Show file tree
Hide file tree
Showing 22 changed files with 4,623 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-papayas-breathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': minor
---

add wagmi
2 changes: 1 addition & 1 deletion .env.iota.pb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
CHAIN_ID=8822
BLOCK_NUMBER=292100
BLOCK_NUMBER=1126425
HTTP_RPC_URL=https://json-rpc.evm.iotaledger.net
1 change: 1 addition & 0 deletions src/logics/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export * as stargatev2 from './stargate-v2';
export * as syncswap from './syncswap';
export * as uniswapv3 from './uniswap-v3';
export * as utility from './utility';
export * as wagmi from './wagmi';
export * as zeroexv4 from './zeroex-v4';
18 changes: 18 additions & 0 deletions src/logics/uniswap-v3/logic.swap-token.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { FeeAmount, computePoolAddress } from '@uniswap/v3-sdk';
import { Token } from '@uniswap/sdk-core';
import { TokenList } from '@uniswap/token-lists';
import { axios } from 'src/utils';
import * as common from '@protocolink/common';
Expand Down Expand Up @@ -39,4 +41,20 @@ export class SwapTokenLogic

return tokenList;
}

public async computePoolAddress({
factoryAddress,
tokenA,
tokenB,
fee,
initCodeHashManualOverride,
}: {
factoryAddress: string;
tokenA: Token;
tokenB: Token;
fee: FeeAmount;
initCodeHashManualOverride?: string | undefined;
}): Promise<string> {
return computePoolAddress({ factoryAddress, tokenA, tokenB, fee, initCodeHashManualOverride });
}
}
Loading

0 comments on commit 11e909f

Please sign in to comment.