# Provider API Methods

The ME Wallet follows the specs defined in the [Solana Wallet Standard ](https://github.com/anza-xyz/wallet-standard/tree/master)

## Provider Methods

### `Connect`

Prompts a connection to a user's Magic Eden Wallet account.

#### Params

| Property        | Type      | Description   |
| --------------- | --------- | ------------- |
| `onlyIfTrusted` | `boolean` | Optional flag |

#### Response

| Property                          | Type        | Description                                                                                                           |
| --------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------------- |
| `Promise<{publicKey: PublicKey}>` | `PublicKey` | The returned [PublicKey](https://solana-labs.github.io/solana-web3.js/classes/PublicKey.html) of the connected wallet |

### `signMessage`

Prompts to sign a message with the user's connected Magic Eden Wallet account

#### Params

| Property  | Type                   | Description                                |
| --------- | ---------------------- | ------------------------------------------ |
| `message` | `Uint8Array \| string` | The message to sign for                    |
| `display` | `"utf8" \| "hex"`      | Encoding format for displaying the message |

#### Response

| Property                                              | Type                | Description                                                                                                                                 |
| ----------------------------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `Promise<{ signature: Bytes; publicKey: PublicKey }>` | `Bytes & PublicKey` | The signed message in Bytes and the associated [PublicKey](https://solana-labs.github.io/solana-web3.js/classes/PublicKey.html) that signed |

### `signAndSendTransaction`

Prompts to both sign and send a transaction with the user's connected Magic Eden Wallet account

#### Params

| Property             | Type                                    | Description                                                                                                                                                                                                                       |
| -------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionOrBytes` | `LegacyOrVersionedTransaction \| Bytes` | A [Transaction](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) or [VersionedTransaction](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) object, or the associated bytes. |
| `options`            | `SendOptions`                           | Options for sending transactions                                                                                                                                                                                                  |

where `SendOptions` is defined as such:

```typescript
export declare type SendOptions = {
    /** disable transaction verification step */
    skipPreflight?: boolean;
    /** preflight commitment level */
    preflightCommitment?: Commitment;
    /** Maximum number of times for the RPC node to retry sending the transaction to the leader. */
    maxRetries?: number;
    /** The minimum slot that the request can be evaluated at */
    minContextSlot?: number;
};

export declare type Commitment = 'processed' | 'confirmed' | 'finalized' | 'recent' | 'single' | 'singleGossip' | 'root' | 'max';
```

#### Response

| Property                                | Type              | Description               |
| --------------------------------------- | ----------------- | ------------------------- |
| Promise<{ signature: string \| Bytes }> | `string \| Bytes` | The transaction signature |

### `signTransaction`

Prompts to sign a transaction (but not send) with the user's connected Magic Eden Wallet account

#### Params

| Property             | Type                                    | Description                                                                                                                                                                                                                                 |
| -------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionOrBytes` | `LegacyOrVersionedTransaction \| Bytes` | An unsigned [Transaction](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) or [VersionedTransaction](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) object, or the associated bytes. |

#### Response

| Property                                         | Type                                    | Description                                                                                                                                                                                                                              |
| ------------------------------------------------ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Promise<LegacyOrVersionedTransaction \| Bytes>` | `LegacyOrVersionedTransaction \| Bytes` | A signed [Transaction](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) or [VersionedTransaction](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) object, or the associated bytes. |

### `signAllTransactions`

Prompts to sign all passed transactions (but not send) with the user's connected Magic Eden Wallet account

Prompts to sign a transaction (but not send) with the user's connected Magic Eden Wallet account

#### Params

| Property             | Type                                        | Description                                                                                                                                                                                                                                             |
| -------------------- | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `transactionOrBytes` | `(LegacyOrVersionedTransaction \| Bytes)[]` | An unsigned [Transaction](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) or [VersionedTransaction](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) object array, or the associated bytes array. |

#### Response

| Property                                             | Type                                        | Description                                                                                                                                                                                                                                          |
| ---------------------------------------------------- | ------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Promise(<LegacyOrVersionedTransaction \| Bytes>)[]` | `(LegacyOrVersionedTransaction \| Bytes)[]` | A signed [Transaction](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) or [VersionedTransaction](https://solana-labs.github.io/solana-web3.js/classes/VersionedTransaction.html) object array, or the associated bytes array. |


---

# 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://docs-wallet.magiceden.io/solana/provider-api-methods.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.
