aepp-components icon indicating copy to clipboard operation
aepp-components copied to clipboard

base58check as a directive in the component library

Open sadiqevani opened this issue 7 years ago • 6 comments

base58check as a directive in the component library

sadiqevani avatar Oct 26 '18 10:10 sadiqevani

Maybe just to define filter? I don't think that changes in components are necessary:

<template>
  <div>
    {{ 'test' | encodeBase58Check }}
  </div>
</template>

<script>
import { Crypto } from '@aeternity/aepp-sdk/es';

export default {
  filters: {
    encodeBase58Check: data => Crypto.encodeBase58Check(Buffer.from(data)),
  },
};
</script>

davidyuk avatar Oct 29 '18 07:10 davidyuk

@davidyuk 's proposal is more re-usable solution because can be used in/with all kinds of tags....

edwarddikgale avatar Oct 29 '18 16:10 edwarddikgale

The problem is not to encode the address, but to decode it, and to verify that the address is a valid base58.

sadiqevani avatar Oct 29 '18 16:10 sadiqevani

Though the comment in there was just a rushed down idea while talking with Emil, so for now I have no actual solution on how to implement this check, i'll look into it this week.

sadiqevani avatar Oct 29 '18 16:10 sadiqevani

The problem is not to encode the address, but to decode it

You have not mentioned it, can you just use decodeBase58Check instead?

verify that the address is a valid base58

this issue is related: https://github.com/aeternity/aepp-sdk-js/issues/100

davidyuk avatar Oct 30 '18 04:10 davidyuk

You have not mentioned it, can you just use decodeBase58Check instead?

I'll check that out, when I have some time to work on aepp-components.

sadiqevani avatar Nov 08 '18 14:11 sadiqevani