Skip to main content

AI-Assisted Integration

Besides integrating manually from the API reference, we provide the AIG Integration Skill: the API specs, signing algorithm, money-safety rules and a phased implementation plan, packaged as instructions an AI coding assistant can use directly. Once it is installed, tell Claude Code (or a similar assistant) "Implement AIG seamless wallet integration". The AI reads your existing codebase and generates the integration code and tests in your language and framework.

1. Choose your wallet model​

Transfer WalletSeamless Wallet
Where the balance livesA per-player wallet on the game sideOn the merchant side; the game side keeps no balance
Call directionMerchant → game (deposit / withdraw / check)Game → merchant (balance / bet / payout / refund callbacks)
Merchant needsAPI calls + a reconciliation jobA public HTTPS callback endpoint
Skillaig-transfer-walletaig-seamless-wallet
Downloadaig-transfer-wallet.zipaig-seamless-wallet.zip

The wallet model is fixed when your merchant account is opened. Ask customer service if you are not sure which one you have.

2. What's in a Skill​

aig-seamless-wallet/
├── SKILL.md trigger phrases, mandatory money rules, definition of done
├── guide.md phased implementation plan
├── reference/ protocol, signing (with test vectors), endpoint specs, self-test scenarios
└── appendix/ error codes, game IDs, languages, environments

A Skill contains only Markdown files. It has no executable code and does not upload your code or credentials anywhere.

3. Install (Claude Code)​

  1. Download the zip and extract it to get the aig-seamless-wallet/ or aig-transfer-wallet/ folder.
  2. Put the folder under .claude/skills/ in your project (this project only), or under ~/.claude/skills/ (all projects):
your-project/
└── .claude/
└── skills/
└── aig-seamless-wallet/ ← here
├── SKILL.md
├── guide.md
└── ...
  1. Restart Claude Code.

4. Use​

Start Claude Code in your project directory and type either phrase:

Implement AIG seamless wallet integration
接入 AIG 单一钱包

The AI works through these phases and reports at the end of each one:

PhaseSeamless WalletTransfer Wallet
0Analyse the codebase: framework, config, existing wallet, player IDsSame, plus the background-job mechanism
1Config + sign/verify; the signing test vectors must passConfig + signing + API client
2Idempotency table for callbacksTransfer table
3The 4 callback endpointsDeposit / withdraw / withdraw-all + reconciliation job
4Player registration and game launchPlayer registration and game launch
5Self-test scenariosBet-record sync job
6Handover: changes, env vars, callback URL, open decisionsSelf-test scenarios
7Handover: changes, env vars, egress IPs, open decisions

The AI will ask for the following, so have it ready:

  • Merchant ID (agent_id), merchant secret, and the API gateway (staging: https://staging.aig1234.com)
  • Which player identifier in your system becomes user_id (3–64 chars: letters, digits, _)
  • The currencies you use
  • Seamless Wallet: the callback base URL the game side can reach, e.g. https://wallet.example.com
  • Transfer Wallet: your servers' egress IPs (they must be allow-listed on the game side)
tip

Never put the merchant secret in code or commit it. The AI keeps it in environment variables or config, and you can fill it in yourself at the end.

5. Other AI coding assistants​

Skills are plain Markdown files, so Cursor, GitHub Copilot, Codex and similar tools can use them too. Put the Skill folder in your project (e.g. docs/aig-seamless-wallet/), then send:

Read docs/aig-seamless-wallet/SKILL.md and follow it to integrate the AIG seamless wallet into this project.
Load the other files in that folder as SKILL.md instructs. Follow guide.md phase by phase,
and make the signing test vectors in reference/signing.md pass before implementing the callbacks.

You can add details about your project at the end, such as links to internal docs, the currencies you use, or special requirements.

6. Go-live checklist​

  • All signing test vectors in reference/signing.md pass
  • All scenarios in reference/test-scenarios.md pass
  • The secret exists only in env vars / config and never appears in logs
  • Seamless Wallet: a repeated request for the same bet_txn_id never debits or credits twice, and a bet that arrives after its refund is rejected
  • Transfer Wallet: a timed-out deposit or withdrawal is never marked failed directly; the reconciliation job confirms the final result
  • Joint testing done on staging before switching to production

7. FAQ​

1. The generated code differs from the API reference. Which one is right?​

The Skill includes implementation details beyond the API reference (timeouts, retries, idempotency, failure handling), so the generated code may be stricter than the reference requires. Contact technical support if you have questions.

2. Will the Skill be updated?​

Yes. The download links on this page always serve the latest version. When the API changes, download the Skill again and replace your copy.

3. My project has no wallet system yet. What happens?​

The AI finds this during the analysis phase and asks whether to build a minimal wallet or connect to an external service you already use.