Skip to content

Commit

Permalink
Remove unused constructor options
Browse files Browse the repository at this point in the history
  • Loading branch information
yasincaliskan committed May 6, 2024
1 parent 4217f7d commit a1315cc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 28 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ try {
| option | default | value | |
| ------------------------ | ------- | ------------------------------------- | -------- |
| `chainId` | `4160` | `416001`, `416002`, `416003` , `4160` | optional |
| `projectId` | `undefined` | `string \| undefined` | optional |
| `shouldShowSignTxnToast` | `true` | `boolean` | optional |
| `compactMode` | `false` | `boolean` | optional |
Expand All @@ -108,6 +109,11 @@ Determines which Algorand network your dApp uses.
**All Networks**: 4160
#### **`projectId`**
This parameter is optional but strongly recommended to prevent malicious use of your project ID. Learn more on [Wallet Connect Docs](https://docs.walletconnect.com/cloud/relay).
#### **`shouldShowSignTxnToast`**
<img width="422" alt="Group 48096937" src="https://user-images.githubusercontent.com/54077855/202682828-9ac57b62-58c1-4a83-af3b-e1b7ffad2d89.png">
Expand Down
18 changes: 1 addition & 17 deletions src/PeraWalletConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import {
formatJsonRpcRequest
} from "./util/transaction/transactionUtils";
import {detectBrowser, isMobile} from "./util/device/deviceUtils";
import {AlgorandChainIDs, AppMeta, PeraWalletNetwork} from "./util/peraWalletTypes";
import {AlgorandChainIDs, PeraWalletNetwork} from "./util/peraWalletTypes";
import {runWebSignTransactionFlow} from "./util/sign/signTransactionFlow";
import {PERA_WALLET_LOCAL_STORAGE_KEYS} from "./util/storage/storageConstants";
import {getPeraWebWalletURL} from "./util/peraWalletConstants";
Expand All @@ -44,8 +44,6 @@ import {generateEmbeddedWalletURL} from "./util/peraWalletUtils";

interface PeraWalletConnectOptions {
projectId?: string;
deep_link?: string;
app_meta?: AppMeta;
network?: PeraWalletNetwork;
shouldShowSignTxnToast?: boolean;
chainId?: AlgorandChainIDs;
Expand All @@ -62,20 +60,6 @@ class PeraWalletConnect {
compactMode?: boolean;

constructor(options: PeraWalletConnectOptions) {
if (options?.deep_link) {
getLocalStorage()?.setItem(
PERA_WALLET_LOCAL_STORAGE_KEYS.DEEP_LINK,
options.deep_link
);
}

if (options?.app_meta) {
getLocalStorage()?.setItem(
PERA_WALLET_LOCAL_STORAGE_KEYS.APP_META,
JSON.stringify(options.app_meta)
);
}

if (options?.network) {
this.network = options.network;
}
Expand Down
10 changes: 1 addition & 9 deletions src/util/peraWalletTypes.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
interface AppMeta {
logo: string;
name: string;
main_color: string;
}


type PeraWalletNetwork = "dev" | "testnet" | "mainnet";
type PeraWalletType = "pera-wallet" | "pera-wallet-web";
type PeraWalletPlatformType = "mobile" | "web" | null;
Expand All @@ -26,6 +19,5 @@ export type {
PeraWalletDetails,
AlgorandChainIDs,
PeraWalletFlowType,
PeraWalletNetwork,
AppMeta
PeraWalletNetwork
};
2 changes: 0 additions & 2 deletions src/util/storage/storageConstants.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const PERA_WALLET_LOCAL_STORAGE_KEYS = {
WALLET: "PeraWallet.Wallet",
DEEP_LINK: "PeraWallet.DeepLink",
APP_META: "PeraWallet.AppMeta",
NETWORK: "PeraWallet.Network",
WALLETCONNECT: "walletconnect"
};
Expand Down

0 comments on commit a1315cc

Please sign in to comment.