Connect a profile

The connect functionality is a key feature of Bond, and our API makes it easier to use by leveraging typed data. Typed data is an approach introduced by Ethereum Improvement Proposal (EIP-712) that presents users with a more readable format for the data they are signing, compared to the traditional hexadecimal format. This method requires precise construction of data following EIP-712 standards, and our API simplifies this process for developers and users. You can find more about it here.

However, constructing such data, while adhering to the specifics of EIP-712, can be intricate. Our API streamlines this process, ensuring seamless interactions for developers and users alike.

Typed Data Components

Typed data requires several elements to ensure it can be accurately signed and verified:

  1. Nonce: A unique number that is used once to avoid replay attacks.

  2. Deadline: The time after which the typed data signature is no longer valid.

  3. Contract Version: The version of the contract being interacted with.

  4. Contract Address: The Ethereum address where the contract is deployed.

  5. Chain ID: The identifier for the blockchain network being used.

  6. Name of the Contract: A human-readable string that represents the contract.

By using the typed data approach, you'll be working with the withSig methods. These can be called by you with your signature, or by any relay with your signature, by querying via createConnectProfileTypedData , you can enable gasless transactions.

API Details

Get follow typed data

mutation CreateConnectProfileTypedData($request: ConnectProfileTypedDataRequest!) {
  createConnectProfileTypedData(request: $request) {
    ... on CreateConnectProfileBroadcastItemResult {
      id
      expiresAt
      typedData {
        types {
          ConnectProfileWithSig {
            name
            type
          }
        }
        domain {
          name
          chainId
          version
          verifyingContract
        }
        value {
          connectorProfileId
          connectType
          idsOfProfilesToConnect
          datas
          nonce
          deadline
        }
      }
    }
    ... on AppRelayError {
      error
    }
  }
}

You can then make a follow request via gasless mode.

mutation ConnectProfile($request: ConnectProfilesRequest!) {
  connectProfile(request: $request) {
    ... on AppRelayerResult {
      txHash
      profileId
    }
    ... on AppRelayError {
      error
    }
  }
}

Last updated