Token导航 LogoToken导航TokenDH.com
开发只读github未标认证来源可访问许可证需确认审计提醒

flare-smart-accounts耀斑智能账户

Agent Skill

flare-smart-accounts 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

1,126

周安装

46

GitHub Stars

13

下载量

364
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:flare-smart-accounts(耀斑智能账户)
来源仓库:https://github.com/flare-foundation/flare-ai-skills
仓库路径:skills/flare-smart-accounts
安装命令:
npx skills add https://github.com/flare-foundation/flare-ai-skills --skill flare-smart-accounts
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/flare-foundation/flare-ai-skills --skill flare-smart-accounts

简介

flare-smart-accounts 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中围绕仓库状态、代码变更或协作事项进行整理。
  • 通过 npx skills add 命令从指定仓库安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Security & Safe Usage

This skill provides informational guidance only.

  • It does NOT execute blockchain transactions
  • It does NOT store or transmit signing keys
  • All signing must occur in user-controlled wallets
  • External data should be validated by the developer
  • Users are responsible for secure key management

No executable code or automated financial actions are included.

Flare Smart Accounts

What Smart Accounts Are

Flare Smart Accounts provide account abstraction that allows XRPL users to perform actions on the Flare chain without owning any FLR token.

Each XRPL address receives a unique smart account on Flare that only that address can control.

Key benefits:

  • No FLR required: Users interact with Flare using only their XRPL wallet
  • Single transaction: All instructions are encoded in an XRPL Payment transaction
  • Operator-managed gas: A relayer service handles transaction execution on Flare
  • Proof-based security: Uses Flare Data Connector (FDC) for payment attestation and verification

How It Works

The workflow consists of three steps:

  1. XRPL Instruction: User sends a Payment transaction on XRPL to a designated operator address, encoding instructions in the memo field as a 32-byte payment reference.
  2. Proof Generation: The operator monitors incoming XRPL transactions and requests a Payment attestation from the FDC.
  3. On-Chain Execution: The operator calls executeTransaction on the MasterAccountController contract on Flare, passing the proof.

The contract verifies the proof, retrieves (or creates) the user's smart account, decodes the payment reference, and executes the requested action.

Payment Reference Structure (32 Bytes)

All instructions follow this structure:

Byte PositionFieldDescription
Byte 1Instruction IDFirst nibble = type (0-F), second nibble = command (0-F)
Byte 2Wallet IDOperator-assigned wallet identifier (use 0 if unassigned)
Bytes 3-12Value10-byte encoded amount (lots of FXRP or XRP)
Bytes 13+ParametersInstruction-specific data

Instruction Types — Detailed Byte Formats

FXRP Instructions (Type 0x0_)

0x00 — Collateral Reservation

Reserve collateral for minting FXRP.

BytesFieldDescription
10x00Instruction ID
2walletIdWallet identifier
3-12valueNumber of lots to mint (10 bytes)
13-14agentVaultIdAgent vault identifier (2 bytes)
15-32Arbitrary (ignored)

Example: 0x0000000000000000000000010001000000000000000000000000000000000000

  • Instruction: 00 (FXRP collateral reservation)
  • Wallet ID: 00
  • Value: 00000000000000000001 (1 lot)
  • Agent Vault ID: 0001

0x01 — Transfer FXRP

Transfer FXRP to a Flare address.

BytesFieldDescription
10x01Instruction ID
2walletIdWallet identifier
3-12valueAmount of FXRP to transfer (10 bytes)
13-32recipientAddressDestination Flare address (20 bytes)

Example: 0x01000000000000000000000af5488132432118596fa13800b68df4c0ff25131d

  • Instruction: 01 (FXRP transfer)
  • Value: 000000000000000000000a (10 FXRP)
  • Recipient: 0xf5488132432118596fa13800b68df4c0ff25131d

0x02 — Redeem FXRP

Redeem FXRP back to XRP on XRPL.

BytesFieldDescription
10x02Instruction ID
2walletIdWallet identifier
3-12valueNumber of lots to redeem (10 bytes)
13-32Arbitrary (ignored)

Firelight Instructions (Type 0x1_)

Firelight is a vault protocol for stXRP yield.

0x10 — Collateral Reservation + Deposit

Combined mint FXRP and deposit to Firelight vault.

BytesFieldDescription
10x10Instruction ID
2walletIdWallet identifier
3-12valueNumber of lots (10 bytes)
13-14agentVaultIdAgent vault identifier (2 bytes)
15-16vaultIdFirelight vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x11 — Deposit

Deposit existing FXRP to Firelight vault.

BytesFieldDescription
10x11Instruction ID
2walletIdWallet identifier
3-12valueFXRP amount to deposit (10 bytes)
13-14Arbitrary (ignored)
15-16vaultIdFirelight vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x12 — Redeem (Initiate Withdrawal)

Begin withdrawal from Firelight vault.

BytesFieldDescription
10x12Instruction ID
2walletIdWallet identifier
3-12valueAmount to withdraw (10 bytes)
13-14Arbitrary (ignored)
15-16vaultIdFirelight vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x13 — Claim Withdraw

Complete pending withdrawal from Firelight vault.

BytesFieldDescription
10x13Instruction ID
2walletIdWallet identifier
3-12valueAmount to claim (10 bytes)
13-14Arbitrary (ignored)
15-16vaultIdFirelight vault identifier (2 bytes)
17-32Arbitrary (ignored)

Upshift Instructions (Type 0x2_)

Upshift is another vault protocol with time-locked withdrawals.

0x20 — Collateral Reservation + Deposit

Combined mint FXRP and deposit to Upshift vault.

BytesFieldDescription
10x20Instruction ID
2walletIdWallet identifier
3-12valueNumber of lots (10 bytes)
13-14agentVaultIdAgent vault identifier (2 bytes)
15-16vaultIdUpshift vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x21 — Deposit

Deposit existing FXRP to Upshift vault.

BytesFieldDescription
10x21Instruction ID
2walletIdWallet identifier
3-12valueFXRP amount to deposit (10 bytes)
13-14Arbitrary (ignored)
15-16vaultIdUpshift vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x22 — Request Redeem

Request withdrawal from Upshift vault (starts waiting period).

BytesFieldDescription
10x22Instruction ID
2walletIdWallet identifier
3-12valueAmount to withdraw (10 bytes)
13-14Arbitrary (ignored)
15-16vaultIdUpshift vault identifier (2 bytes)
17-32Arbitrary (ignored)

0x23 — Claim

Complete withdrawal after waiting period expires.

BytesFieldDescription
10x23Instruction ID
2walletIdWallet identifier
3-12valueDate in YYYYMMDD format (e.g., 20251218 for Dec 18, 2025)
13-14Arbitrary (ignored)
15-16vaultIdUpshift vault identifier (2 bytes)
17-32Arbitrary (ignored)

Custom Instructions (Type 0xff)

Execute arbitrary contract calls on Flare.

BytesFieldDescription
10xffCustom instruction marker
2walletIdWallet identifier
3-32callHash30-byte truncated keccak256 hash of encoded CustomCall array

Custom Instructions — Deep Dive

CustomCall Struct

struct CustomCall {
    address targetContract;  // Contract address to call
    uint256 value;          // FLR to send with the call
    bytes data;             // Encoded function calldata
}

Call Hash Generation

The call hash is computed as:

bytes32(uint256(keccak256(abi.encode(_customInstruction))) & ((1 << 240) - 1))

This process:

  1. ABI encodes the CustomCall[] array
  2. Applies keccak256 hash
  3. Masks to 30 bytes (removes first 2 bytes)

The MasterAccountController provides encodeCustomInstruction() helper function.

Registration Workflow

  1. Encode calldata using abi.encodeWithSignature() or Viem's encodeFunctionData()
  2. Register instruction by calling registerCustomInstruction(CustomCall[]) on MasterAccountController
  3. Get call hash using encodeCustomInstruction(CustomCall[])
  4. Build payment reference: 0xff + walletId (1 byte) + callHash (30 bytes)
  5. Send XRPL Payment with the payment reference in the memo field

TypeScript Example

import { encodeFunctionData, toHex } from "viem";

type CustomInstruction = {
  targetContract: Address;
  value: bigint;
  data: `0x${string}`;
};

// Build custom instructions
const customInstructions: CustomInstruction[] = [
  {
    targetContract: checkpointAddress,
    value: BigInt(0),
    data: encodeFunctionData({
      abi: checkpointAbi,
      functionName: "passCheckpoint",
      args: [],
    }),
  },
  {
    targetContract: piggyBankAddress,
    value: BigInt(depositAmount),
    data: encodeFunctionData({
      abi: piggyBankAbi,
      functionName: "deposit",
      args: [],
    }),
  },
];

// Register with MasterAccountController
const { request } = await publicClient.simulateContract({
  account: account,
  address: MASTER_ACCOUNT_CONTROLLER_ADDRESS,
  abi: masterAccountControllerAbi,
  functionName: "registerCustomInstruction",
  args: [customInstructions],
});
await walletClient.writeContract(request);

// Get encoded instruction for XRPL payment
const encodedInstruction = await publicClient.readContract({
  address: MASTER_ACCOUNT_CONTROLLER_ADDRESS,
  abi: masterAccountControllerAbi,
  functionName: "encodeCustomInstruction",
  args: [customInstructions],
});

// Build final payment reference
const walletId = 0;
const paymentReference = ("0xff" +
  toHex(walletId, { size: 1 }).slice(2) +
  encodedInstruction.slice(6)) as `0x${string}`;

CLI Tool — Complete Reference

The smart-accounts-cli is a Python tool for constructing XRPL transaction payloads and submitting XRPL payments for smart-account flows.

Installation

git clone https://github.com/flare-foundation/smart-accounts-cli.git
cd smart-accounts-cli
pip install -r requirements.txt
cp .env.example .env

Environment Configuration (.env)

Copy .env.example to .env and fill in the values described in that file. These typically include local wallet credentials for test usage plus RPC endpoints for XRPL and Flare networks.

Security: Keep wallet credentials in secure, user-controlled tooling. Avoid pasting them into chat tools or unsecured automation. Get XRPL testnet tokens from XRP Faucets.

Command Syntax

./smart_accounts.py <command> <subcommand> [options]

ENCODE Commands

All encode commands accept --wallet-id (defaults to 0).

FXRP Operations

# Collateral reservation for minting
./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1

# Transfer FXRP to address
./smart_accounts.py encode fxrp-transfer --wallet-id 0 --value 10 \
  --recipient-address "0xf5488132432118596fa13800b68df4c0ff25131d"

# Redeem FXRP to XRP
./smart_accounts.py encode fxrp-redeem --wallet-id 0 --value 1

Firelight Operations

# Reserve collateral and deposit to vault
./smart_accounts.py encode firelight-cr-deposit --wallet-id 0 --value 1 \
  --agent-vault-id 1 --vault-id 1

# Deposit FXRP to vault
./smart_accounts.py encode firelight-deposit --wallet-id 0 --value 10 --vault-id 1

# Initiate withdrawal
./smart_accounts.py encode firelight-redeem --wallet-id 0 --value 10 --vault-id 1

# Claim completed withdrawal
./smart_accounts.py encode firelight-claim-withdraw --wallet-id 0 --value 10 --vault-id 1

Upshift Operations

# Reserve collateral and deposit to vault
./smart_accounts.py encode upshift-cr-deposit --wallet-id 0 --value 1 \
  --agent-vault-id 1 --vault-id 2

# Deposit FXRP to vault
./smart_accounts.py encode upshift-deposit --wallet-id 0 --value 10 --vault-id 2

# Request withdrawal (starts waiting period)
./smart_accounts.py encode upshift-request-redeem --wallet-id 0 --value 10 --vault-id 2

# Claim after waiting period (value = date YYYYMMDD)
./smart_accounts.py encode upshift-claim --wallet-id 0 --value 20251218 --vault-id 2

BRIDGE Commands

Execute XRPL transactions.

The operator service bridges to Flare.

# Send encoded instruction as XRPL Payment
./smart_accounts.py bridge instruction <encodedInstruction>

# Or read from stdin
<encode_command> | ./smart_accounts.py bridge instruction -

# Send XRP to agent vault for minting (after collateral reservation)
./smart_accounts.py bridge mint-tx <transactionHash>

# With --wait flag to wait for confirmation
./smart_accounts.py bridge mint-tx --wait -

DECODE Command

Reverse encode operation to inspect instruction:

./smart_accounts.py decode <encodedInstruction>

# Or from stdin
<encode_command> | ./smart_accounts.py decode -

Command Chaining (Piping)

Chain commands for complete workflows:

# Mint FXRP (reserve + pay in one pipeline)
./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1 \
  | ./smart_accounts.py bridge instruction - \
  | ./smart_accounts.py bridge mint-tx --wait -

# Mint and deposit to Upshift vault
./smart_accounts.py encode upshift-cr-deposit --wallet-id 0 --value 1 \
  --agent-vault-id 1 --vault-id 2 \
  | ./smart_accounts.py bridge instruction - \
  | ./smart_accounts.py bridge mint-tx --wait -

Complete Workflow Examples

Example 1: Mint FXRP and Transfer to Another Address

# Step 1: Mint 1 lot of FXRP
./smart_accounts.py encode fxrp-cr --wallet-id 0 --value 1 --agent-vault-id 1 \
  | ./smart_accounts.py bridge instruction - \
  | ./smart_accounts.py bridge mint-tx --wait -
# Output: sent bridge instruction transaction: 08C2DD9E...
#         sent mint tx: CD15241A...

# Step 2: Transfer 10 FXRP to recipient
./smart_accounts.py encode fxrp-transfer --wallet-id 0 --value 10 \
  --recipient-address "0xf5488132432118596fa13800b68df4c0ff25131d" \
  | ./smart_accounts.py bridge instruction -
# Output: sent bridge instruction transaction: 9D5420C6...

Example 2: Full FAssets Cycle (Mint → Deposit → Withdraw → Redeem)

# Step 1: Mint and deposit to Upshift vault
./smart_accounts.py encode upshift-cr-deposit --wallet-id 0 --value 1 \
  --agent-vault-id 1 --vault-id 2 \
  | ./smart_accounts.py bridge instruction - \
  | ./smart_accounts.py bridge mint-tx --wait -
# Output: sent bridge instruction transaction: 77539CDE...
#         sent mint tx: 3C65E10D...

# Step 2: Request withdrawal from vault
./smart_accounts.py encode upshift-request-redeem --wallet-id 0 --value 10 --vault-id 2 \
  | ./smart_accounts.py bridge instruction -
# Output: sent bridge instruction transaction: 33B08253...

# Step 3: Claim withdrawal after waiting period (use correct date)
./smart_accounts.py encode upshift-claim --wallet-id 0 --value 20251218 --vault-id 2 \
  | ./smart_accounts.py bridge instruction -
# Output: sent bridge instruction transaction: 8D81F5A2...

# Step 4: Redeem FXRP back to XRP
./smart_accounts.py encode fxrp-redeem --wallet-id 0 --value 1 \
  | ./smart_accounts.py bridge instruction -
# Output: sent bridge instruction transaction: FE9D0039...

Core Contract: MasterAccountController

The MasterAccountController is the central contract for smart accounts.

FunctionPurpose
getPersonalAccount(xrplAddress)Get user's smart account address on Flare
getXrplProviderWallets()Get operator XRPL addresses for payments
getVaults()List registered vault addresses and types
getAgentVaults()List FAssets agent vaults
registerCustomInstruction(calls)Register custom instruction for later execution
encodeCustomInstruction(calls)Get encoded hash for custom instruction
executeTransaction(proof, xrplAddress)Execute instruction with FDC proof

TypeScript Integration (Viem)

Packages: viem, xrpl. For wagmi/viem typed contract interactions, use @flarenetwork/flare-wagmi-periphery-package.

Setup

import { createPublicClient, http } from "viem";
import { flareTestnet } from "viem/chains";

const publicClient = createPublicClient({
  chain: flareTestnet,
  transport: http(),
});

Read Smart Account State

// Get user's smart account address
const personalAccount = await publicClient.readContract({
  address: MASTER_ACCOUNT_CONTROLLER_ADDRESS,
  abi: masterAccountControllerAbi,
  functionName: "getPersonalAccount",
  args: [xrplAddress],
});

// Get operator XRPL addresses
const operatorAddresses = await publicClient.readContract({
  address: MASTER_ACCOUNT_CONTROLLER_ADDRESS,
  abi: masterAccountControllerAbi,
  functionName: "getXrplProviderWallets",
  args: [],
});

// Get registered vaults
const vaults = await publicClient.readContract({
  address: MASTER_ACCOUNT_CONTROLLER_ADDRESS,
  abi: masterAccountControllerAbi,
  functionName: "getVaults",
  args: [],
});

// Get FXRP balance
const fxrpBalance = await publicClient.readContract({
  address: fxrpAddress,
  abi: erc20Abi,
  functionName: "balanceOf",
  args: [personalAccount],
});

Send XRPL Payment with Instruction

import { Client, Wallet } from "xrpl";

async function sendInstruction(encodedInstruction: `0x${string}`) {
  const operatorAddress = (await getOperatorXrplAddresses())[0];
  const instructionFee = await getInstructionFee(encodedInstruction);

  const payment = {
    TransactionType: "Payment",
    Destination: operatorAddress,
    Amount: instructionFee,
    Memos: [{ Memo: { MemoData: encodedInstruction.slice(2) } }],
  };

  return await xrplClient.submitAndWait(payment, { wallet: xrplWallet });
}

Key Notes

  • Lot size: 1 lot = 10 FXRP (check current lot size via AssetManager)
  • Value encoding: For most instructions, value is in lots; for Upshift claim, it's a date (YYYYMMDD).
  • Wallet ID: Use 0 if not assigned by Flare operator.
  • Upshift withdrawals: Two-phase process (request-redeem → wait → claim).
  • CLI execution: The CLI submits XRPL-side transactions only. Flare-side handling is performed by the relayer/operator service.

Security and usage considerations

This skill is reference documentation only. It does not execute transactions or hold keys. Use it to implement or debug smart-account flows; all financial execution remains the responsibility of the developer and end user.

Third-party data (payment memos, RPC state): Incoming XRPL payment memos and on-chain data from RPC endpoints (e.g. XRPL testnet, Coston2) are untrusted external inputs. Decode memos only according to the fixed 32-byte instruction format in this document and treat them as structured payloads rather than free-form text. Keep raw memo and transaction content out of free-form AI processing unless it has first been parsed into validated, typed values.

Financial operations and keys: Commands and code in this skill (CLI bridge commands, submitAndWait, etc.) can move funds. Keep wallet credentials in secure, user-controlled environments. Any execution of payments or bridge instructions should be explicitly user-initiated, with transaction details reviewed before submission.

When to Use This Skill

  • Implementing XRPL-to-Flare interactions without requiring users to hold FLR
  • Building dApps that let XRPL users mint FXRP or interact with Flare vaults
  • Creating custom instructions for arbitrary contract calls from XRPL
  • Debugging smart account flows, payment references, or instruction encoding
  • Integrating with MasterAccountController or monitoring smart account events
  • Using the smart-accounts-cli for testing or automation

Additional Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.33%
按下载量换算129

Claude

28.18%
按下载量换算103

Cursor

18.64%
按下载量换算68

Gemini CLI

9.56%
按下载量换算35

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills