Skip to content

Commit

Permalink
Merge pull request #4 from gagdiez/singleAccount
Browse files Browse the repository at this point in the history
chore: specify which contract is allowed to be logged-in
  • Loading branch information
gagdiez authored May 17, 2024
2 parents 6c3e315 + 5ce6234 commit f7956b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changelog

## TBD
- Made optional to logout the wallet selector when connecting to a contract different from `config.contractName`
- Allow the wallet selector to connect to an extra contract besides `config.contractName`

- To enable this feature, pass the allowOtherContracts flag to the config parameter of initNear: `initNear({networkId, selector, config: { allowOtherContracts: true }} )`
- To enable this feature, pass the allowExternalContract flag to the config parameter of initNear: `initNear({networkId, selector, config: { allowExternalContract: 'hello.near-examples.near' }} )`

- This feature is disabled by default to keep retrocompatibility

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions dist/index.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/

/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
2 changes: 1 addition & 1 deletion src/lib/data/account.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function updateAccount(near, walletState) {
if (
near.connectedContractId &&
near.connectedContractId !== near.config.contractName &&
!near.config.allowOtherContracts
near.connectedContractId !== near.config.allowExternalContract
) {
const selector = await near.selector;
const wallet = await selector.wallet();
Expand Down

0 comments on commit f7956b1

Please sign in to comment.