-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: use usdt abi for usdt transactions (#2920)
- Loading branch information
1 parent
4bed7b9
commit eeb9207
Showing
7 changed files
with
129 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
'@reown/appkit-common': patch | ||
'@reown/appkit-core': patch | ||
'@apps/demo': patch | ||
'@apps/gallery': patch | ||
'@apps/laboratory': patch | ||
'@examples/html-ethers': patch | ||
'@examples/html-ethers5': patch | ||
'@examples/html-wagmi': patch | ||
'@examples/next-ethers': patch | ||
'@examples/next-wagmi': patch | ||
'@examples/react-ethers': patch | ||
'@examples/react-ethers5': patch | ||
'@examples/react-solana': patch | ||
'@examples/react-wagmi': patch | ||
'@examples/vue-ethers5': patch | ||
'@examples/vue-solana': patch | ||
'@examples/vue-wagmi': patch | ||
'@reown/appkit-adapter-ethers': patch | ||
'@reown/appkit-adapter-ethers5': patch | ||
'@reown/appkit-adapter-polkadot': patch | ||
'@reown/appkit-adapter-solana': patch | ||
'@reown/appkit-adapter-wagmi': patch | ||
'@reown/appkit': patch | ||
'@reown/appkit-utils': patch | ||
'@reown/appkit-cdn': patch | ||
'@reown/appkit-ethers': patch | ||
'@reown/appkit-ethers5': patch | ||
'@reown/appkit-polyfills': patch | ||
'@reown/appkit-scaffold-ui': patch | ||
'@reown/appkit-siwe': patch | ||
'@reown/appkit-solana': patch | ||
'@reown/appkit-ui': patch | ||
'@reown/appkit-wagmi': patch | ||
'@reown/appkit-wallet': patch | ||
--- | ||
|
||
fix: use usdt abi for usdt transactions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
export const usdtABI = [ | ||
{ | ||
type: 'function', | ||
name: 'transfer', | ||
stateMutability: 'nonpayable', | ||
inputs: [ | ||
{ | ||
name: 'recipient', | ||
type: 'address' | ||
}, | ||
{ | ||
name: 'amount', | ||
type: 'uint256' | ||
} | ||
], | ||
outputs: [] | ||
}, | ||
{ | ||
type: 'function', | ||
name: 'transferFrom', | ||
stateMutability: 'nonpayable', | ||
inputs: [ | ||
{ | ||
name: 'sender', | ||
type: 'address' | ||
}, | ||
{ | ||
name: 'recipient', | ||
type: 'address' | ||
}, | ||
{ | ||
name: 'amount', | ||
type: 'uint256' | ||
} | ||
], | ||
outputs: [ | ||
{ | ||
name: '', | ||
type: 'bool' | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { erc20ABI } from '../contracts/erc20.js' | ||
import { usdtABI } from '../contracts/usdt.js' | ||
import { ConstantsUtil } from './ConstantsUtil.js' | ||
|
||
export const ContractUtil = { | ||
getERC20Abi: (tokenAddress: string) => { | ||
// @ts-expect-error Check if the address is a USDT contract | ||
if (ConstantsUtil.USDT_CONTRACT_ADDRESSES.includes(tokenAddress)) { | ||
return usdtABI | ||
} | ||
|
||
return erc20ABI | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters