Skip to content

Commit

Permalink
Merge pull request #559 from torusresearch/develop
Browse files Browse the repository at this point in the history
Release v2.1.0
  • Loading branch information
chaitanyapotti authored Jun 8, 2023
2 parents 1a2a705 + 2531937 commit 5e1668a
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 33 deletions.
4 changes: 0 additions & 4 deletions examples/angular-example/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,6 @@ export class AppComponent {
const { buildEnv, chainIdNetworkMap, chainId } = this;
await torus.init({
buildEnv,
enabledVerifiers: {
reddit: false,
},
enableLogging: true,
network: {
host: chainIdNetworkMap[chainId.toString()], // mandatory
Expand Down Expand Up @@ -121,7 +118,6 @@ export class AppComponent {
}
: undefined,
whiteLabel: whiteLabelData,
skipTKey: true,
});
await torus.login(); // await torus.ethereum.enable()
sessionStorage.setItem("pageUsingTorus", buildEnv);
Expand Down
4 changes: 0 additions & 4 deletions examples/next-app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ export default function Home() {
const { torus, web3 } = web3Obj;
await torus.init({
buildEnv,
enabledVerifiers: {
reddit: false,
},
enableLogging: true,
network: {
host: chainIdNetworkMap[chainId.toString()], // mandatory
Expand Down Expand Up @@ -89,7 +86,6 @@ export default function Home() {
}
: undefined,
whiteLabel: whiteLabelData,
skipTKey: true,
});
await torus.login(); // await torus.ethereum.enable()
sessionStorage.setItem("pageUsingTorus", buildEnv);
Expand Down
4 changes: 0 additions & 4 deletions examples/react-basic-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class App extends React.Component {
const { buildEnv, chainIdNetworkMap, chainId } = this.state;
await torus.init({
buildEnv,
enabledVerifiers: {
reddit: false,
},
enableLogging: true,
network: {
host: chainIdNetworkMap[chainId.toString()], // mandatory
Expand All @@ -70,7 +67,6 @@ class App extends React.Component {
},
} : undefined,
whiteLabel: whiteLabelData,
skipTKey: true,
});
const acc = await torus.login(); // await torus.ethereum.enable()
console.log('acc', acc);
Expand Down
7 changes: 0 additions & 7 deletions examples/vue-app/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,6 @@ export default Vue.extend({
await torus?.init({
useWalletConnect: true,
buildEnv: this.buildEnv,
enabledVerifiers: {
reddit: false,
},
enableLogging: true,
network: {
host: this.chainIdNetworkMap[this.chainId], // mandatory
Expand Down Expand Up @@ -220,9 +217,6 @@ export default Vue.extend({
(window as any).torus = torus;
await torus?.init({
buildEnv: this.buildEnv,
enabledVerifiers: {
reddit: false,
},
enableLogging: true,
network: {
host: this.chainIdNetworkMap[this.chainId], // mandatory
Expand All @@ -242,7 +236,6 @@ export default Vue.extend({
// },
loginConfig: this.buildEnv === "lrc" || this.buildEnv === "development" ? loginConfig : undefined,
whiteLabel: useWhitelabel ? whiteLabelData : undefined,
skipTKey: true,
mfaLevel: "optional",
});
await torus?.login(); // await torus.ethereum.enable()
Expand Down
86 changes: 73 additions & 13 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,32 @@ const paymentProviders = {
{ value: "mkr", display: "MKR" },
{ value: "matic", display: "MATIC" },
{ value: "usdt", display: "USDT" },
{ value: "uni", display: "UNI" },
{ value: "usdc", display: "USDC" },
{ value: "weth", display: "WETH" },
],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [
{ value: "eth_polygon", display: "ETH" },
{ value: "matic_polygon", display: "MATIC" },
{ value: "usdc_polygon", display: "USDC" },
{ value: "usdt_polygon", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.BSC_MAINNET]: [
{ value: "bnb_bsc", display: "BNB" },
{ value: "busd_bsc", display: "BUSD" },
],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [{ value: "avax_cchain", display: "AVAX" }],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [
{ value: "avax_cchain", display: "AVAX" },
{ value: "usdc_cchain", display: "USDC" },
],
[SUPPORTED_PAYMENT_NETWORK.ARBITRUM_MAINNET]: [
{ value: "eth_arbitrum", display: "ETH" },
{ value: "usdc_arbitrum", display: "USDC" },
],
[SUPPORTED_PAYMENT_NETWORK.OPTIMISM_MAINNET]: [
{ value: "eth_optimism", display: "ETH" },
{ value: "usdc_optimism", display: "USDC" },
],
},
includeFees: true,
api: true,
Expand All @@ -47,18 +61,31 @@ const paymentProviders = {
validCryptoCurrenciesByChain: {
[SUPPORTED_PAYMENT_NETWORK.MAINNET]: [
{ value: "AAVE", display: "AAVE" },
{ value: "COMP", display: "COMP" },
{ value: "BAT", display: "BAT" },
{ value: "BUSD", display: "BUSD" },
{ value: "DAI", display: "DAI" },
{ value: "ETH", display: "ETH" },
{ value: "WBTC", display: "WBTC" },
{ value: "MKR", display: "MKR" },
{ value: "UNI", display: "UNI" },
{ value: "WETH", display: "WETH" },
{ value: "USDC", display: "USDC" },
{ value: "USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [{ value: "MUSDC", display: "USDC" }],
// AVAXC? or AVAX?
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [{ value: "AVAXC", display: "AVAXC" }],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [
{ value: "mUSDC", display: "USDC" },
{ value: "MATIC", display: "MATIC" },
{ value: "MWETH", display: "WETH" },
],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [
{ value: "AVAXC", display: "AVAX" },
{ value: "AVAXCUSDC", display: "USDC" },
],
[SUPPORTED_PAYMENT_NETWORK.BSC_MAINNET]: [
{ value: "BNB", display: "BNB" },
{ value: "BBUSD", display: "BUSD" },
],
},
includeFees: false,
api: true,
Expand All @@ -76,18 +103,37 @@ const paymentProviders = {
[SUPPORTED_PAYMENT_NETWORK.MAINNET]: [
{ value: "ETH", display: "ETH" },
{ value: "DAI", display: "DAI" },
{ value: "BAT", display: "BAT" },
{ value: "USDC", display: "USDC" },
{ value: "USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [
{ value: "MATIC_BAT", display: "BAT" },
{ value: "MATIC_DAI", display: "DAI" },
{ value: "MATIC_MATIC", display: "MATIC" },
{ value: "MATIC_USDC", display: "USDC" },
{ value: "MATIC_USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [
{ value: "AVAX_AVAX", display: "AVAX" },
{ value: "AVAX_USDC", display: "USDC" },
{ value: "AVAX_USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.ARBITRUM_MAINNET]: [
{ value: "ARBITRUM_ETH", display: "ETH" },
{ value: "ARBITRUM_USDC.e ", display: "USDC" },
{ value: "ARBITRUM_USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.OPTIMISM_MAINNET]: [
{ value: "OPTIMISM_DAI", display: "DAI" },
{ value: "OPTIMISM_OPTIMISM", display: "OPTIMISM" },
{ value: "OPTIMISM_USDC", display: "USDC" },
{ value: "OPTIMISM_USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.BSC_MAINNET]: [
{ value: "BSC_BNB", display: "BNB" },
{ value: "BSC_BUSD", display: "BUSD" },
],
// what about AVAXC?
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [{ value: "AVAX", display: "AVAX" }],
// Temporary unavailable
// [SUPPORTED_PAYMENT_NETWORK.XDAI]: [{ value: 'XDAI_XDAI', display: 'XDAI' }],
},
includeFees: true,
api: true,
Expand All @@ -106,6 +152,7 @@ const paymentProviders = {
[SUPPORTED_PAYMENT_NETWORK.MAINNET]: [
{ value: "ETH", display: "ETH" },
{ value: "USDT", display: "USDT" },
{ value: "USDC", display: "USDC" },
],
},
includeFees: true,
Expand Down Expand Up @@ -133,6 +180,8 @@ const paymentProviders = {
{ value: "BUSD", display: "BUSD" },
{ value: "1INCH", display: "1INCH" },
],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [{ value: "AVAX", display: "AVAX" }],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [{ value: "MATIC", display: "MATIC" }],
},
includeFees: true,
api: true,
Expand All @@ -148,13 +197,16 @@ const paymentProviders = {
validCurrencies: supportedFiatCurrencies(PAYMENT_PROVIDER.TRANSAK),
validCryptoCurrenciesByChain: {
[SUPPORTED_PAYMENT_NETWORK.MAINNET]: [
{ value: "1INCH", display: "1INCH" },
{ value: "BAT", display: "BAT" },
{ value: "AAVE", display: "AAVE" },
{ value: "DAI", display: "DAI" },
{ value: "ETH", display: "ETH" },
{ value: "USDC", display: "USDC" },
{ value: "USDT", display: "USDT" },
],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [
{ value: "BAT", display: "BAT" },
{ value: "AAVE", display: "AAVE" },
{ value: "DAI", display: "DAI" },
{ value: "MATIC", display: "MATIC" },
Expand All @@ -163,10 +215,19 @@ const paymentProviders = {
{ value: "WETH", display: "WETH" },
],
[SUPPORTED_PAYMENT_NETWORK.BSC_MAINNET]: [
{ value: "BAT", display: "BAT" },
{ value: "BNB", display: "BNB" },
{ value: "BUSD", display: "BUSD" },
],
[SUPPORTED_PAYMENT_NETWORK.AVALANCHE_MAINNET]: [{ value: "AVAX", display: "AVAX" }],
[SUPPORTED_PAYMENT_NETWORK.OPTIMISM_MAINNET]: [
{ value: "ETH", display: "ETH" },
{ value: "USDC", display: "USDC" },
],
[SUPPORTED_PAYMENT_NETWORK.ARBITRUM_MAINNET]: [
{ value: "USDC", display: "USDC" },
{ value: "ETH", display: "ETH" },
],
},
includeFees: true,
enforceMax: true,
Expand All @@ -182,19 +243,18 @@ const paymentProviders = {
validCryptoCurrenciesByChain: {
[SUPPORTED_PAYMENT_NETWORK.MAINNET]: [
{ value: "ETH", display: "ETH" },
{ value: "DAI", display: "DAI" },
{ value: "MKR", display: "MKR" },
{ value: "USDT", display: "USDT" },
{ value: "BUSD", display: "BUSD" },
{ value: "LINK", display: "LINK" },
{ value: "USDC", display: "USDC" },
{ value: "CHZ", display: "CHZ" },
{ value: "BAT", display: "BAT" },
{ value: "MANA", display: "MANA" },
{ value: "AAVE", display: "AAVE" },
{ value: "COMP", display: "COMP" },
{ value: "ENJ", display: "ENJ" },
{ value: "UNI", display: "UNI" },
],
[SUPPORTED_PAYMENT_NETWORK.MATIC]: [{ value: "MATIC", display: "MATIC" }],
// [SUPPORTED_PAYMENT_NETWORK.BSC_MAINNET]: [{ value: "BNB", display: "BNB" }],
// [BSC_MAINNET]: [{ value: 'BNB', display: 'BNB' }],
},
includeFees: true,
enforceMax: true,
Expand Down
6 changes: 5 additions & 1 deletion src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const SUPPORTED_PAYMENT_NETWORK = {
BSC_MAINNET: "bsc_mainnet",
AVALANCHE_MAINNET: "avalanche_mainnet",
XDAI: "xdai",
ARBITRUM_MAINNET: "arbitrum_mainnet",
OPTIMISM_MAINNET: "optimism_mainnet",
} as const;

export const TORUS_BUILD_ENV = {
Expand Down Expand Up @@ -104,7 +106,9 @@ export type LOGIN_TYPE =
| "line"
| "jwt"
| "email_password"
| "passwordless";
| "passwordless"
| "wechat"
| "kakao";

export interface TorusCtorArgs {
/**
Expand Down
2 changes: 2 additions & 0 deletions src/supportedCurrencies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,7 @@ const PROVIDER_SUPPORTED_FIAT_CURRENCIES = {
"AUD",
"CAD",
"NZD",
"CNY",
"ARS",
"BRL",
"CHF",
Expand All @@ -373,6 +374,7 @@ const PROVIDER_SUPPORTED_FIAT_CURRENCIES = {
"PHP",
"PLN",
"SEK",
"SGD",
"THB",
"VND",
"ZAR",
Expand Down

0 comments on commit 5e1668a

Please sign in to comment.