Skip to content

Get account info

Category: Accounts

Description: Retrieves details of an existing account or the parameters needed to create a new one.

Type: POST

URL: /get-account-info

Requirements

  • A valid API Key must be provided (header Authorization: Bearer <API_KEY>)
  • The provided chainId must be configured for the project

Body Params (IGetAccountInfoRequest)

NameTypeDescriptionRequired
accountAddressstringAccount address
chainIdnumberUnique blockchain chain ID

Response

ts
type GetAccountInfoResponse = {
  accountAddress: string;
  moduleAddress: string;
  factoryAddress: string;
  initCode?: string; // Present only if the account is not yet deployed
  moduleType: string;
  storageType: string;
  guardians: string[];
  guardianStructId?: string;
  guardiansHash?: string;
};

Error Handling

HTTP StatusMeaning
200Success. Information retrieved
515Data validation error
512Internal server error

Code Examples

Installation

tsx
npm i node-fetch

Request

tsx
// data: IGetAccountInfoRequest
const url = `${this.backendUrl}/get-account-info`;
let config = {
  method: "post",
  maxBodyLength: Infinity,
  headers: {
    "Content-Type": "application/json",
    Authorization: `Bearer ${this.apiKey}`,
  },
  body: JSON.stringify(data),
};

const response = await fetch(url, config);
const JSONResponse = await response.json();