-
Notifications
You must be signed in to change notification settings - Fork 13
notes
Apps will need to make some changes:
- HUB /api/v1/signup POST endpoint now return addition
pubkey
field (used as described on next item) and newroute_hint
key inside the invite object returned. - the PUT contacts/tokens route requires "pubkey" in body now (the pubkey got from HUB on signup endpoint)
- When creating INVITER contact record during signup, add
route_hint
as long asnickname
andpubkey
(all of them coming inside INVITE object on signup response) - "self" contact no longer is guaranteed to have id=1. ALL places in apps where id=1 is checked need to be changed.
isOwner
needs to be used to find owner record
-
"route_hint" is a new field on createContact and updateContact route (new text field needs to be added on PROFILE view and CONTACT DETAILS view)
-
"owner_route_hint" on joinTribe route (if it exists on tribe server)
-
"route_hint" should be included in the query for GET /route
- we will need to figure out a new "contact sharing" string that includes route hint (pubkey:hub_pubkey:chan_id)
- on signup endpoint response add new "pubkey" key with the node pubkey value (invite.node.pubkey)
Relay will include a non_zero_policies
array in the ping to hub. Each item in the array is an object with:
{
chan_id: string,
node: string, // "node1_policy" or "node2_policy"
fee_base_msat: number
}
group type = 2
Scanning QR code will give you sphinx.chat://?action=tribe&uuid=xxxxx&host=tribes.sphinx.chat
Then you can call https://{host}/tribes/{uuid} to get the full details to display:
{
name,
description,
img,
groupKey,
host,
uuid,
priceToJoin,
pricePerMessage,
}
To actually join, you can POST to /tribe with the name,uuid,group_key,host,img,amount (amount is the priceToJoin), which will add that chat to your relay DB, and subscribe you to the group chat.
same POST to /group, with new params:
{
is_tribe: true, // lets just keep this true to start
is_listed: true, // lets just keep this true to start
price_per_message: 100,
price_to_join: 100,
img: "https://asdf", // image URL
description: "hi",
tags: ["Bitcoin","Sphinx","Lightning"]
}
Rather than encrypting with the recipient's contact_key, you need to encrypt using the group_key of the group. And send a dictionary with {chat_id: encrypted_message} as the remote_text_map same as always.
The "contact" for a message might NOT be in relay contacts table, or in device DB. Because of this, simply show the alias attached to the message