aeternity / aepp-components

deprecated: aepp-components to be used in all aepps.
ISC License
41 stars 14 forks source link

base58check as a directive in the component library #199

Open sadiqevani opened 6 years ago

sadiqevani commented 6 years ago

base58check as a directive in the component library

davidyuk commented 6 years ago

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>
edwarddikgale commented 6 years ago

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

sadiqevani commented 6 years ago

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

sadiqevani commented 6 years ago

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.

davidyuk commented 6 years ago

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

sadiqevani commented 5 years ago

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.