Add short code (alias) #187

Open
opened 2024-11-27 10:43:18 +01:00 by willruddick · 7 comments
Owner

Autogenerate a unique alphanumeric short code for each user (e.g. bob1)
(this will eventually be tied to an ENS)
This should be editable on the Profile (must be unique and require pin to change)

This should be visible one the Home screen before balance:
bob1 balance: 200 MRV
menu....
z
People can send to the account using this shortcode (or phone number or blockchain address)

Autogenerate a unique alphanumeric short code for each user (e.g. bob1) (this will eventually be tied to an ENS) This should be editable on the Profile (must be unique and require pin to change) This should be visible one the Home screen before balance: bob1 balance: 200 MRV menu.... z People can send to the account using this shortcode (or phone number or blockchain address)
willruddick added the
Priority
High
label 2024-11-27 10:43:18 +01:00
kamikazechaser was assigned by willruddick 2024-11-27 10:43:18 +01:00

@willruddick Should it be truly random (but human readable) aliases? Like flyingcat56 ?

@willruddick Should it be truly random (but human readable) aliases? Like `flyingcat56` ?
kamikazechaser added the
ux
label 2024-11-27 10:57:44 +01:00
lash added the
Status
Need More Info
label 2024-11-27 20:35:24 +01:00
Owner

resolved by #207

resolved by https://git.grassecon.net/urdt/ussd/issues/207
lash added a new dependency 2024-12-11 12:29:59 +01:00
lash removed the
Status
Need More Info
label 2025-01-14 08:58:12 +01:00
kamikazechaser was unassigned by lash 2025-01-14 09:54:08 +01:00
carlos was assigned by lash 2025-01-14 09:54:08 +01:00
lash added the
Status
Blocked
label 2025-01-14 10:02:05 +01:00
Owner

@kamikazechaser need an API endpoint to get a guaranteed unique name from a provided string.

@kamikazechaser need an API endpoint to get a guaranteed unique name from a provided string.
carlos was unassigned by lash 2025-01-14 10:04:41 +01:00
Owner

RequestAlias(hint string, address string) (AliasResult,error) {

struct AliasResult {
result: string,
}

@lash mock this in sarafu-api

RequestAlias(hint string, address string) (AliasResult,error) { struct AliasResult { result: string, } @lash mock this in sarafu-api
lash self-assigned this 2025-01-14 10:19:15 +01:00
carlos was assigned by lash 2025-01-14 10:19:15 +01:00
lash removed the
Status
Blocked
label 2025-01-14 10:19:21 +01:00
lash added the
Kind/Feature
Activity
Doing
labels 2025-01-14 10:25:18 +01:00
kamikazechaser was assigned by lash 2025-01-14 10:25:27 +01:00
lash added a new dependency 2025-01-14 10:32:07 +01:00
Owner
  • add a new config directive "ALIAS_SEARCH_DOMAINS", a comma-separated list of search domains. Should initially be set to sarafu.local,sarafu.eth
  • add a parser for the new config directive
  • on first name edit in profile, call new api with the first and last name string
  • the result will be a fully-qualified string like "bob.sarafu.local" this should be stored in the userdb (it is the effective alias o the current user).
  • on send with alias, the API call to resolve alias (e.g. "bob") to address should be used:
    1. if the alias entered contains a "." only one request will be sent, as entered.
      2.otherwise, called once for each search domain in config, where the domain is appended to the string entered, breaking on first one found.

also see grassrootseconomics/sarafu-api#3

- add a new config directive "ALIAS_SEARCH_DOMAINS", a comma-separated list of search domains. Should initially be set to sarafu.local,sarafu.eth - add a parser for the new config directive - on first name edit in profile, call new api with the first and last name string - the result will be a fully-qualified string like "bob.sarafu.local" this should be stored in the userdb (it is the effective alias o the current user). - on send with alias, the API call to resolve alias (e.g. "bob") to address should be used: 1. if the alias entered contains a "." only one request will be sent, as entered. 2.otherwise, called once for each search domain in config, where the domain is appended to the string entered, breaking on first one found. also see https://git.grassecon.net/grassrootseconomics/sarafu-api/pulls/3
> POST http://localhost:5015/api/v1/bypass/register
> authorization: Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNLZXkiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJzZXJ2aWNlIjp0cnVlLCJpc3MiOiJldGgtY3VzdG9kaWFsLWRldiIsInN1YiI6InNuLXByb2QiLCJleHAiOjE3Njk4NDIxNzksImlhdCI6MTczODMwNjE3OX0.FXTwZ8nQKCG66xO0wMbx4Mga8SqFZcm65pq7_iMKjXPMH_h0IBHmSV2DOKQVfNbI1W9BRUCuSUwbALFgDqLrBg
> content-type: application/json
> data {"address":"0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3","hint":"peterxd.sarafu.eth"}
{
    "ok": true,
    "description": "Name registered",
    "result": {
        "address": "0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3",
        "autoChoose": true,
        "name": "peterxd71.sarafu.eth"
    }
}
``` > POST http://localhost:5015/api/v1/bypass/register > authorization: Bearer eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCJ9.eyJwdWJsaWNLZXkiOiIweDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAiLCJzZXJ2aWNlIjp0cnVlLCJpc3MiOiJldGgtY3VzdG9kaWFsLWRldiIsInN1YiI6InNuLXByb2QiLCJleHAiOjE3Njk4NDIxNzksImlhdCI6MTczODMwNjE3OX0.FXTwZ8nQKCG66xO0wMbx4Mga8SqFZcm65pq7_iMKjXPMH_h0IBHmSV2DOKQVfNbI1W9BRUCuSUwbALFgDqLrBg > content-type: application/json > data {"address":"0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3","hint":"peterxd.sarafu.eth"} ``` ```json { "ok": true, "description": "Name registered", "result": { "address": "0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3", "autoChoose": true, "name": "peterxd71.sarafu.eth" } } ```

To resolve a name -> address:

GET http://localhost:5015/api/v1/bypass/resolve?name=peter.sarafu.eth
{
  "ok": true,
  "description": "Name resolved",
  "result": {
    "address": "0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3"
  }
}

404 if not resolved

To resolve a name -> address: ``` GET http://localhost:5015/api/v1/bypass/resolve?name=peter.sarafu.eth ``` ```json { "ok": true, "description": "Name resolved", "result": { "address": "0xF7D1D901d15BBf60a8e896fbA7BBD4AB4C1021b3" } } ``` 404 if not resolved
Sign in to join this conversation.
No Milestone
No project
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: urdt/ussd#187
No description provided.