@andrewkimjoseph/celina-sdk 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/README.md +22 -9
  2. package/build/abis/gooddollar-broker.d.ts +77 -0
  3. package/build/abis/gooddollar-broker.js +44 -0
  4. package/build/abis/gooddollar-broker.js.map +1 -0
  5. package/build/analytics/mcp-tool-events.js +3 -0
  6. package/build/analytics/mcp-tool-events.js.map +1 -1
  7. package/build/config/gooddollar.d.ts +12 -0
  8. package/build/config/gooddollar.js +19 -0
  9. package/build/config/gooddollar.js.map +1 -1
  10. package/build/index.d.ts +3 -2
  11. package/build/index.js +1 -1
  12. package/build/index.js.map +1 -1
  13. package/build/services/ens.service.d.ts +1 -1
  14. package/build/services/ens.service.js +1 -1
  15. package/build/services/gooddollar.service.d.ts +57 -1
  16. package/build/services/gooddollar.service.js +256 -4
  17. package/build/services/gooddollar.service.js.map +1 -1
  18. package/build/services/transaction.service.d.ts +1 -1
  19. package/build/services/transaction.service.js +1 -1
  20. package/build/tools/domains/browser.js +3 -3
  21. package/build/tools/domains/browser.js.map +1 -1
  22. package/build/tools/domains/gooddollar.js +82 -1
  23. package/build/tools/domains/gooddollar.js.map +1 -1
  24. package/build/tools/schemas/common.d.ts +39 -0
  25. package/build/tools/schemas/common.js +11 -1
  26. package/build/tools/schemas/common.js.map +1 -1
  27. package/build/tools/swap-routing.d.ts +2 -2
  28. package/build/tools/swap-routing.js +68 -7
  29. package/build/tools/swap-routing.js.map +1 -1
  30. package/build/tools/types.d.ts +8 -0
  31. package/build/types/prepared.d.ts +1 -1
  32. package/package.json +1 -1
  33. package/tests/catalog/domains/defi.ts +179 -0
package/README.md CHANGED
@@ -16,7 +16,7 @@ Celina is layered from chain logic through agent tooling:
16
16
  |-------|---------|------|
17
17
  | **SDK** | `@andrewkimjoseph/celina-sdk` | Reads, gas estimates, `prepare*` flows, Carbon REST + SDK hybrid |
18
18
  | **MCP** | `@andrewkimjoseph/celina-mcp` | MCP tools for Cursor / Claude / LM Studio — stdio writes or hosted reads + Carbon prepare |
19
- | **MCP host** | `celina-mcp-host` | Vercel Streamable HTTP — hosted reads + Carbon prepare (72 tools); no server-key writes or `execute_carbon_*` |
19
+ | **MCP host** | `celina-mcp-host` | Vercel Streamable HTTP — hosted reads + Carbon prepare (75 tools); no server-key writes or `execute_carbon_*` |
20
20
 
21
21
  This repo is the **SDK**. Downstream packages depend on published npm semver (no local `file:` links in production).
22
22
 
@@ -42,7 +42,7 @@ For MCP servers and chat APIs (Vercel AI SDK, etc.), import shared tool definiti
42
42
  - [Prepared flows](docs/concepts/prepared-flows.md) — `SerializedPreparedFlow`, CELINA calldata tag
43
43
  - [wagmi integration](https://andrewkimjoseph.gitbook.io/celina-sdk/guides/wagmi-integration)
44
44
  - [Carbon DeFi on Celo](docs/guides/carbon.md) — hybrid REST + `@bancor/carbon-sdk` (25 operations)
45
- - [GoodDollar UBI](docs/guides/gooddollar.md) — whitelist, daily entitlement, `prepareClaimUbi`
45
+ - [GoodDollar](docs/guides/gooddollar.md) — UBI whitelist/claim and G$ ↔ USDm reserve swaps
46
46
  - [Self Agent ID](docs/guides/self-agent-id.md) — verify, register, refresh human-backed agents
47
47
  - [Telemetry](docs/guides/telemetry.md) — optional Amplitude read metrics (`CELINA_ANALYTICS_DISABLED=1`)
48
48
  - [API reference](https://andrewkimjoseph.gitbook.io/celina-sdk/api-reference)
@@ -59,7 +59,7 @@ const celina = createCelinaClient();
59
59
  await celina.token.getStablecoinBalances("0xYourAddress");
60
60
 
61
61
  const flow = await celina.transaction.prepareSend("0xFrom", "0xTo", "USDm", "10");
62
- // flow.steps → pass to wagmi sendTransaction (calldata includes CELINA attribution suffix)
62
+ // flow.steps → pass to wagmi sendTransactionAsync (calldata includes CELINA attribution suffix)
63
63
 
64
64
  // Carbon DeFi (reads + unsigned strategy/trade prep)
65
65
  const strategies = await celina.carbon.getStrategies("0xYourAddress");
@@ -78,6 +78,16 @@ const prepared = await celina.carbon.prepareLimitOrder({
78
78
  // GoodDollar UBI (reads + unsigned claim)
79
79
  const eligibility = await celina.gooddollar.getUbiClaimEligibility("0xYourAddress");
80
80
  const ubiFlow = await celina.gooddollar.prepareClaimUbi("0xYourAddress");
81
+
82
+ // GoodDollar reserve (G$ ↔ USDm — bonding curve, not Uniswap)
83
+ const reserveQuote = await celina.gooddollar.getReserveQuote("GoodDollar", "USDm", "1000");
84
+ // reserveQuote.protocol === "gooddollar_reserve"
85
+ const reserveFlow = await celina.gooddollar.prepareReserveSwap(
86
+ "0xFrom",
87
+ "GoodDollar",
88
+ "USDm",
89
+ "1000",
90
+ );
81
91
  ```
82
92
 
83
93
  ## Prepared flows and calldata tagging
@@ -101,7 +111,7 @@ Hybrid **Carbon REST** (`https://mcp.carbondefi.xyz`) plus **`@bancor/carbon-sdk
101
111
  - **`deep_link`** on prepare responses — Carbon REST trade/disposable UI URL (reference only; signing is via your wallet flow).
102
112
  - **`carbonActivityDeepLink(wallet)`** — post-execution activity explorer on [celo.carbondefi.xyz](https://celo.carbondefi.xyz).
103
113
 
104
- Set `CARBON_API_BASE_URL` to override the REST base. Hosted MCP exposes **72 tools** (reads + Carbon prepare); `execute_carbon_*` requires local stdio with `CELO_PRIVATE_KEY`.
114
+ Set `CARBON_API_BASE_URL` to override the REST base. Hosted MCP exposes **75 tools** (reads + Carbon prepare); `execute_carbon_*` and server-key writes require local stdio with `CELO_PRIVATE_KEY`.
105
115
 
106
116
  ### MCP session wallet (not in the SDK)
107
117
 
@@ -109,21 +119,23 @@ Local **celina-mcp** with `CELO_PRIVATE_KEY` can omit wallet params on many tool
109
119
 
110
120
  Full workflow: [Carbon DeFi guide](docs/guides/carbon.md).
111
121
 
112
- ## GoodDollar UBI
122
+ ## GoodDollar
113
123
 
114
- Identity whitelist reads, daily entitlement checks, and unsigned `UBISchemeV2.claim()` preparation. One claim per verified identity per day.
124
+ Identity whitelist reads, daily UBI entitlement, unsigned UBI claim, and **G$ USDm reserve swaps** via the on-chain MentoBroker bonding curve.
115
125
 
116
126
  | Reads | Prepare |
117
127
  |-------|---------|
118
- | `getWhitelistingInfo`, `getUbiClaimEligibility` | `prepareClaimUbi` |
128
+ | `getWhitelistingInfo`, `getUbiClaimEligibility`, `getReserveQuote` | `prepareClaimUbi`, `prepareReserveSwap` |
129
+
130
+ For **G$ ↔ USDm**, use `getReserveQuote` / `prepareReserveSwap` (or aggregated `getSwapQuoteWithFallback` from `@andrewkimjoseph/celina-sdk/tools`) — not Uniswap. For other G$ pairs (e.g. G$ → USDT), Uniswap v4 remains the AMM fallback.
119
131
 
120
- MCP: `get_gooddollar_whitelisting_info`, `get_gooddollar_ubi_entitlement` (read); `claim_daily_gooddollar_ubi` (stdio write with server key). Browser apps: `prepareClaimUbi` + wagmi.
132
+ MCP: `get_gooddollar_whitelisting_info`, `get_gooddollar_ubi_entitlement`, `get_gooddollar_reserve_quote`, `estimate_gooddollar_reserve_swap`, `execute_gooddollar_reserve_swap` (stdio write with server key); `claim_daily_gooddollar_ubi` (stdio UBI write). Browser apps: `prepareClaimUbi`, `prepareReserveSwap`, or `prepare_swap` + wagmi.
121
133
 
122
134
  [GoodDollar guide](docs/guides/gooddollar.md)
123
135
 
124
136
  ## Related packages
125
137
 
126
- - [`@andrewkimjoseph/celina-mcp`](https://www.npmjs.com/package/@andrewkimjoseph/celina-mcp) `@0.8.5` — MCP server (`get_wallet_address`, optional address on wallet-scoped tools; 85 tools stdio, 72 hosted)
138
+ - [`@andrewkimjoseph/celina-mcp`](https://www.npmjs.com/package/@andrewkimjoseph/celina-mcp) `@0.8.13` — MCP server (`get_wallet_address`, optional address on wallet-scoped tools; 88 tools stdio, 75 hosted)
127
139
  - [`celina-mcp-host`](../celina-mcp-host/) — Vercel-hosted MCP endpoint (`https://mcp.usecelina.xyz/api/mcp`) — reads + Carbon prepare
128
140
  - [`@selfxyz/agent-sdk`](https://www.npmjs.com/package/@selfxyz/agent-sdk) — Self Agent ID browser flows
129
141
 
@@ -131,6 +143,7 @@ MCP: `get_gooddollar_whitelisting_info`, `get_gooddollar_ubi_entitlement` (read)
131
143
 
132
144
  - [x] Mento FX routing (`getFxQuote`, `estimateFx`, `prepareFx`)
133
145
  - [x] Uniswap v4 swaps (`getSwapQuote`, `estimateSwap`, `prepareSwap`)
146
+ - [x] GoodDollar reserve swaps (`getReserveQuote`, `prepareReserveSwap`) — G$ ↔ USDm via MentoBroker
134
147
  - [x] Aave lending tools (`prepareSupply`, `prepareWithdraw`) — USDT, WETH, USDm, USDC, CELO, EURm
135
148
  - [x] Self proof verification (`verifySelfAgent`, `verifySelfRequest`, ai.self.xyz)
136
149
  - [x] Self Agent ID (`lookupSelfAgent`, registration & lifecycle tools)
@@ -0,0 +1,77 @@
1
+ /** GoodDollar MentoBroker on Celo — reserve swap quotes and execution. */
2
+ export declare const goodDollarBrokerAbi: readonly [{
3
+ readonly type: "function";
4
+ readonly name: "getAmountOut";
5
+ readonly inputs: readonly [{
6
+ readonly name: "exchangeProvider";
7
+ readonly type: "address";
8
+ }, {
9
+ readonly name: "exchangeId";
10
+ readonly type: "bytes32";
11
+ }, {
12
+ readonly name: "tokenIn";
13
+ readonly type: "address";
14
+ }, {
15
+ readonly name: "tokenOut";
16
+ readonly type: "address";
17
+ }, {
18
+ readonly name: "amountIn";
19
+ readonly type: "uint256";
20
+ }];
21
+ readonly outputs: readonly [{
22
+ readonly name: "";
23
+ readonly type: "uint256";
24
+ }];
25
+ readonly stateMutability: "view";
26
+ }, {
27
+ readonly type: "function";
28
+ readonly name: "getAmountIn";
29
+ readonly inputs: readonly [{
30
+ readonly name: "exchangeProvider";
31
+ readonly type: "address";
32
+ }, {
33
+ readonly name: "exchangeId";
34
+ readonly type: "bytes32";
35
+ }, {
36
+ readonly name: "tokenIn";
37
+ readonly type: "address";
38
+ }, {
39
+ readonly name: "tokenOut";
40
+ readonly type: "address";
41
+ }, {
42
+ readonly name: "amountOut";
43
+ readonly type: "uint256";
44
+ }];
45
+ readonly outputs: readonly [{
46
+ readonly name: "";
47
+ readonly type: "uint256";
48
+ }];
49
+ readonly stateMutability: "view";
50
+ }, {
51
+ readonly type: "function";
52
+ readonly name: "swapIn";
53
+ readonly inputs: readonly [{
54
+ readonly name: "exchangeProvider";
55
+ readonly type: "address";
56
+ }, {
57
+ readonly name: "exchangeId";
58
+ readonly type: "bytes32";
59
+ }, {
60
+ readonly name: "tokenIn";
61
+ readonly type: "address";
62
+ }, {
63
+ readonly name: "tokenOut";
64
+ readonly type: "address";
65
+ }, {
66
+ readonly name: "amountIn";
67
+ readonly type: "uint256";
68
+ }, {
69
+ readonly name: "amountOutMin";
70
+ readonly type: "uint256";
71
+ }];
72
+ readonly outputs: readonly [{
73
+ readonly name: "amountOut";
74
+ readonly type: "uint256";
75
+ }];
76
+ readonly stateMutability: "nonpayable";
77
+ }];
@@ -0,0 +1,44 @@
1
+ /** GoodDollar MentoBroker on Celo — reserve swap quotes and execution. */
2
+ export const goodDollarBrokerAbi = [
3
+ {
4
+ type: "function",
5
+ name: "getAmountOut",
6
+ inputs: [
7
+ { name: "exchangeProvider", type: "address" },
8
+ { name: "exchangeId", type: "bytes32" },
9
+ { name: "tokenIn", type: "address" },
10
+ { name: "tokenOut", type: "address" },
11
+ { name: "amountIn", type: "uint256" },
12
+ ],
13
+ outputs: [{ name: "", type: "uint256" }],
14
+ stateMutability: "view",
15
+ },
16
+ {
17
+ type: "function",
18
+ name: "getAmountIn",
19
+ inputs: [
20
+ { name: "exchangeProvider", type: "address" },
21
+ { name: "exchangeId", type: "bytes32" },
22
+ { name: "tokenIn", type: "address" },
23
+ { name: "tokenOut", type: "address" },
24
+ { name: "amountOut", type: "uint256" },
25
+ ],
26
+ outputs: [{ name: "", type: "uint256" }],
27
+ stateMutability: "view",
28
+ },
29
+ {
30
+ type: "function",
31
+ name: "swapIn",
32
+ inputs: [
33
+ { name: "exchangeProvider", type: "address" },
34
+ { name: "exchangeId", type: "bytes32" },
35
+ { name: "tokenIn", type: "address" },
36
+ { name: "tokenOut", type: "address" },
37
+ { name: "amountIn", type: "uint256" },
38
+ { name: "amountOutMin", type: "uint256" },
39
+ ],
40
+ outputs: [{ name: "amountOut", type: "uint256" }],
41
+ stateMutability: "nonpayable",
42
+ },
43
+ ];
44
+ //# sourceMappingURL=gooddollar-broker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gooddollar-broker.js","sourceRoot":"","sources":["../../src/abis/gooddollar-broker.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,cAAc;QACpB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;SACtC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,aAAa;QACnB,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE;SACvC;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACxC,eAAe,EAAE,MAAM;KACxB;IACD;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,QAAQ;QACd,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,SAAS,EAAE;YAC7C,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE;YACvC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;YACpC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YACrC,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAE;SAC1C;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QACjD,eAAe,EAAE,YAAY;KAC9B;CACO,CAAC"}
@@ -25,6 +25,9 @@ export const MCP_TOOL_EVENT_BY_SDK_METHOD = {
25
25
  "contract.callFunction": "call_contract_function",
26
26
  "contract.estimateGas": "estimate_contract_gas",
27
27
  "ens.resolveEns": "resolve_ens",
28
+ "gooddollar.estimateReserveSwap.sell": "estimate_gooddollar_reserve_swap",
29
+ "gooddollar.getReserveQuote.buy": "get_gooddollar_reserve_quote",
30
+ "gooddollar.getReserveQuote.sell": "get_gooddollar_reserve_quote",
28
31
  "gooddollar.getUbiClaimEligibility": "get_gooddollar_ubi_entitlement",
29
32
  "gooddollar.getWhitelistingInfo": "get_gooddollar_whitelisting_info",
30
33
  "governance.getGovernanceProposals": "get_governance_proposals",
@@ -1 +1 @@
1
- {"version":3,"file":"mcp-tool-events.js","sourceRoot":"","sources":["../../src/analytics/mcp-tool-events.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,M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,EAAE,sBAAsB;IACvD,oBAAoB,EAAE,mBAAmB;IACzC,oBAAoB,EAAE,oBAAoB;IAC1C,mBAAmB,EAAE,iBAAiB;IACtC,gBAAgB,EAAE,cAAc;IAChC,6BAA6B,EAAE,0BAA0B;IACzD,4BAA4B,EAAE,yBAAyB;IACvD,sBAAsB,EAAE,mBAAmB;IAC3C,sBAAsB,EAAE,mBAAmB;IAC3C,sBAAsB,EAAE,mBAAmB;IAC3C,sBAAsB,EAAE,mBAAmB;IAC3C,wBAAwB,EAAE,qBAAqB;IAC/C,8BAA8B,EAAE,wBAAwB;IACxD,4BAA4B,EAAE,sBAAsB;IACpD,6BAA6B,EAAE,wBAAwB;IACvD,kCAAkC,EAAE,6BAA6B;IACjE,4BAA4B,EAAE,sBAAsB;IACpD,mBAAmB,EAAE,mBAAmB;IACxC,6BAA6B,EAAE,yBAAyB;IACxD,uBAAuB,EAAE,mBAAmB;IAC5C,oBAAoB,EAAE,gBAAgB;IACtC,0BAA0B,EAAE,eAAe;IAC3C,iCAAiC,EAAE,sBAAsB;IACzD,2BAA2B,EAAE,kBAAkB;IAC/C,sBAAsB,EAAE,uBAAuB;IAC/C,sBAAsB,EAAE,mBAAmB;CACnC,CAAC"}
@@ -2,3 +2,15 @@
2
2
  export declare const GOODDOLLAR_IDENTITY_ADDRESS: "0xC361A6E67822a0EDc17D899227dd9FC50BD62F42";
3
3
  /** GoodDollar UBISchemeV2 contract on Celo mainnet. */
4
4
  export declare const GOODDOLLAR_UBI_SCHEME_ADDRESS: "0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1";
5
+ /** GoodDollar G$ token on Celo mainnet (SuperGoodDollar). */
6
+ export declare const GOODDOLLAR_TOKEN_ADDRESS: "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A";
7
+ /** MentoBroker proxy — user-facing entry for G$ reserve swaps on Celo. */
8
+ export declare const GOODDOLLAR_MENTO_BROKER: "0x88de45906D4F5a57315c133620cfa484cB297541";
9
+ /** GoodDollar MentoExchangeProvider on Celo mainnet. */
10
+ export declare const GOODDOLLAR_MENTO_EXCHANGE_PROVIDER: "0x2fFBB49055d487DdBBb0C052Cd7c2a02A7971e41";
11
+ /** Exchange pool id for G$ ↔ USDm (CUSD in GoodProtocol deployment). */
12
+ export declare const GOODDOLLAR_CUSD_EXCHANGE_ID: "0xba77f5c7bb3317643c6d81d1ef3f9913561741d92095f88efa402faf2cbe9124";
13
+ /** Reserve collateral token (USDm / cUSD) for the G$ pool on Celo. */
14
+ export declare const GOODDOLLAR_RESERVE_COLLATERAL: "0x765DE816845861e75A25fCA122bb6898B8B1282a";
15
+ /** Whether both tokens form a supported GoodDollar reserve pair (G$ ↔ USDm). */
16
+ export declare function isGoodDollarUsdReservePair(tokenIn: string, tokenOut: string): boolean;
@@ -2,4 +2,23 @@
2
2
  export const GOODDOLLAR_IDENTITY_ADDRESS = "0xC361A6E67822a0EDc17D899227dd9FC50BD62F42";
3
3
  /** GoodDollar UBISchemeV2 contract on Celo mainnet. */
4
4
  export const GOODDOLLAR_UBI_SCHEME_ADDRESS = "0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1";
5
+ /** GoodDollar G$ token on Celo mainnet (SuperGoodDollar). */
6
+ export const GOODDOLLAR_TOKEN_ADDRESS = "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A";
7
+ /** MentoBroker proxy — user-facing entry for G$ reserve swaps on Celo. */
8
+ export const GOODDOLLAR_MENTO_BROKER = "0x88de45906D4F5a57315c133620cfa484cB297541";
9
+ /** GoodDollar MentoExchangeProvider on Celo mainnet. */
10
+ export const GOODDOLLAR_MENTO_EXCHANGE_PROVIDER = "0x2fFBB49055d487DdBBb0C052Cd7c2a02A7971e41";
11
+ /** Exchange pool id for G$ ↔ USDm (CUSD in GoodProtocol deployment). */
12
+ export const GOODDOLLAR_CUSD_EXCHANGE_ID = "0xba77f5c7bb3317643c6d81d1ef3f9913561741d92095f88efa402faf2cbe9124";
13
+ /** Reserve collateral token (USDm / cUSD) for the G$ pool on Celo. */
14
+ export const GOODDOLLAR_RESERVE_COLLATERAL = "0x765DE816845861e75A25fCA122bb6898B8B1282a";
15
+ const GOODDOLLAR_SYMBOLS = new Set(["gooddollar", "g$"]);
16
+ const RESERVE_COLLATERAL_SYMBOLS = new Set(["usdm", "cusd"]);
17
+ /** Whether both tokens form a supported GoodDollar reserve pair (G$ ↔ USDm). */
18
+ export function isGoodDollarUsdReservePair(tokenIn, tokenOut) {
19
+ const a = tokenIn.trim().toLowerCase();
20
+ const b = tokenOut.trim().toLowerCase();
21
+ return ((GOODDOLLAR_SYMBOLS.has(a) && RESERVE_COLLATERAL_SYMBOLS.has(b)) ||
22
+ (GOODDOLLAR_SYMBOLS.has(b) && RESERVE_COLLATERAL_SYMBOLS.has(a)));
23
+ }
5
24
  //# sourceMappingURL=gooddollar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gooddollar.js","sourceRoot":"","sources":["../../src/config/gooddollar.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,CAAC,MAAM,2BAA2B,GACtC,4CAAqD,CAAC;AAExD,uDAAuD;AACvD,MAAM,CAAC,MAAM,6BAA6B,GACxC,4CAAqD,CAAC"}
1
+ {"version":3,"file":"gooddollar.js","sourceRoot":"","sources":["../../src/config/gooddollar.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,MAAM,CAAC,MAAM,2BAA2B,GACtC,4CAAqD,CAAC;AAExD,uDAAuD;AACvD,MAAM,CAAC,MAAM,6BAA6B,GACxC,4CAAqD,CAAC;AAExD,6DAA6D;AAC7D,MAAM,CAAC,MAAM,wBAAwB,GACnC,4CAAqD,CAAC;AAExD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,uBAAuB,GAClC,4CAAqD,CAAC;AAExD,wDAAwD;AACxD,MAAM,CAAC,MAAM,kCAAkC,GAC7C,4CAAqD,CAAC;AAExD,wEAAwE;AACxE,MAAM,CAAC,MAAM,2BAA2B,GACtC,oEAA6E,CAAC;AAEhF,sEAAsE;AACtE,MAAM,CAAC,MAAM,6BAA6B,GACxC,4CAAqD,CAAC;AAExD,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC,CAAC;AACzD,MAAM,0BAA0B,GAAG,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAE7D,gFAAgF;AAChF,MAAM,UAAU,0BAA0B,CAAC,OAAe,EAAE,QAAgB;IAC1E,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,MAAM,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO,CACL,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,0BAA0B,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CACjE,CAAC;AACJ,CAAC"}
package/build/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export interface CelinaClient {
32
32
  uniswap: UniswapService;
33
33
  /** Aave V3 `prepareSupply` and `prepareWithdraw` flows on Celo. */
34
34
  aave: AaveService;
35
- /** GoodDollar IdentityV4 whitelist status and daily UBI claim preparation. */
35
+ /** GoodDollar IdentityV4 whitelist, UBI claims, and G$ USDm reserve swaps. */
36
36
  gooddollar: GoodDollarService;
37
37
  /** Celo and Ethereum ENS resolution. */
38
38
  ens: EnsService;
@@ -81,7 +81,8 @@ export { AAVE_POOL, AAVE_SUPPORTED_SYMBOLS, resolveAaveAsset, } from "./config/a
81
81
  export { CHAIN, DEFAULT_RPC_URL } from "./config/chains.js";
82
82
  export { appendCelinaCalldataTag, CELINA_DATA_SUFFIX, } from "./config/celina-tag.js";
83
83
  export type { AaveAsset } from "./config/aave.js";
84
- export { GOODDOLLAR_IDENTITY_ADDRESS, GOODDOLLAR_UBI_SCHEME_ADDRESS, } from "./config/gooddollar.js";
84
+ export { GOODDOLLAR_CUSD_EXCHANGE_ID, GOODDOLLAR_IDENTITY_ADDRESS, GOODDOLLAR_MENTO_BROKER, GOODDOLLAR_MENTO_EXCHANGE_PROVIDER, GOODDOLLAR_RESERVE_COLLATERAL, GOODDOLLAR_TOKEN_ADDRESS, GOODDOLLAR_UBI_SCHEME_ADDRESS, isGoodDollarUsdReservePair, } from "./config/gooddollar.js";
85
+ export type { GoodDollarReserveSwapParams } from "./services/gooddollar.service.js";
85
86
  export type { CarbonPrepareResult, CarbonRestSuccess, } from "./types/carbon.js";
86
87
  export type { CarbonWriteBody } from "./services/carbon.service.js";
87
88
  export { CARBON_APP_BASE_URL, CARBON_CHAIN, CELO_CARBON_CONTRACTS, DEFAULT_CARBON_REST_BASE_URL, carbonActivityDeepLink, } from "./config/carbon.js";
package/build/index.js CHANGED
@@ -56,7 +56,7 @@ export { serializePreparedFlow } from "./types/prepared.js";
56
56
  export { AAVE_POOL, AAVE_SUPPORTED_SYMBOLS, resolveAaveAsset, } from "./config/aave.js";
57
57
  export { CHAIN, DEFAULT_RPC_URL } from "./config/chains.js";
58
58
  export { appendCelinaCalldataTag, CELINA_DATA_SUFFIX, } from "./config/celina-tag.js";
59
- export { GOODDOLLAR_IDENTITY_ADDRESS, GOODDOLLAR_UBI_SCHEME_ADDRESS, } from "./config/gooddollar.js";
59
+ export { GOODDOLLAR_CUSD_EXCHANGE_ID, GOODDOLLAR_IDENTITY_ADDRESS, GOODDOLLAR_MENTO_BROKER, GOODDOLLAR_MENTO_EXCHANGE_PROVIDER, GOODDOLLAR_RESERVE_COLLATERAL, GOODDOLLAR_TOKEN_ADDRESS, GOODDOLLAR_UBI_SCHEME_ADDRESS, isGoodDollarUsdReservePair, } from "./config/gooddollar.js";
60
60
  export { CARBON_APP_BASE_URL, CARBON_CHAIN, CELO_CARBON_CONTRACTS, DEFAULT_CARBON_REST_BASE_URL, carbonActivityDeepLink, } from "./config/carbon.js";
61
61
  export { resolveCarbonTokenAddress, normalizeCarbonWriteBody, CARBON_WRITE_TOKEN_FIELDS, } from "./utils/carbon-token.js";
62
62
  export { buildCarbonExecutionSteps } from "./utils/carbon-execution.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAE,uBAAuB,E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,MAAM,6BAA6B,CAAC;AACxE,OAAO,EACL,qBAAqB,GAEtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EACL,WAAW,GAIZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,YAAY,EACZ,uBAAuB,GACxB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,YAAY,GACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAE9B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
@@ -17,7 +17,7 @@ export declare class EnsService {
17
17
  constructor(ensClientFactory: EnsClientFactory);
18
18
  /**
19
19
  * Resolve an ENS name on Celo or Ethereum to an address.
20
- * @param name - ENS name (e.g. `vitalik.eth`)
20
+ * @param name - ENS name (e.g. `andrewkimjoseph.celo.eth`)
21
21
  * @param chain - `"celo"` tries Celo coin type first, then Ethereum; `"ethereum"` uses ETH only
22
22
  * @throws When no address record exists for the name
23
23
  */
@@ -14,7 +14,7 @@ export class EnsService {
14
14
  }
15
15
  /**
16
16
  * Resolve an ENS name on Celo or Ethereum to an address.
17
- * @param name - ENS name (e.g. `vitalik.eth`)
17
+ * @param name - ENS name (e.g. `andrewkimjoseph.celo.eth`)
18
18
  * @param chain - `"celo"` tries Celo coin type first, then Ethereum; `"ethereum"` uses ETH only
19
19
  * @throws When no address record exists for the name
20
20
  */
@@ -1,8 +1,16 @@
1
1
  import type { CeloClientFactory } from "../clients/celo-client.js";
2
2
  import { type SerializedPreparedFlow } from "../types/prepared.js";
3
- /** GoodDollar IdentityV4 whitelist, reverification, and daily UBI claim preparation. */
3
+ /** Optional parameters for GoodDollar reserve swap prepares. */
4
+ export interface GoodDollarReserveSwapParams {
5
+ /** Max slippage tolerance in percent (default `0.5`). */
6
+ slippageTolerance?: number;
7
+ /** Address receiving output tokens (default: `from`). */
8
+ recipient?: `0x${string}`;
9
+ }
10
+ /** GoodDollar IdentityV4 whitelist, reverification, daily UBI claim, and reserve swap preparation. */
4
11
  export declare class GoodDollarService {
5
12
  private readonly clientFactory;
13
+ private readonly tokenService;
6
14
  constructor(clientFactory: CeloClientFactory);
7
15
  private getPublicClient;
8
16
  /**
@@ -86,6 +94,54 @@ export declare class GoodDollarService {
86
94
  * Validates whitelist, entitlement, and simulates gas before returning steps.
87
95
  */
88
96
  prepareClaimUbi(from: `0x${string}`): Promise<SerializedPreparedFlow>;
97
+ private resolveReservePair;
98
+ private reserveOptions;
99
+ private baseReserveQuoteFields;
100
+ /**
101
+ * Expected GoodDollar reserve output for G$ ↔ USDm — no wallet required.
102
+ */
103
+ getReserveQuote(tokenIn: string, tokenOut: string, amount: string, from?: `0x${string}`): Promise<{
104
+ protocol: "gooddollar_reserve";
105
+ network: "mainnet";
106
+ tokenIn: string;
107
+ tokenOut: string;
108
+ amountIn: string;
109
+ expectedOut: string;
110
+ routeHops: number;
111
+ broker: "0x88de45906D4F5a57315c133620cfa484cB297541";
112
+ exchangeProvider: "0x2fFBB49055d487DdBBb0C052Cd7c2a02A7971e41";
113
+ exchangeId: "0xba77f5c7bb3317643c6d81d1ef3f9913561741d92095f88efa402faf2cbe9124";
114
+ }>;
115
+ private buildReserveSwap;
116
+ private buildReserveApprovalData;
117
+ private estimateReserveSwapGas;
118
+ /**
119
+ * Simulate gas for a GoodDollar reserve swap from `from`, including approval if needed.
120
+ */
121
+ estimateReserveSwap(from: `0x${string}`, tokenIn: string, tokenOut: string, amount: string, params?: GoodDollarReserveSwapParams): Promise<{
122
+ from: `0x${string}`;
123
+ recipient: `0x${string}`;
124
+ amountOutMin: string;
125
+ approvalNeeded: boolean;
126
+ approvalGas: string | undefined;
127
+ swapGas: string;
128
+ totalGas: string;
129
+ slippageTolerance: number;
130
+ protocol: "gooddollar_reserve";
131
+ network: "mainnet";
132
+ tokenIn: string;
133
+ tokenOut: string;
134
+ amountIn: string;
135
+ expectedOut: string;
136
+ routeHops: number;
137
+ broker: "0x88de45906D4F5a57315c133620cfa484cB297541";
138
+ exchangeProvider: "0x2fFBB49055d487DdBBb0C052Cd7c2a02A7971e41";
139
+ exchangeId: "0xba77f5c7bb3317643c6d81d1ef3f9913561741d92095f88efa402faf2cbe9124";
140
+ }>;
141
+ /**
142
+ * Build unsigned GoodDollar reserve swap steps (approve + swapIn when needed).
143
+ */
144
+ prepareReserveSwap(from: `0x${string}`, tokenIn: string, tokenOut: string, amount: string, params?: GoodDollarReserveSwapParams): Promise<SerializedPreparedFlow>;
89
145
  private effectiveAuthCount;
90
146
  private fetchReverifyDaysOptions;
91
147
  private buildReverificationProgress;