-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(aepp)!: add api to ask wallet to select network
BREAKING CHANGE: AeSdkWallet requires `onAskToSelectNetwork` constructor option Provide a function throwing `RpcMethodNotFoundError` if you don't want to support network change by aepp.
- Loading branch information
Showing
12 changed files
with
185 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<template> | ||
<h2>Select network</h2> | ||
<div class="group"> | ||
<div> | ||
<div>Select by</div> | ||
<div> | ||
<label> | ||
<input | ||
type="radio" | ||
value="networkId" | ||
v-model="mode" | ||
> | ||
Network ID | ||
</label> | ||
<label> | ||
<input | ||
type="radio" | ||
value="nodeUrl" | ||
v-model="mode" | ||
> | ||
Node URL | ||
</label> | ||
</div> | ||
</div> | ||
<div> | ||
<div>Payload</div> | ||
<div> | ||
<input | ||
v-model="payload" | ||
placeholder="Network ID or node URL" | ||
> | ||
</div> | ||
</div> | ||
<button @click="() => { promise = selectNetwork(); }"> | ||
Select network | ||
</button> | ||
<div v-if="promise"> | ||
<div>Select network result</div> | ||
<Value :value="promise" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex'; | ||
import Value from './Value.vue'; | ||
export default { | ||
components: { Value }, | ||
props: { | ||
select: { type: Function, required: true }, | ||
}, | ||
data: () => ({ | ||
mode: 'networkId', | ||
payload: 'ae_mainnet', | ||
promise: null, | ||
}), | ||
methods: { | ||
async selectNetwork() { | ||
await this.select({ [this.mode]: this.payload }); | ||
return 'Accepted by wallet'; | ||
}, | ||
}, | ||
}; | ||
</script> |
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
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
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
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