-
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.
Merge pull request #1867 from aeternity/feature/delegation-over-aepp-…
…wallet Delegation signature over aepp-wallet connection
- Loading branch information
Showing
16 changed files
with
497 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,68 @@ | ||
<template> | ||
<h2>Sign delegation to contract</h2> | ||
<div class="group"> | ||
<div> | ||
<div>Contract address</div> | ||
<div><input v-model="contractAddress"></div> | ||
</div> | ||
<div> | ||
<label> | ||
<input v-model="type" type="radio" value="general"> | ||
AENS and oracle | ||
</label> | ||
</div> | ||
<div> | ||
<label> | ||
<input v-model="type" type="radio" value="name"> | ||
AENS name | ||
</label> | ||
<div><input v-model="name"></div> | ||
</div> | ||
<div> | ||
<label> | ||
<input v-model="type" type="radio" value="oracle-query"> | ||
Oracle query | ||
</label> | ||
<div><input v-model="oracleQueryId"></div> | ||
</div> | ||
<button @click="signPromise = sign()"> | ||
Sign | ||
</button> | ||
<div v-if="signPromise"> | ||
<div>Signature</div> | ||
<Value :value="signPromise" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex'; | ||
import Value from './components/Value.vue'; | ||
export default { | ||
components: { Value }, | ||
data: () => ({ | ||
type: 'general', | ||
contractAddress: 'ct_6y3N9KqQb74QsvR9NrESyhWeLNiA9aJgJ7ua8CvsTuGot6uzh', | ||
name: 'test.chain', | ||
oracleQueryId: 'oq_6y3N9KqQb74QsvR9NrESyhWeLNiA9aJgJ7ua8CvsTuGot6uzh', | ||
signPromise: null, | ||
}), | ||
computed: mapState(['aeSdk']), | ||
methods: { | ||
sign() { | ||
switch (this.type) { | ||
case 'general': | ||
return this.aeSdk.signDelegationToContract(this.contractAddress); | ||
case 'name': | ||
return this.aeSdk.signNameDelegationToContract(this.contractAddress, this.name); | ||
case 'oracle-query': | ||
return this.aeSdk | ||
.signOracleQueryDelegationToContract(this.contractAddress, this.oracleQueryId); | ||
default: | ||
throw new Error(`Unknown delegation signature type: ${this.type}`) | ||
} | ||
}, | ||
}, | ||
}; | ||
</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
Oops, something went wrong.