> For the complete documentation index, see [llms.txt](https://learn-web3.gitbook.io/aptos/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn-web3.gitbook.io/aptos/typescript-sdk/module-interaction.md).

# Module方法调用

account.ts

```typescript
// account.ts
import { AptosAccount, HexString } from "aptos";

const privKey = new HexString("Your private key").toUint8Array();
export const aptosAccount = new AptosAccount(privKey);
```

chain.ts

```typescript
// chain.ts
import { AptosClient, FaucetClient, MaybeHexString, TokenClient } from "aptos";

const APTOS_NODE_URL_MAIN = 'https://fullnode.mainnet.aptoslabs.com'
const APTOS_NODE_URL_DEV = 'https://fullnode.devnet.aptoslabs.com'
const APTOS_FAUCET_URL_DEV = 'https://faucet.devnet.aptoslabs.com'

export const isMainnet = false;

// Initialize aptos client
// This client is used to interact with aptos blockchain
const aptosNodeUrl =  isMainnet ? APTOS_NODE_URL_MAIN : APTOS_NODE_URL_DEV;
export const aptosClient = new AptosClient(aptosNodeUrl);
export const tokenClient = new TokenClient(aptosClient);

// For dev purpose, we need to fund our account with faucet.
export const fundAccountForDev = (address: MaybeHexString) => {
  const faucetClient = new FaucetClient(APTOS_NODE_URL_DEV, APTOS_FAUCET_URL_DEV);
  faucetClient.fundAccount(address, 100_000_000);
}
```
