# Including TypeScript Library

\
To include the library in your TypeScript program, you can follow these steps:

1. Create a TypeScript file (e.g., myProgram.ts) where you intend to use the Circular library.
2. In the same directory as your TypeScript file, create a TypeScript declaration file (e.g., Circular.d.ts) to define the types for the Circular library. This file should include the TypeScript interface for the Circular object. Below is an example of the content for Circular.d.ts:

```typescript
declare module 'Circular' {
        interface Circular {
            GetWallet(Blockchain: string, Address: string): Promise;
            SetNAGKey(NAGKey: string): void;
            SetNAGURL(NURL: string): void;
            stringToHex(str: string): string;
            RegisterWallet(Blockchain: string, PrivateKey: string): Promise;
            GetAsset(Blockchain: string, Name: string): Promise;
            GetAssetSupply(Blockchain: string, Name: string): Promise;
            SignMessage(message: string, privateKey: string): string;
            getPublicKey(privateKey: string): string;
            getFormattedTimestamp(): string;
            verifySignature(publicKey: string, message: string, signature: string): boolean;
            GetBlock(Blockchain: string, Num: number): Promise;
            SendTransaction(ID: string, From: string, To: string, Timestamp: string, Type: string,
                         Payload: string, Nonce: string, PublicKey: string, Signature: string, Blockchain: string ): Promise;
          }

        const Circular: Circular;
        export default Circular;
}
```

3. In your TypeScript program (myProgram.ts), you can now import and use the Circular library like this:

```typescript
   import Circular from 'Circular';

    // Create the Circular object
    const circular: Circular = (() => {
    // ... (The rest of your code goes here)
    })();
```

Ensure that the TypeScript declaration file (Circular.d.ts) and the library files (JavaScript files) are located in the same directory or have the correct relative path specified in the import statement.

4. You can now use the Circular library functions and objects with TypeScript type checking in your myProgram.ts file.

Don't forget to install any required dependencies, such as 'elliptic' and 'sha256,' using npm or yarn to guarantee the correct functioning of the library.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://circular-protocol.gitbook.io/standard-apis/api-docs/typescript/including-typescript-library.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
