Onboarding Signature & API Authorization

The method Create Onboard Signature allows users to generate an onboarding signature. This signature is used to verify the authenticity of the user and generate an authentication token, which is used for all user-related endpoints and sockets on the off-chain REST API.

⚠️

Please note you only need to invoke this method and obtain this auth token explicitly if you don't intend on using Bluefin's TypeScript and Python clients. If using the client, this step is implicitly handled during Client Initialization.

Examples:

import { Networks, BluefinClient, OnboardingSigner } from "@bluefin-exchange/bluefin-v2-client";

async function main() {

  const dummyAccountKey =
    "trigger swim reunion gate hen black real deer light nature trial dust";

  const client = new BluefinClient(
    true,
    Networks.TESTNET_SUI,
    dummyAccountKey,
    "ED25519" //valid values are ED25519 or Secp256k1
  ); //passing isTermAccepted = true for compliance and authorizarion
  await client.init();

	// Uses key provided while initializing the client to generate the signature
  const signature = await client.createOnboardingSignature();

  console.log("User Onboarding Signature:", signature);
}

main().then().catch(console.warn);
from pprint import pprint
import asyncio
from bluefin_v2_client import BluefinClient, Networks


async def main():
    seed_phrase = "person essence firm tail chapter forest return pulse dismiss unlock zebra amateur"

    client = BluefinClient(
        True,  # agree to terms and conditions
        Networks["SUI_STAGING"],  # network to connect i.e. SUI_STAGING or SUI_PROD
        seed_phrase,  # seed phrase of the wallet
    )

    await client.init(True)
    signature = await client.onboard_user()
    pprint("User onboarding Signature:")
    pprint(signature)

    await client.close_connections()


if __name__ == "__main__":
    loop = asyncio.new_event_loop()
    loop.run_until_complete(main())
    loop.close()

User Onboarding Signature in Other Languages

To create a user onboarding signature to the API, you may choose any other language or library that allows you to make HTTP requests. While we don't support official libraries for other languages, you can find a list of order signature creation examples in various languages here.