# NEAR Intents and Solana

The account's Ed25519 key is also a NEAR Intents implicit account and a Solana address. The same approval rules apply: every signature needs the owner wallet's approval, which shows the decoded message.

## NEAR Intents

```ts
accounts.near.accountId(); // the implicit account (hex public key)

const signed = await accounts.near.signIntents([
  { intent: 'token_diff', diff: { 'nep141:usdc…': '-100000000', 'nep141:wrap.near': '99000000' } },
]);
await accounts.near.publish(signed, [quoteHash]); // to the NEAR Intents solver relay
```

Intents are signed as `raw_ed25519` payloads. No NEAR account, gas or registration is needed. The approval lists each intent: what is given, received, transferred or withdrawn, and to whom.

## Solana

```ts
accounts.solana.address();

const { signature, transaction } = await accounts.solana.signTransaction(messageBytes);
await rpc.sendTransaction(transaction, { encoding: 'base64' }).send();
```

The message must be a serialized Solana transaction message (legacy or v0) in which the account is the only signer and the fee payer. The account needs SOL for Solana fees.

## Raw signatures

```ts
const signature = await accounts.signMessage(bytes); // 64-byte Ed25519 signature
```

Messages must be 1 to 4,096 bytes. 32-byte messages are refused, because they can't be told apart from a Sui transaction digest.

Each signature costs the same as a Sui transaction (an Ika presign and sign), without the Sui execution gas.
