Code Monkey home page Code Monkey logo

api.starknet.id's People

Contributors

fricoben avatar irisdv avatar th0rgal avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

847850277

api.starknet.id's Issues

stats.starknet.id endpoints

We have to write stats.starknet.id endpoints on this server in order to have nothing on app.starknet.id anymore (it's currently not working because of that).

refactor `id_to_data` & add `domain_to_data`

What I need

id_to_data ==>

type Identity = {
  domain?: string;
  domain_addr?: string;
  domain_expiry?: number | null;
  owner: string;
  is_owner_main: boolean;
  twitter?: string;
  discord?: string;
  github?: string;
  pop?: boolean;
};

domain_to_data ==>

type Identity = {
  token_id: number;
  domain_addr: string;
  domain_expiry: number | null;
  owner: string;
  is_owner_main: boolean;
  twitter?: string;
  discord?: string;
  github?: string;
  pop?: boolean;
};

Sol domains backend

Description:
Develop a backend endpoint for handling the claiming process of Stark subdomains based on domains from Solana.

Tasks:

  1. Endpoint Creation: Create a new endpoint crosschain/solana/claim to handle POST requests with the required JSON payload { source_domain, source_signature, target_address }.
  2. Logic Implementation:
    • Identify the controller or owner of the source domain.
    • Verify the provided signature for domain claiming.
    • Generate a Starknet ECDSA signature to facilitate the claiming process.
  3. Performance Check: Evaluate the compilation time with new dependencies for querying the Solana blockchain and verifying signatures. If performance is impacted significantly, consider creating a separate project using rust_server_template.

Dependencies:

  • Integration with the frontend for receiving and responding to requests.
  • Libraries or modules for interacting with the Solana blockchain and signature verification.

Add referrals data

Description

We have trouble managing data for referrals, Ideally, we would have queries where we can have:

  • Check the revenue generated by a particular address on direct referrals for Starknet ID (so the 75%)
  • Check the revenue generated by a particular address on direct referrals for the Affiliate (so the 25%)
  • Check the revenue generated by a particular address on indirect referrals for the Starknet ID
  • Check the revenue generated by a particular address on indirect referrals for the affiliate
  • Check the total revenue generated by Starknet ID on direct/indirect affiliates
  • Check the total revenue generated by Affiliates
  • Check the top affiliates

I'll try to do it on our python dashboard first

Fix new backend

Fix new starknetid backend not detecting custom resolvers.

add address to domains

Description

We need to be able to check all the domains owned by an address to make this component. Atm we're using addr_to_full_ids on the front but it's a bit dirty.

Capture d’écran 2023-09-13 à 11 29 47

Proposed toDo

  • Add addr_to_domains
  • Fix front-end in renewalDomainsBox.tsx

API returning different format than documentation

Hi,

We've been using the starknet.id API for a while, particularly the domain_to_data endpoint to retrieve information.

Noticed that recently, the response format of most of the endpoint returning data has changed, and are breaking all past implementation.

Example:

Using the url https://api.starknet.id/domain_to_data?domain=fricoben.stark

Before, (as shown in the documentation) it was returning

{
  "domain": "fricoben.stark",
  "addr": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
  "domain_expiry": 1835881200,
  "is_owner_main": true,
  "owner_addr": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
  "github": "78437165",
  "twitter": "1255853529866145794",
  "discord": "662387807901188096",
  "old_github": "78437165",
  "old_twitter": "1255853529866145794",
  "old_discord": "662387807901188096",
  "proof_of_personhood": true,
  "starknet_id": "8",
  "img_url": "https://api.briq.construction/v1/preview/starknet-mainnet/0x2cfc5dbd15e395fd598f35bae2300322d0227760be5e9621000000000000000.png"
}

Now, it is returning

{
"id": "0x0000000000000000000000000000000000000000000000000000000000000008",
"owner": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
"main": false,
"creation_date": 1669820712,
"domain": {
"domain": "fricoben.stark",
"migrated": false,
"root": true,
"creation_date": 1669822621,
"expiry": 1835881200,
"resolver": null,
"legacy_address": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3",
"rev_address": "0x061b6c0a78f9edf13cea17b50719f3344533fadd470b8cb29c2b4318014f52d3"
},
"user_data": [],
"verifier_data": [
{
"verifier": "0x0480258f58d43fb73936f803780047a0f6d0a563697d80bd3f95b603f9c8b1c8",
"field": "0x00000000000000000000000000000000000000000000000000646973636f7264",
"data": "0x00000000000000000000000000000000000000000000000009314633a9800000"
},
{
"verifier": "0x0480258f58d43fb73936f803780047a0f6d0a563697d80bd3f95b603f9c8b1c8",
"field": "0x0000000000000000000000000000000000000000000000000074776974746572",
"data": "0x000000000000000000000000000000000000000000000000116db021b1979002"
},
{
"verifier": "0x002d5f0f2fcba62a54f0d8a73fb2e437d76c53f7297153b2afd1f198af6d12aa",
"field": "0x00000000000000000000000000000000000000000000000000646973636f7264",
"data": "0x00000000000000000000000000000000000000000000000009314633a9800000"
},
{
"verifier": "0x002d5f0f2fcba62a54f0d8a73fb2e437d76c53f7297153b2afd1f198af6d12aa",
"field": "0x0000000000000000000000000000000000000000000000000000676974687562",
"data": "0x0000000000000000000000000000000000000000000000000000000004acdb2d"
},
{
"verifier": "0x002d5f0f2fcba62a54f0d8a73fb2e437d76c53f7297153b2afd1f198af6d12aa",
"field": "0x0000000000000000000000000000000000000000000000000074776974746572",
"data": "0x000000000000000000000000000000000000000000000000116db021b1979002"
},
{
"verifier": "0x0293eb2ba9862f762bd3036586d5755a782bd22e6f5028320f1d0405fd47bff4",
"field": "0x0000000000000000000000000070726f6f665f6f665f706572736f6e686f6f64",
"data": "0x0000000000000000000000000000000000000000000000000000000000000001"
},
{
"verifier": "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7",
"field": "0x00000000000000000000000000000000006e66745f70705f636f6e7472616374",
"data": "0x01435498bf393da86b4733b9264a86b58a42b31f8d8b8ba309593e5c17847672"
},
{
"verifier": "0x06ac597f8116f886fa1c97a23fa4e08299975ecaf6b598873ca6792b9bbfb678",
"field": "0x000000000000000000000000000000000000000000000000000000006e616d65",
"data": "0x0334120bfaa474821350172806dc2b009b8917a1721e0e565ebca9a468fbe7c4"
},
{
"verifier": "0x0480258f58d43fb73936f803780047a0f6d0a563697d80bd3f95b603f9c8b1c8",
"field": "0x0000000000000000000000000000000000000000000000000000676974687562",
"data": "0x0000000000000000000000000000000000000000000000000000000004acdb2d"
}
],
"extended_verifier_data": [
{
"verifier": "0x070aaa20ec4a46da57c932d9fd89ca5e6bb9ca3188d3df361a32306aff7d59c7",
"field": "0x00000000000000000000000000000000000000000000006e66745f70705f6964",
"extended_data": [
"0x000000000000000000000000000000002d0227760be5e9621000000000000000",
"0x0000000000000000000000000000000002cfc5dbd15e395fd598f35bae230032"
]
}
]
}

Is there a changelog somewhere, and in which endpoint has the old properties (img_url, starknet_id) has been moved to ?

Use profile pics within api.starknet.id.URI #31

Here's a general example in Go:

package main

import (
"fmt"
"io/ioutil"
"log"
"net/http"
)

func main() {
// Replace this URL with the actual StarkNet API endpoint for profile pictures
apiEndpoint := "http://api.starknet.id.uri/profile-picture/user123"

// Make a GET request to the API endpoint
response, err := http.Get(apiEndpoint)
if err != nil {
    log.Fatal("Error making GET request:", err)
}
defer response.Body.Close()

// Check if the request was successful (status code 200)
if response.StatusCode == http.StatusOK {
    // Read the response body
    body, err := ioutil.ReadAll(response.Body)
    if err != nil {
        log.Fatal("Error reading response body:", err)
    }

    // Process the profile picture data as needed
    fmt.Println("Profile Picture Data:", string(body))
} else {
    log.Fatal("API request failed with status code:", response.StatusCode)
}

}
Make sure to replace the apiEndpoint with the actual URL you have for fetching profile pictures. Additionally, the structure of the API request and the response may vary depending on the StarkNet API documentation.

Refactor `get_renewal_data`

Description

To have the STRK or ETH choice on the domain subscription, I’m trying to get the subscribed domains on a certain currency. Currently we have a query that gives a what domains are not subscribed.

get_renewal_data already exists but I would like it to be for the address and not only focus on a domain.

Add CCIP support to api.starknet.id

We index the custom resolvers. We should keep a mapping for some custom resolvers to multiple URL endpoints to call to get the actual target.

We should have two ways to get this mapping:

  1. We index a new event OffChainResolverUpdate which emits a list of URLs
  2. We have a hardcoded mapping in the configuration for partners using CCIP who might not have emitted that events or that gave us a non public URL endpoint (that hardcoded mapping overrides the first event)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.