# Call An Entry Function

Run an entry function using `scripts/entry-function.ts`.

In the script, a function calling the test script is called.

```
0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message
```

You may change the entry function, type arguments and arguments as you want in typescript for your own function calls.

```
  // CLI-MSafe/scripts/entry-function.ts:line 32
  // Apply your function call and arguments here
  const msafeTxn = await makeEntryFunctionTx(
    msafe.address,
    {
      fnName: "0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message",
      typeArgs: [],
      args: [BCS.bcsSerializeStr("Hello momentum safe")],
    },
    {sequenceNumber: sn},
  );
```

Run script with yarn

```
yarn run entry-function --msafe ${MSAFE_ADDR}
```

```
Action:			Entry function
Call function:		0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0::message::set_message
Arguments (1):		[string]	Hello momentum safe
Sender:			0x1908fe0d337d7bd718c8465030c5f306377ac396f3d7acce92f526ae41637cc0
Sequence Number:	10
Expiration:		Thu Oct 13 2022 20:45:55 GMT-0700 (Pacific Daylight Time)
Gas Price:		100
Max Gas:		5000

--------------------

Do you confirm with the transaction? [Y/n]
```

After confirming the entry function, a transaction to initiate a transaction from MSafe wallet calling `message::set_message` is submitted on chain.

Other owners may confirm the transaction either in interactive CLI or Web App.


---

# 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://doc.m-safe.io/aptos/developers/sdk/call-an-entry-function.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.
