v0.3.0 — align with live 16-contract mainnet (genesis-v2)
- addresses.ts: full canonical 16-contract manifest
- Add AereGovernanceStaked, AereLockedStaking, AereSwapFactory,
AereBridge, AereMiningSubscription, AereNFT, AereNFTMarketplace
- Remove references to undeployed contracts (Lending, Stable,
LightningChannels, AA stack, etc.) — moved to roadmap section
- client.ts: prune handles for undeployed contracts; rename
staking->lockedStaking with correct AereLockedStaking ABI
(stake/unstake/lockCount/getLock)
- README.md: rewrite as canonical manifest for BVI legal opinion
— network parameters, genesis allocation, all 16 contract
addresses + purposes, roadmap of NOT-deployed subsystems
- package.json: bump 0.2.1 -> 0.3.0, add ./addresses subpath export
This commit is contained in:
parent
fc5f9562b9
commit
2b89126004
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
node_modules/
|
||||
dist/
|
||||
*.log
|
||||
.DS_Store
|
||||
152
README.md
152
README.md
@ -1,8 +1,58 @@
|
||||
# @aere/sdk
|
||||
|
||||
Official AERE Network TypeScript SDK. Wraps `ethers v6` with typed contract clients for every deployed AERE L1 contract — staking, lending, stablecoin, swap, bridge, identity (KYC), Lightning channels, ZK rollup, faucet.
|
||||
Official AERE Network TypeScript SDK. Wraps `ethers v6` with typed contract clients for every deployed AERE L1 contract.
|
||||
|
||||
Designed for **Bank28-class neobank backends**: a single `AereClient` gives you everything you need to integrate AERE as the on-chain layer of a regulated neobank.
|
||||
**SDK version:** 0.3.0
|
||||
**Last updated:** 2026-05-31
|
||||
**Network state at this release:** 16 contracts live on chain ID 2800.
|
||||
|
||||
---
|
||||
|
||||
## Network parameters
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Chain name | AERE Network |
|
||||
| Chain ID | 2800 (`0xAF0`) |
|
||||
| Consensus | Hyperledger Besu QBFT, 1-second blocks, sub-second finality, 3 validators |
|
||||
| Native token | AERE (18 decimals) |
|
||||
| Max supply | 2,800,000,000 AERE (capped at genesis-v2, 2026-05-07) |
|
||||
| HTTP RPC | `https://rpc.aere.network` |
|
||||
| WebSocket RPC | `wss://wss.aere.network` |
|
||||
| Explorer (Blockscout) | `https://explorer.aere.network` |
|
||||
| Indexer REST | `https://api.aere.network` |
|
||||
|
||||
## Genesis allocation (2,800,000,000 AERE)
|
||||
|
||||
| Wallet | Allocation | Address |
|
||||
|---|---:|---|
|
||||
| Strategic Investor | 100,000,000 | `0xaee2f3989f0AB23296Fa3b92247fe67587141311` |
|
||||
| Foundation (chain admin) | 180,000,000 | `0x0243A4f47D44b40b65D33f20329dE20D00c6f3C3` |
|
||||
| Mining Reserve | 1,400,000,000 | `0x038f59A40ceeCd599A4588E4B0ff4642a0fbfFB8` |
|
||||
| Ecosystem Reserve | 560,000,000 | `0xB6a364F47d21DC2CbEB803565c111c1026e11C75` |
|
||||
| Team Reserve | 420,000,000 | `0x7968C438204a78B4e032fcFFd9A56Edb15fdCCdf` |
|
||||
| Airdrop Reserve | 140,000,000 | `0x261913fA73D6F109382F1aE98Ff6822ff03628B1` |
|
||||
|
||||
## Deployed contracts (16 — all owned by Foundation)
|
||||
|
||||
| Contract | Address | Purpose |
|
||||
|---|---|---|
|
||||
| WAERE | `0x7e84d7d66d5da4cfE46Da67CDEeB05B323e1f5e8` | Wrapped AERE (WETH9-style ERC-20) |
|
||||
| AereTreasury | `0x687933AE7ea4927867AC227F1b60d476003e6119` | Timelocked foundation treasury |
|
||||
| AereOracle | `0xf0A13823A4bFa86358Fe30aaf1f44A36AcbCf399` | Multi-reporter median price feed (BTC/USD + ETH/USD live) |
|
||||
| AereIdentity | `0x658dD2CD1F798AAb19fEc8FF69A270B2d192CaD1` | DID registry, revocable attestor claims (Sumsub-backed KYC) |
|
||||
| AereFaucet | `0xDdBe942aD9eB0F3E7C541BdCF7CC2cfA29d35aE4` | 0.05 AERE drip per 24h |
|
||||
| AereCardEscrow | `0xD1f7f12830AdCFd1B7676C8460B9e30602b1f059` | Bank28 card-settlement escrow |
|
||||
| AereSecurity | `0xaD305e4D91e0a9160Bd338Fd1ecb2Ee1645daC44` | Sanctions / pause module |
|
||||
| AereStaking | `0xAbDb01d9A4f41792129b2654Fb6DDB9689360DEc` | Delegated staking · 8% APY · 7-day unbonding |
|
||||
| AereConsensus | `0xF8bDDad4aDACF9d38711e8f9aFC8a2697aBF0d47` | QBFT validator bookkeeping |
|
||||
| AereSwapFactory | `0xf0a8df7BDc25721892475B21271e52D77B0e84DC` | V2 AMM factory · 0.3% fee (router pending) |
|
||||
| AereBridge | `0x7eDa66cd93baAE19530839Bbb28ee36aC8aFAd68` | Federated lock-and-release bridge (relayer pending) |
|
||||
| AereMiningSubscription | `0xDad25d2163187DF8AAEcf9EA31b6355315Bb69f1` | 4-tier mining subscriptions (10/50/200/100 AERE per 30 days) |
|
||||
| AereNFT | `0x3f9A9D9CAB005327869396C69bE226ef98039f1c` | ERC-721 + EIP-2981 royalties |
|
||||
| AereNFTMarketplace | `0x852e07F2619F7F4aD10d9f2aC681310301d99528` | On-chain NFT marketplace · 2.5% protocol fee |
|
||||
| AereGovernanceStaked | `0x8D77C888e439C4fADb2e23F1567a0A1965F80bCb` | Stake-weighted governance (reads voting power from AereStaking) |
|
||||
| AereLockedStaking | `0x21108c28A849b05aE6b7a3a5bc435C9Bc897E7Ad` | Fixed-term locks: 30d/10%, 90d/15%, 180d/22%, 365d/30% APY |
|
||||
|
||||
## Install
|
||||
|
||||
@ -13,66 +63,70 @@ npm i @aere/sdk ethers
|
||||
## Quickstart
|
||||
|
||||
```ts
|
||||
import { AereClient } from '@aere/sdk';
|
||||
import { AERE_MAINNET } from '@aere/sdk/addresses';
|
||||
import { ethers } from 'ethers';
|
||||
|
||||
const aere = new AereClient({ privateKey: process.env.OPS_PRIVATE_KEY });
|
||||
const provider = new ethers.JsonRpcProvider(AERE_MAINNET.rpc);
|
||||
|
||||
// Multi-asset balance for a user
|
||||
const portfolio = await aere.getPortfolio('0xUser…');
|
||||
console.log(ethers.formatEther(portfolio.aere), 'AERE');
|
||||
console.log(ethers.formatEther(portfolio.aereUsd), 'AereUSD');
|
||||
// Read a balance
|
||||
const bal = await provider.getBalance(AERE_MAINNET.Foundation);
|
||||
console.log(ethers.formatEther(bal), 'AERE');
|
||||
|
||||
// Lock 100 AERE for 90 days at 15% APY (tier 1)
|
||||
await aere.staking.lockTier90(ethers.parseEther('100'));
|
||||
|
||||
// Attest that the user cleared KYC tier 1 (writes to AereIdentity)
|
||||
const oneYear = Math.floor(Date.now() / 1000) + 365 * 86400;
|
||||
await aere.identity.addClaim(
|
||||
'0xUser…',
|
||||
'kyc-tier-1',
|
||||
ethers.keccak256(ethers.toUtf8Bytes('SUMSUB:applicant-id-12345')),
|
||||
oneYear,
|
||||
// Subscribe to incoming WAERE transfers for an address
|
||||
const waere = new ethers.Contract(
|
||||
AERE_MAINNET.WAERE,
|
||||
['event Transfer(address indexed from, address indexed to, uint256 value)'],
|
||||
provider,
|
||||
);
|
||||
|
||||
// Watch for incoming AERE deposits — for a Bank28 webhook
|
||||
const unsubscribe = await aere.watchTransfersTo('0xUser…', tx => {
|
||||
console.log(`User received ${ethers.formatEther(tx.value)} AERE in tx ${tx.hash}`);
|
||||
// → credit Bank28 user account, fire webhook to UI
|
||||
waere.on('Transfer', (from, to, value) => {
|
||||
if (to.toLowerCase() === '0xMyHotWallet'.toLowerCase()) {
|
||||
console.log(`got ${ethers.formatEther(value)} WAERE from ${from}`);
|
||||
}
|
||||
});
|
||||
|
||||
// Stake 100 AERE in the 90-day locked staking tier (15% APY)
|
||||
const signer = new ethers.Wallet(process.env.PRIVATE_KEY!, provider);
|
||||
const locked = new ethers.Contract(
|
||||
AERE_MAINNET.AereLockedStaking,
|
||||
['function stake(uint8 tier) payable returns (uint256)'],
|
||||
signer,
|
||||
);
|
||||
const tx = await locked.stake(1, { value: ethers.parseEther('100') });
|
||||
await tx.wait();
|
||||
```
|
||||
|
||||
## What's in the box
|
||||
## Roadmap (not in this release)
|
||||
|
||||
- `AereClient` — top-level handle; pass a `privateKey` or `signer`.
|
||||
- `aere.staking` — locked staking V2 (4 tiers, 10–30% APY).
|
||||
- `aere.stakingV1` — delegated 8% APY staking.
|
||||
- `aere.lending` — supply / borrow against AERE collateral.
|
||||
- `aere.stable` — AereUSD CDP-style stablecoin (AERE-collateralised, NOT USD-reserve-backed).
|
||||
- `aere.identity` — KYC attestation registry (`addClaim` / `revokeClaim` / `hasValidClaim`).
|
||||
- `aere.bridge` — federated lock-and-release to ETH/BSC/Polygon/etc.
|
||||
- `aere.swap` — AMM (Uniswap V2 fork) with pair handles.
|
||||
- `aere.lightning` — off-chain payment channels.
|
||||
- `aere.faucet` — programmatic faucet (rarely needed in production).
|
||||
- `aere.waere` — wrapped native AERE for DeFi.
|
||||
- `AERE_MAINNET` — canonical address book + RPC URLs.
|
||||
These are referenced in the AERE whitepaper but **NOT yet deployed on chain 2800**:
|
||||
|
||||
## Network parameters
|
||||
- DEX: `AereSwapRouter` + bridged stablecoin + initial WAERE liquidity pool
|
||||
- Bridge: cross-chain relayer + counterparty contracts on Ethereum / BSC / Polygon
|
||||
- Lending market (collateralised AERE / WAERE)
|
||||
- Yield farm (LP rewards)
|
||||
- AereUSD (over-collateralised stablecoin)
|
||||
- AereVesting (on-chain vesting schedules for Team / Strategic allocations)
|
||||
- AereInsurancePool, AereLaunchpad, AereAirdrop, AereSubscriptions
|
||||
- AereNameService (`.aere` registry)
|
||||
- ERC-4337 account abstraction stack (EntryPoint, SmartAccountFactory, Paymaster)
|
||||
- Payment channels, Lightning channels, HTLC
|
||||
- ZK rollups, Plasma child chains
|
||||
- AereTravelRule (MiCA-compliant VASP transfer disclosures)
|
||||
|
||||
| | |
|
||||
|---|---|
|
||||
| Chain ID | 2800 (`0xAF0`) |
|
||||
| RPC | `https://rpc.aere.network` |
|
||||
| WSS | `wss://wss.aere.network` |
|
||||
| Indexer | `https://api.aere.network` |
|
||||
| Explorer | `https://explorer.aere.network` |
|
||||
Each of these has an existing front-end shell on `aere.network` displaying a "coming soon" notice until the underlying contract ships.
|
||||
|
||||
## Honest constraints
|
||||
## Architectural notes
|
||||
|
||||
- **Non-custodial.** End users hold their own keys. For consumer neobanks use Privy / Magic / Web3Auth to provision wallets via email/social, then pass that signer into `AereClient`.
|
||||
- **No fiat rails.** AERE is the crypto layer. For fiat IBANs / cards / SEPA / KYC ops you need a BaaS partner (Striga, Dipocket, Modulr, Solaris…).
|
||||
- **AereUSD is AERE-collateralised**, not redeemable for fiat. For real USD on-chain, integrate USDC bridged from Ethereum.
|
||||
- **3 validators today** (path to 7 staged). 0-of-3 fault tolerance — production-but-fragile. Plan accordingly.
|
||||
- **Non-custodial.** End users hold their own keys. Consumer apps (e.g. Bank28) can use Privy / Magic / Web3Auth to provision wallets via email/social, then pass that signer into the SDK.
|
||||
- **Fiat rails are out of scope.** AERE is the on-chain settlement layer; fiat IBANs / cards / SEPA come from a BaaS partner (Striga, Baanx, Kulipa, etc.).
|
||||
- **Oracle is single-reporter today.** BTC/USD and ETH/USD feeds are pushed every 90s by a single reporter container. A second reporter is on the roadmap for redundancy.
|
||||
- **3 validators today.** QBFT fault tolerance is `f=0` at this validator count — single failure halts the chain until the validator returns. A path to 5 validators (f=1) is staged.
|
||||
- **AereBridge is 1-of-1 signer.** Multi-sig threshold expansion happens before any value flows.
|
||||
|
||||
## Source
|
||||
|
||||
- SDK source: <https://git.aere.network/aere-network/sdk-js>
|
||||
- Contract source: <https://git.aere.network/aere-network/aerenew>
|
||||
- Website source: <https://git.aere.network/aere-network/blocky-chain-forge>
|
||||
|
||||
## License
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@aere/sdk",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@aere/sdk",
|
||||
"version": "0.2.0",
|
||||
"version": "0.3.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.5.0",
|
||||
|
||||
10
package.json
10
package.json
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@aere/sdk",
|
||||
"version": "0.2.0",
|
||||
"description": "Official AERE Network SDK — wraps ethers v6 with typed contract clients for the deployed AERE L1 contracts (stablecoin, lending, staking, swap, bridge, identity, Lightning, ZK rollup).",
|
||||
"version": "0.3.0",
|
||||
"description": "Official AERE Network SDK — typed ethers v6 client for the 16 contracts deployed on AERE L1 (chain ID 2800). WAERE, oracle, identity, faucet, card-escrow, delegated + locked staking, governance, AMM factory, bridge, NFT + marketplace, mining subscriptions.",
|
||||
"type": "module",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
@ -9,6 +9,10 @@
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.js"
|
||||
},
|
||||
"./addresses": {
|
||||
"types": "./dist/addresses.d.ts",
|
||||
"import": "./dist/addresses.js"
|
||||
}
|
||||
},
|
||||
"files": ["dist", "README.md"],
|
||||
@ -16,7 +20,7 @@
|
||||
"build": "tsc",
|
||||
"test": "node --test dist/test/*.js"
|
||||
},
|
||||
"keywords": ["aere", "blockchain", "ethereum", "evm", "defi", "neobank", "sdk"],
|
||||
"keywords": ["aere", "blockchain", "ethereum", "evm", "layer-1", "qbft", "defi", "sdk"],
|
||||
"homepage": "https://aere.network/docs.html",
|
||||
"repository": "https://git.aere.network/aere-network/sdk-js",
|
||||
"license": "MIT",
|
||||
|
||||
10
src/abis.ts
10
src/abis.ts
@ -21,12 +21,12 @@ export const WAERE_ABI = [
|
||||
'function withdraw(uint256 amount)',
|
||||
] as const;
|
||||
|
||||
// AereLockedStaking — 4 fixed-term tiers (30d/10%, 90d/15%, 180d/22%, 365d/30% APY)
|
||||
export const STAKING_V2_ABI = [
|
||||
'function lock(uint256 tier) external payable', // tier 0..3 → 30/90/180/365 days
|
||||
'function withdraw(uint256 lockId) external',
|
||||
'function earlyExit(uint256 lockId) external',
|
||||
'function getLocks(address user) external view returns (tuple(uint256 amount, uint64 startTime, uint64 unlockTime, uint8 tier, bool withdrawn)[])',
|
||||
'function tierAPY(uint256 tier) external view returns (uint256)', // basis points
|
||||
'function stake(uint8 tier) external payable returns (uint256 lockId)',
|
||||
'function unstake(uint256 lockId) external',
|
||||
'function lockCount(address user) external view returns (uint256)',
|
||||
'function getLock(address user, uint256 lockId) external view returns (tuple(uint8 tier, uint256 amount, uint64 startTime, uint64 unlockTime, bool withdrawn))',
|
||||
'function pendingRewards(address user, uint256 lockId) external view returns (uint256)',
|
||||
] as const;
|
||||
|
||||
|
||||
137
src/addresses.ts
137
src/addresses.ts
@ -1,102 +1,67 @@
|
||||
/**
|
||||
* Canonical AERE Network mainnet contract addresses (chain 2800).
|
||||
* Last updated: 2026-05-03. Source of truth: https://aere.network/docs.html
|
||||
* Last updated: 2026-05-31 · SDK v0.3.0
|
||||
*
|
||||
* Total supply: 2,800,000,000 AERE (capped at genesis-v2, 2026-05-07)
|
||||
* 100M Strategic Investor (0xaee2…1311) — sold off-chain
|
||||
* 180M Foundation (0x0243…f3C3) — chain admin / contract owner
|
||||
* 1.4B Mining Reserve (0x038f…fFB8)
|
||||
* 560M Ecosystem Reserve (0xB6a3…1C75)
|
||||
* 420M Team Reserve (0x7968…CCdf)
|
||||
* 140M Airdrop Reserve (0x2619…28B1)
|
||||
*
|
||||
* Consensus: Hyperledger Besu QBFT, 1-second blocks, sub-second finality, 3 validators.
|
||||
* All Ownable contracts owned by Foundation `0x0243A4f47D44b40b65D33f20329dE20D00c6f3C3`.
|
||||
* Source of truth: https://aere.network/docs.html
|
||||
*/
|
||||
export const AERE_MAINNET = {
|
||||
chainId: 2800,
|
||||
chainIdHex: '0xAF0',
|
||||
rpc: 'https://rpc.aere.network',
|
||||
ws: 'wss://wss.aere.network',
|
||||
explorer: 'https://explorer.aere.network',
|
||||
indexer: 'https://api.aere.network',
|
||||
|
||||
// Core
|
||||
WAERE: '0x805193E3d03AFbffced984f43C10b56D7F7E0b35',
|
||||
AereToken: '0xf0A13823A4bFa86358Fe30aaf1f44A36AcbCf399',
|
||||
AereGovernance: '0x3280518e571fBaB2eF9C7138c1251a89A849f773',
|
||||
AereGovernanceV2: '0xc0F76914d1538c079f07BDeBDd00Ce5b9f791d83',
|
||||
AereTreasury: '0x658dD2CD1F798AAb19fEc8FF69A270B2d192CaD1',
|
||||
AereSecurity: '0x687933AE7ea4927867AC227F1b60d476003e6119',
|
||||
AereConsensus: '0xf0a8df7BDc25721892475B21271e52D77B0e84DC',
|
||||
// ── Genesis wallets ───────────────────────────────────────
|
||||
StrategicInvestor: '0xaee2f3989f0AB23296Fa3b92247fe67587141311',
|
||||
Foundation: '0x0243A4f47D44b40b65D33f20329dE20D00c6f3C3',
|
||||
MiningReserve: '0x038f59A40ceeCd599A4588E4B0ff4642a0fbfFB8',
|
||||
EcosystemReserve: '0xB6a364F47d21DC2CbEB803565c111c1026e11C75',
|
||||
TeamReserve: '0x7968C438204a78B4e032fcFFd9A56Edb15fdCCdf',
|
||||
AirdropReserve: '0x261913fA73D6F109382F1aE98Ff6822ff03628B1',
|
||||
|
||||
// Staking
|
||||
AereStaking: '0x78a72669a8C48FaC02E7BD8C76baEca6e6a809A7',
|
||||
AereStakingV2: '0x1d4444AaD20Beb034c0A97D2E32cdAD06E80e28D',
|
||||
AereYieldFarm: '0xf7C78Cfad1c2CB92051CB1fF7afeaae1A96A7D62',
|
||||
// ── Core contracts (deployed 2026-05-07, owner = Foundation) ──
|
||||
WAERE: '0x7e84d7d66d5da4cfE46Da67CDEeB05B323e1f5e8',
|
||||
AereTreasury: '0x687933AE7ea4927867AC227F1b60d476003e6119',
|
||||
AereOracle: '0xf0A13823A4bFa86358Fe30aaf1f44A36AcbCf399',
|
||||
AereIdentity: '0x658dD2CD1F798AAb19fEc8FF69A270B2d192CaD1',
|
||||
AereFaucet: '0xDdBe942aD9eB0F3E7C541BdCF7CC2cfA29d35aE4',
|
||||
AereCardEscrow: '0xD1f7f12830AdCFd1B7676C8460B9e30602b1f059',
|
||||
AereSecurity: '0xaD305e4D91e0a9160Bd338Fd1ecb2Ee1645daC44',
|
||||
AereStaking: '0xAbDb01d9A4f41792129b2654Fb6DDB9689360DEc', // delegated, 8% APY, 7-day unbonding
|
||||
AereConsensus: '0xF8bDDad4aDACF9d38711e8f9aFC8a2697aBF0d47',
|
||||
|
||||
// DeFi
|
||||
AereSwapFactory: '0xDdBe942aD9eB0F3E7C541BdCF7CC2cfA29d35aE4',
|
||||
AereLending: '0xdAd25D2163187dF8aaecf9eA31b6355315bb69F1',
|
||||
AereStable: '0xa44178085387bcCED29C8d51b05976D5e04D5C0E',
|
||||
AereOracle: '0xebFb8BBc2955719bb11AC460b6fc47f46F3356EB',
|
||||
// ── dApp contracts (deployed 2026-05-22, owner = Foundation) ──
|
||||
AereSwapFactory: '0xf0a8df7BDc25721892475B21271e52D77B0e84DC', // V2 AMM factory (router pending)
|
||||
AereBridge: '0x7eDa66cd93baAE19530839Bbb28ee36aC8aFAd68', // 1-of-1 Foundation signer (relayer pending)
|
||||
AereMiningSubscription: '0xDad25d2163187DF8AAEcf9EA31b6355315Bb69f1', // 4 tiers, 30-day periods
|
||||
AereNFT: '0x3f9A9D9CAB005327869396C69bE226ef98039f1c', // ERC-721 + EIP-2981 royalties
|
||||
AereNFTMarketplace: '0x852e07F2619F7F4aD10d9f2aC681310301d99528', // on-chain marketplace, 2.5% fee
|
||||
|
||||
// Identity / KYC attestation
|
||||
AereIdentity: '0xfd8dF7fc2FB7bA2019c5ef7df31c204589B6DAEe',
|
||||
// ── Governance + locked staking ───────────────────────────
|
||||
AereGovernanceStaked: '0x8D77C888e439C4fADb2e23F1567a0A1965F80bCb', // stake-weighted (reads AereStaking)
|
||||
AereLockedStaking: '0x21108c28A849b05aE6b7a3a5bc435C9Bc897E7Ad', // fixed-term locks: 30d/10%, 90d/15%, 180d/22%, 365d/30% APY
|
||||
|
||||
// Bridge
|
||||
AereBridge: '0x71944DD6A57B9e0530ea86aC577a4F8F57037D7E',
|
||||
AereBridgeCounterparty: '0xda6F00570090eC7759582f0b574269F1d96a7613',
|
||||
WAEREForeign: '0xd7190f47FA7e8D95E5f09f249E479E836CcC1b3f',
|
||||
|
||||
// Faucet / Mining
|
||||
AereFaucet: '0xaD305e4D91e0a9160Bd338Fd1ecb2Ee1645daC44',
|
||||
AereMiningSubscription: '0x267035e16f6F34633fC91f8a410d21A24EB1403E',
|
||||
AereMiningPool: '0x772089A61E9d0C7745bA98487159C688CD9aED5C',
|
||||
|
||||
// Burn / supply
|
||||
AereFeeBurnVault: '0xF0a90fEA2FDA12CC2545ddAa817F5C253F348801',
|
||||
AereDAOBurner: '0x31642bD7901A0405950026072c121bC3Cf25F4fC',
|
||||
|
||||
// NFT
|
||||
AereNFT: '0xeb5420EdabD616499acD037E812cbb6911a890bC',
|
||||
AereNFTMarketplace: '0xF8bDDad4aDACF9d38711e8f9aFC8a2697aBF0d47',
|
||||
|
||||
// Layer 2
|
||||
AerePaymentChannels: '0xAbDb01d9A4f41792129b2654Fb6DDB9689360DEc',
|
||||
AereLightningChannels: '0xc58Fc171C962C1C8AC356538FdFd2E3f04c15B62',
|
||||
AereChannelRegistry: '0x8Eba6a0E0875FE5b02A75cfF09E0fB7ACa9CeDfE',
|
||||
AereHTLC: '0x71851094e5bAaC3e70Ca76A399510B2Ed9100988',
|
||||
AereShardCoordinator: '0x852e07F2619F7F4Ad10D9F2AC681310301d99528',
|
||||
|
||||
// ZK
|
||||
AereZKVerifierGroth16: '0x94AF0740ad4b149F0bb860b0Dda61027322Bc29F',
|
||||
AereZKCommitments: '0x34F7b38dDC6b9d4f2ADC165AcF2b22B2349AA299',
|
||||
AereZKRollup8Verifier: '0xC6936869D0F2eA227d92e0DdC709c6BCB1Cf4548',
|
||||
AereZKRollup8: '0x74cdEbdd929A430037f68CBDB85EC04a89cb623e',
|
||||
AereZKRollup: '0x6F5c279A3436d8b21AF6f8f7E48174A12D4a94a1',
|
||||
AereZKRollupVerifier: '0x99fe69077B3DDaA81B94D0F95f6724F6819CC320',
|
||||
|
||||
// Account Abstraction (ERC-4337-style)
|
||||
AereEntryPoint: '0x7fF2103ecf38B83A86B82fE7Fd84A73B36bc8556',
|
||||
AereSmartAccountFactory: '0xc2a9a5375f2B93C7513240Db75a30F4fb45a5597',
|
||||
AerePaymaster: '0x4c7Ce4051c8C976918DfE5d296A072A63D6e2129',
|
||||
|
||||
// Name service
|
||||
AereNameService: '0x0763e2810F1a1b3FEdd568dDEbCcE61ECa18b272',
|
||||
|
||||
// DeFi extras
|
||||
AereSwapRouter: '0x65d098d8733309785BaD058773C7EA919e0C3162',
|
||||
AereDemoUSD: '0x1cE2949e8cE3f1A77b178aF767a4455c08ec6F82',
|
||||
AereTWAPOracle: '0xf0c8178a5d9feb0f70C5f184e79edeEDaddcF350',
|
||||
WAERE_dUSD_Pair: '0x72F4c32f666a52aD80AE9C621bd8c57870d6508B',
|
||||
|
||||
// Foundation tooling
|
||||
AereMultiSig: '0x30f62deb4fE4e926c414813D4184732d5be181D7',
|
||||
AereVesting: '0x1f921F7c131ae12908f2eB8Ced0D3Dd2d8731Fd6',
|
||||
|
||||
// Recurring payments / launchpad / insurance
|
||||
AereSubscriptions: '0xE6827547d883055DAdC8467d3e6a4F4b89e3c875',
|
||||
AereLaunchpad: '0x33E3B06A7344f0B201fdD11B18bC244c84dbca32',
|
||||
AereInsurancePool: '0xe9Baa9174621845Eb8196238628fdF82c6b7383b',
|
||||
AereMulticall: '0x170ab6DE1686537763759AFaf1c3b7eFd104F4C2',
|
||||
AereAirdrop: '0x7A798085EF4CBAddcEB1C5967aEB5B8A2467828c',
|
||||
|
||||
// Plasma — 6 production chains
|
||||
AerePlasmaChain1: '0xFBd34Ad45ef07b0B7616E77a8a6cef2cb62f98d4',
|
||||
AerePlasmaChain2: '0xE4E53a1eb1F6C40bbD334C191901dBF99BCb8af0',
|
||||
AerePlasmaChain3: '0x584b89a91445BD69F214d30F040E09cA6db9c5c8',
|
||||
AerePlasmaChain4: '0xb5456D48Bfda70635c13b6cBE1ad0310Dc0171aD',
|
||||
AerePlasmaChain5: '0x9CA479c8c52c0EBb4599319a36a5a017BCC70628',
|
||||
AerePlasmaChain6: '0xA6BFECa9f5d6E7728883e71A10006Cd522Fe40b3',
|
||||
// ── Deferred to future phases (not yet deployed) ──────────
|
||||
// AereSwapRouter, AereLending, AereYieldFarm, dUSD stablecoin,
|
||||
// AereVesting, AereInsurancePool, AereLaunchpad, AereAirdrop, AereMultiSig,
|
||||
// AereNameService, AereSubscriptions, AereFeeBurnVault,
|
||||
// AereHTLC, AerePaymentChannels, AereLightningChannels, AereChannelRegistry,
|
||||
// AereEntryPoint (ERC-4337), AereSmartAccountFactory, AerePaymaster,
|
||||
// AereZK*, AerePlasmaRootV2 x6, AereL2Inbox x8, AereTravelRule
|
||||
} as const;
|
||||
|
||||
export type AereContractName = keyof Omit<typeof AERE_MAINNET, 'chainId' | 'rpc' | 'ws' | 'explorer' | 'indexer'>;
|
||||
export type AereContractName = keyof Omit<
|
||||
typeof AERE_MAINNET,
|
||||
'chainId' | 'chainIdHex' | 'rpc' | 'ws' | 'explorer' | 'indexer'
|
||||
>;
|
||||
|
||||
@ -4,8 +4,8 @@ import {
|
||||
} from 'ethers';
|
||||
import { AERE_MAINNET } from './addresses.js';
|
||||
import {
|
||||
ERC20_ABI, WAERE_ABI, STAKING_V2_ABI, STAKING_V1_ABI, LENDING_ABI, STABLE_ABI,
|
||||
IDENTITY_ABI, BRIDGE_ABI, FAUCET_ABI, SWAP_FACTORY_ABI, SWAP_PAIR_ABI, LIGHTNING_CHANNELS_ABI,
|
||||
ERC20_ABI, WAERE_ABI, STAKING_V2_ABI, STAKING_V1_ABI,
|
||||
IDENTITY_ABI, BRIDGE_ABI, FAUCET_ABI, SWAP_FACTORY_ABI, SWAP_PAIR_ABI,
|
||||
} from './abis.js';
|
||||
|
||||
export interface AereClientOptions {
|
||||
@ -77,21 +77,20 @@ export class AereClient {
|
||||
};
|
||||
}
|
||||
|
||||
/** AereStakingV2 — locked-period staking with 4 tiers (30/90/180/365 days, 10/15/22/30% APY) */
|
||||
get staking() {
|
||||
const c = this.contract(this.addresses.AereStakingV2, STAKING_V2_ABI, true);
|
||||
/** AereLockedStaking — fixed-term locks · 4 tiers (30/90/180/365 days, 10/15/22/30% APY) */
|
||||
get lockedStaking() {
|
||||
const c = this.contract(this.addresses.AereLockedStaking, STAKING_V2_ABI, true);
|
||||
return {
|
||||
contract: c,
|
||||
tierAPY: (tier: 0 | 1 | 2 | 3) => c.tierAPY(tier) as Promise<bigint>,
|
||||
lock: (tier: 0 | 1 | 2 | 3, amountWei: bigint) => c.lock(tier, { value: amountWei }),
|
||||
lockTier30: (a: bigint) => c.lock(0, { value: a }),
|
||||
lockTier90: (a: bigint) => c.lock(1, { value: a }),
|
||||
lockTier180: (a: bigint) => c.lock(2, { value: a }),
|
||||
lockTier365: (a: bigint) => c.lock(3, { value: a }),
|
||||
withdraw: (lockId: number) => c.withdraw(lockId),
|
||||
earlyExit: (lockId: number) => c.earlyExit(lockId),
|
||||
getLocks: (user: string) => c.getLocks(user),
|
||||
pendingRewards: (user: string, lockId: number) => c.pendingRewards(user, lockId) as Promise<bigint>,
|
||||
stake: (tier: 0 | 1 | 2 | 3, amountWei: bigint) => c.stake(tier, { value: amountWei }),
|
||||
stakeTier30: (a: bigint) => c.stake(0, { value: a }),
|
||||
stakeTier90: (a: bigint) => c.stake(1, { value: a }),
|
||||
stakeTier180: (a: bigint) => c.stake(2, { value: a }),
|
||||
stakeTier365: (a: bigint) => c.stake(3, { value: a }),
|
||||
unstake: (lockId: number | bigint) => c.unstake(lockId),
|
||||
lockCount: (user: string) => c.lockCount(user) as Promise<bigint>,
|
||||
getLock: (user: string, lockId: number | bigint) => c.getLock(user, lockId),
|
||||
pendingRewards: (user: string, lockId: number | bigint) => c.pendingRewards(user, lockId) as Promise<bigint>,
|
||||
};
|
||||
}
|
||||
|
||||
@ -109,38 +108,6 @@ export class AereClient {
|
||||
};
|
||||
}
|
||||
|
||||
/** AereLending — supply / borrow against AERE collateral */
|
||||
get lending() {
|
||||
const c = this.contract(this.addresses.AereLending, LENDING_ABI, true);
|
||||
return {
|
||||
contract: c,
|
||||
supply: (amountWei: bigint) => c.supply(amountWei, { value: amountWei }),
|
||||
withdraw: (amount: bigint) => c.withdraw(amount),
|
||||
lockCollateral: (amountWei: bigint) => c.lockCollateral(amountWei, { value: amountWei }),
|
||||
borrow: (amount: bigint) => c.borrow(amount),
|
||||
repay: (amountWei: bigint) => c.repay(amountWei, { value: amountWei }),
|
||||
getAccount: (user: string) => c.getAccount(user),
|
||||
supplyAPY: () => c.supplyAPY() as Promise<bigint>,
|
||||
borrowAPY: () => c.borrowAPY() as Promise<bigint>,
|
||||
ltvLimit: () => c.ltvLimit() as Promise<bigint>,
|
||||
};
|
||||
}
|
||||
|
||||
/** AereStable (AereUSD) — CDP-style stablecoin · AERE-collateralised, NOT USD-reserve-backed */
|
||||
get stable() {
|
||||
const c = this.contract(this.addresses.AereStable, STABLE_ABI, true);
|
||||
return {
|
||||
contract: c,
|
||||
balanceOf: (a: string) => c.balanceOf(a) as Promise<bigint>,
|
||||
depositCollateral: (amountWei: bigint) => c.depositCollateral({ value: amountWei }),
|
||||
withdrawCollateral: (amount: bigint) => c.withdrawCollateral(amount),
|
||||
mint: (amount: bigint) => c.mint(amount),
|
||||
burn: (amount: bigint) => c.burn(amount),
|
||||
getVault: (user: string) => c.getVault(user),
|
||||
collateralRatio: (user: string) => c.collateralRatio(user) as Promise<bigint>,
|
||||
};
|
||||
}
|
||||
|
||||
/** AereIdentity — DID / KYC attestation registry */
|
||||
get identity() {
|
||||
const c = this.contract(this.addresses.AereIdentity, IDENTITY_ABI, true);
|
||||
@ -193,19 +160,6 @@ export class AereClient {
|
||||
};
|
||||
}
|
||||
|
||||
/** AereLightningChannels — off-chain payment channels with HTLCs */
|
||||
get lightning() {
|
||||
const c = this.contract(this.addresses.AereLightningChannels, LIGHTNING_CHANNELS_ABI, true);
|
||||
return {
|
||||
contract: c,
|
||||
open: (counterparty: string, depositWei: bigint) =>
|
||||
c.open(counterparty, { value: depositWei }),
|
||||
fund: (id: bigint, amountWei: bigint) => c.fund(id, { value: amountWei }),
|
||||
channels: (id: bigint) => c.channels(id),
|
||||
getHTLCs: (id: bigint) => c.getHTLCs(id),
|
||||
};
|
||||
}
|
||||
|
||||
// ────────────────────────────── Higher-level helpers ──────────────────────────────
|
||||
|
||||
/** Convenience: ERC-20 balance for any token (USDC bridged from Ethereum, etc.) */
|
||||
@ -222,18 +176,16 @@ export class AereClient {
|
||||
return tx.hash;
|
||||
}
|
||||
|
||||
/** Convenience: aggregate a Bank28-style multi-asset balance for a user */
|
||||
/** Convenience: aggregate a Bank28-style multi-asset balance for a user (AERE + WAERE) */
|
||||
async getPortfolio(user: string): Promise<{
|
||||
aere: bigint;
|
||||
waere: bigint;
|
||||
aereUsd: bigint;
|
||||
}> {
|
||||
const [aere, waere, aereUsd] = await Promise.all([
|
||||
const [aere, waere] = await Promise.all([
|
||||
this.getNativeBalance(user),
|
||||
this.waere.balanceOf(user),
|
||||
this.stable.balanceOf(user),
|
||||
]);
|
||||
return { aere, waere, aereUsd };
|
||||
return { aere, waere };
|
||||
}
|
||||
|
||||
/** Subscribe to new blocks via WebSocket. Returns an unsubscribe fn. */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user