-
Notifications
You must be signed in to change notification settings - Fork 155
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 #687 from near/dev
v7.7.0 Release (dev -> main)
- Loading branch information
Showing
91 changed files
with
1,597 additions
and
265 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 |
---|---|---|
@@ -1,12 +1,11 @@ | ||
<main> | ||
<h1>NEAR Guest Book</h1> | ||
<near-wallet-selector-content | ||
*ngIf="!!selector" | ||
[selector]="selector" | ||
[accounts]="accounts" | ||
[accountId]="accountId" | ||
[modal]="modal" | ||
> | ||
</near-wallet-selector-content> | ||
<div class="title-container"> | ||
<h1>{{showImport ? "Export Account" : "NEAR Guest Book"}}</h1> | ||
<button (click)="showImport = !showImport" > | ||
{{showImport ? "Back to Log in" : "Try Export Account"}} | ||
</button> | ||
</div> | ||
<near-wallet-selector-wallet-selector *ngIf="!showImport"></near-wallet-selector-wallet-selector> | ||
<near-wallet-selector-wallet-selector-export *ngIf="showImport"></near-wallet-selector-wallet-selector-export> | ||
</main> | ||
|
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,112 +1,10 @@ | ||
import type { OnInit } from "@angular/core"; | ||
import { Component } from "@angular/core"; | ||
import type { WalletSelector, AccountState } from "@near-wallet-selector/core"; | ||
import { setupWalletSelector } from "@near-wallet-selector/core"; | ||
import { setupDefaultWallets } from "@near-wallet-selector/default-wallets"; | ||
import { setupSender } from "@near-wallet-selector/sender"; | ||
import { setupXDEFI } from "@near-wallet-selector/xdefi"; | ||
import { setupNearFi } from "@near-wallet-selector/nearfi"; | ||
import { setupMathWallet } from "@near-wallet-selector/math-wallet"; | ||
import { setupNightly } from "@near-wallet-selector/nightly"; | ||
import { setupMeteorWallet } from "@near-wallet-selector/meteor-wallet"; | ||
import { setupNarwallets } from "@near-wallet-selector/narwallets"; | ||
import { setupWelldoneWallet } from "@near-wallet-selector/welldone-wallet"; | ||
import { setupNightlyConnect } from "@near-wallet-selector/nightly-connect"; | ||
import { setupWalletConnect } from "@near-wallet-selector/wallet-connect"; | ||
import { setupCoin98Wallet } from "@near-wallet-selector/coin98-wallet"; | ||
import { setupHereWallet } from "@near-wallet-selector/here-wallet"; | ||
import { setupNeth } from "@near-wallet-selector/neth"; | ||
import { setupOptoWallet } from "@near-wallet-selector/opto-wallet"; | ||
import { setupNearWallet } from "@near-wallet-selector/near-wallet"; | ||
// import { setupModal } from "@near-wallet-selector/modal-ui"; | ||
// import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui"; | ||
import { setupModal } from "@near-wallet-selector/modal-ui-js"; | ||
import type { WalletSelectorModal } from "@near-wallet-selector/modal-ui-js"; | ||
import { CONTRACT_ID } from "../constants"; | ||
|
||
declare global { | ||
interface Window { | ||
selector: WalletSelector; | ||
modal: WalletSelectorModal; | ||
} | ||
} | ||
|
||
@Component({ | ||
selector: "near-wallet-selector-root", | ||
templateUrl: "./app.component.html", | ||
styleUrls: ["./app.component.scss"], | ||
}) | ||
export class AppComponent implements OnInit { | ||
selector: WalletSelector; | ||
modal: WalletSelectorModal; | ||
accountId: string | null; | ||
accounts: Array<AccountState> = []; | ||
|
||
async ngOnInit() { | ||
await this.initialize().catch((err) => { | ||
console.error(err); | ||
alert("Failed to initialise wallet selector"); | ||
}); | ||
} | ||
|
||
async initialize() { | ||
const _selector = await setupWalletSelector({ | ||
network: "testnet", | ||
debug: true, | ||
modules: [ | ||
...(await setupDefaultWallets()), | ||
setupNearWallet(), | ||
setupSender(), | ||
setupXDEFI(), | ||
setupMathWallet(), | ||
setupNightly(), | ||
setupMeteorWallet(), | ||
setupNarwallets(), | ||
setupWelldoneWallet(), | ||
setupHereWallet(), | ||
setupCoin98Wallet(), | ||
setupNearFi(), | ||
setupNeth({ | ||
bundle: false, | ||
}), | ||
setupOptoWallet(), | ||
setupWalletConnect({ | ||
projectId: "c4f79cc...", | ||
metadata: { | ||
name: "NEAR Wallet Selector", | ||
description: "Example dApp used by NEAR Wallet Selector", | ||
url: "https://github.com/near/wallet-selector", | ||
icons: ["https://avatars.githubusercontent.com/u/37784886"], | ||
}, | ||
}), | ||
setupNightlyConnect({ | ||
url: "wss://relay.nightly.app/app", | ||
appMetadata: { | ||
additionalInfo: "", | ||
application: "NEAR Wallet Selector", | ||
description: "Example dApp used by NEAR Wallet Selector", | ||
icon: "https://near.org/wp-content/uploads/2020/09/cropped-favicon-192x192.png", | ||
}, | ||
}), | ||
], | ||
}); | ||
|
||
const _modal = setupModal(_selector, { | ||
contractId: CONTRACT_ID, | ||
onHide: (hideReason) => { | ||
console.log("The reason for hiding modal: ", hideReason); | ||
}, | ||
}); | ||
const state = _selector.store.getState(); | ||
|
||
this.accounts = state.accounts; | ||
this.accountId = | ||
state.accounts.find((account) => account.active)?.accountId || null; | ||
|
||
window.selector = _selector; | ||
window.modal = _modal; | ||
|
||
this.selector = _selector; | ||
this.modal = _modal; | ||
} | ||
export class AppComponent { | ||
showImport: boolean; | ||
} |
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
6 changes: 6 additions & 0 deletions
6
examples/angular/src/app/components/loading/loading.component.html
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 @@ | ||
<div class="lds-ellipsis"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> |
56 changes: 56 additions & 0 deletions
56
examples/angular/src/app/components/loading/loading.component.scss
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,56 @@ | ||
.lds-ellipsis { | ||
position: relative; | ||
width: 80px; | ||
height: 80px; | ||
margin: auto; | ||
} | ||
.lds-ellipsis div { | ||
position: absolute; | ||
top: 33px; | ||
width: 13px; | ||
height: 13px; | ||
border-radius: 50%; | ||
background: var(--fg); | ||
animation-timing-function: cubic-bezier(0, 1, 1, 0); | ||
|
||
} | ||
.lds-ellipsis div:nth-child(1) { | ||
left: 8px; | ||
animation: lds-ellipsis1 0.6s infinite; | ||
} | ||
.lds-ellipsis div:nth-child(2) { | ||
left: 8px; | ||
animation: lds-ellipsis2 0.6s infinite; | ||
} | ||
.lds-ellipsis div:nth-child(3) { | ||
left: 32px; | ||
animation: lds-ellipsis2 0.6s infinite; | ||
} | ||
.lds-ellipsis div:nth-child(4) { | ||
left: 56px; | ||
animation: lds-ellipsis3 0.6s infinite; | ||
} | ||
@keyframes lds-ellipsis1 { | ||
0% { | ||
transform: scale(0); | ||
} | ||
100% { | ||
transform: scale(1); | ||
} | ||
} | ||
@keyframes lds-ellipsis3 { | ||
0% { | ||
transform: scale(1); | ||
} | ||
100% { | ||
transform: scale(0); | ||
} | ||
} | ||
@keyframes lds-ellipsis2 { | ||
0% { | ||
transform: translate(0, 0); | ||
} | ||
100% { | ||
transform: translate(24px, 0); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
examples/angular/src/app/components/loading/loading.component.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { Component } from "@angular/core"; | ||
|
||
@Component({ | ||
selector: "near-wallet-selector-loading", | ||
templateUrl: "./loading.component.html", | ||
styleUrls: ["./loading.component.scss"], | ||
}) | ||
export class LoadingComponent {} |
11 changes: 11 additions & 0 deletions
11
examples/angular/src/app/pages/wallet-selector-export/wallet-selector-export.component.html
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,11 @@ | ||
<near-wallet-selector-loading *ngIf="!exportModal || !exportSelector"></near-wallet-selector-loading> | ||
<div *ngIf="exportModal || exportSelector"> | ||
<button (click)="show()">Open Modal</button> | ||
<p> | ||
The Export Accounts modal assists users in migrating their accounts to | ||
any Wallet Selector wallet supporting account imports. Any sensitive | ||
data in transit during this process will be encrypted with a | ||
randomly-generated password which the user will be required to copy down | ||
and use in the account import process on the target wallet. | ||
</p> | ||
</div> |
Empty file.
Oops, something went wrong.