Skip to content

Few Developer Experience Enhancements #178

@yashovardhan

Description

@yashovardhan

A couple of minor changes that will help our MPC Core Kit Integration:

  1. Can we expose Point & secp256k1 from MPC Core Kit directly instead of fetching it from @tkey/common-types? It feels like an unnecessary addition just for using deleteShare function.

  2. Currently the WEB3AUTH_NETWORK object is like this

    export declare const WEB3AUTH_NETWORK: {
        readonly MAINNET: "sapphire_mainnet";
        readonly DEVNET: "sapphire_devnet";
    };
    

    This is inconsistent with our other SDKs and causes confusion. This was done earlier when sapphire was new in order to make sure people understand MPC only works with Sapphire networks. However it is quite well documented and the dashboard flow makes sure people make sapphire projects. In order to be consistent can we change it to:

    export declare const WEB3AUTH_NETWORK: {
        readonly SAPPHIRE_MAINNET: "sapphire_mainnet";
        readonly SAPPHIRE_DEVNET: "sapphire_devnet";
    };
    
  3. The deleteShare function currently has a lot of extra steps currently

    let factorPub: string | undefined;
        for (const [key, value] of Object.entries(coreKitInstance.getKeyDetails().shareDescriptions)) {
          if (value.length > 0) {
            const parsedData = JSON.parse(value[0]);
            if (parsedData.module === FactorKeyTypeShareDescription.SocialShare) {
              factorPub = key;
            }
          }
        }
    const pub = Point.fromSEC1(secp256k1, factorPub);
    await coreKitInstance.deleteFactor(pub);

    Can we make the process of grabbing a particular share with share description easy? Can getting a point be shifting directly within the deleteFactor function of the SDK? I'm thinking of something like:

    const factorPub = findFactorByShareDescription(FactorKeyTypeShareDescription.SocialShare) // should return an array of matching shares
    await coreKitInstance.deleteFactor(pub[0]);
  4. Additionally, can we have a listFactors function that grabs all the factors from share description and returns an object containing all the available shares?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions