Skip to content

Commit

Permalink
refactor(aepp)!: remove select option in connectToWallet
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Select option removed from connectToWallet
If you are using `connectNode` then the current node would always be the same as wallet provides.
  • Loading branch information
davidyuk committed Mar 28, 2023
1 parent 20607c9 commit adf9c3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/AeSdkAepp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ export default class AeSdkAepp extends AeSdkBase {
*/
async connectToWallet(
connection: BrowserConnection,
{ connectNode = false, name = 'wallet-node', select = false }:
{ connectNode?: boolean; name?: string; select?: boolean } = {},
{ connectNode = false, name = 'wallet-node' }: { connectNode?: boolean; name?: string } = {},
): Promise<WalletInfo> {
if (this.rpcClient != null) throw new AlreadyConnectedError('You are already connected to wallet');
let disconnectParams: any;
Expand Down Expand Up @@ -125,7 +124,7 @@ export default class AeSdkAepp extends AeSdkBase {
.request(METHODS.connect, { name: this.name, version: RPC_VERSION, connectNode });
if (connectNode) {
if (node == null) throw new RpcConnectionError('Missing URLs of the Node');
this.addNode(name, new Node(node.url), select);
this.addNode(name, new Node(node.url), true);
}
this.rpcClient = client;
return walletInfo;
Expand Down
2 changes: 1 addition & 1 deletion test/integration/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ describe('Aepp<->Wallet', function aeppWallet() {
wallet.addRpcClient(connectionFromWalletToAepp);
await aepp.connectToWallet(
connectionFromAeppToWallet,
{ connectNode: true, name: 'wallet-node', select: true },
{ connectNode: true, name: 'wallet-node' },
);
});

Expand Down

0 comments on commit adf9c3e

Please sign in to comment.