-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from unstoppabledomains/qrtp/rpc-support-for-swap
add ERC-20 and RPC support required for successful Uniswap transactions
- Loading branch information
Showing
10 changed files
with
144 additions
and
71 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
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,19 @@ | ||
import {Web3} from "web3"; | ||
|
||
import config from "@unstoppabledomains/config"; | ||
import {getProviderUrl} from "@unstoppabledomains/ui-components/lib/wallet/evm/provider"; | ||
|
||
export const getWeb3Provider = (chainId: number) => { | ||
const chainSymbol = Object.keys(config.BLOCKCHAINS).find(k => { | ||
return ( | ||
config.BLOCKCHAINS[k as keyof typeof config.BLOCKCHAINS].CHAIN_ID === | ||
chainId | ||
); | ||
}); | ||
if (!chainSymbol) { | ||
throw new Error(`Configuration not found for chainId: ${chainId}`); | ||
} | ||
|
||
const providerUrl = getProviderUrl(chainSymbol); | ||
return new Web3(providerUrl); | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,7 @@ | ||
import {isAscii} from "./isAscii"; | ||
|
||
describe("isAscii", () => { | ||
it("returns true for ASCII text", () => { | ||
expect(isAscii("abc123")).toBeTruthy(); | ||
}); | ||
}); |
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
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