Skip to content

Manual funder setting #7

@atkinssamuel

Description

@atkinssamuel

To successfully enable the client funder, I had to do it myself using the .set_funder function. It doesn't seem like this is the recommended flow, but this is the only way I could get order submission working without "not enough balance" errors.

  let funder = env_var("POLY_FUNDER");
  let base_url = env_var("POLY_API_URL");
  let private_key = env_var("POLY_PRIVATE_KEY");

  let l1_client = ClobClient::with_l1_headers(&base_url, &private_key, 137);
  let creds = l1_client.create_or_derive_api_key(None).await?;

  let mut client = ClobClient::with_l2_headers(&base_url, &private_key, 137, creds.clone());
  let _ = client.set_funder(&funder); // should be integrated into constructor
  client.set_api_creds(creds.clone());

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions