-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add aptos connect * use AC version 0.0.6 * update aptos connect to latest
- Loading branch information
Showing
7 changed files
with
179 additions
and
31 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,6 @@ | ||
--- | ||
"@aptos-labs/wallet-adapter-core": minor | ||
"@aptos-labs/wallet-adapter-nextjs-example": minor | ||
--- | ||
|
||
Add AptosConnect |
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
23 changes: 19 additions & 4 deletions
23
packages/wallet-adapter-core/src/AIP62StandardWallets/sdkWallets.ts
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 |
---|---|---|
@@ -1,10 +1,25 @@ | ||
import { TWallet } from "@atomrigslab/aptos-wallet-adapter"; | ||
import { DevTWallet, TWallet } from "@atomrigslab/aptos-wallet-adapter"; | ||
import { AptosConnectWallet } from "@aptos-connect/wallet-adapter-plugin"; | ||
import { AptosStandardWallet } from "./WalletStandard"; | ||
import { Network } from "@aptos-labs/ts-sdk"; | ||
|
||
const isProd = process.env.NODE_ENV === "production"; | ||
|
||
const sdkWallets: AptosStandardWallet[] = []; | ||
|
||
// TODO twallet uses @aptos-labs/wallet-standard at version 0.0.11 while adapter uses | ||
// a newer version (0.1.0) - this causes type mismatch. We should figure out how to handle it. | ||
sdkWallets.push(new TWallet() as any); | ||
// Push production wallet if env is production, otherwise use dev wallet | ||
if (isProd) { | ||
// TODO twallet uses @aptos-labs/wallet-standard at version 0.0.11 while adapter uses | ||
// a newer version (0.1.0) - this causes type mismatch. We should figure out how to handle it. | ||
sdkWallets.push(new TWallet() as any); | ||
} else { | ||
sdkWallets.push(new DevTWallet() as any); | ||
} | ||
|
||
let aptosNetwork = isProd ? Network.MAINNET : Network.TESTNET; | ||
// Need to check window is defined for AptosConnect | ||
if (typeof window !== "undefined") { | ||
sdkWallets.push(new AptosConnectWallet({ network: aptosNetwork })); | ||
} | ||
|
||
export default sdkWallets; |
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
Oops, something went wrong.