The initNear takes a wallet selector as input. Currently, if the wallet selector creates a function access key for a contract that is not the SocialDB (for example, the user wants to login to use hello.near-examples.testnet, the following lines will logOut the user:
|
near.connectedContractId = walletState?.contract?.contractId; |
|
if ( |
|
near.connectedContractId && |
|
near.connectedContractId !== near.config.contractName |
|
) { |
|
const selector = await near.selector; |
|
const wallet = await selector.wallet(); |
|
await wallet.signOut(); |
|
near.connectedContractId = null; |
|
walletState = selector.store.getState(); |
|
} |
This is because the VM is checking if the selector being used is connected to the socialDB, and otherwise calling wallet.signOut
I would expect people to mix interactions with the VM with interactions to other contracts. In fact, I discovered this problem while trying to create a Hello World example that can talk with both BOS components, and a simple hello world smart contract.
The
initNeartakes awallet selectoras input. Currently, if the wallet selector creates afunction access keyfor a contract that is not the SocialDB (for example, the user wants to login to usehello.near-examples.testnet, the following lines will logOut the user:VM/src/lib/data/account.js
Lines 22 to 32 in 8dbb065
This is because the VM is checking if the selector being used is connected to the
socialDB, and otherwise callingwallet.signOutI would expect people to mix interactions with the VM with interactions to other contracts. In fact, I discovered this problem while trying to create a
Hello Worldexample that can talk with bothBOS components, and a simplehello worldsmart contract.