@continuumdao/ctm-mpc-defi 0.2.59 → 0.2.61
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.
- package/dist/agent/catalog.cjs +67 -17
- package/dist/agent/catalog.cjs.map +1 -1
- package/dist/agent/catalog.d.ts +134 -7
- package/dist/agent/catalog.js +66 -18
- package/dist/agent/catalog.js.map +1 -1
- package/dist/agent/skills/railgun/SKILL.md +14 -5
- package/dist/protocols/evm/railgun/index.cjs +1331 -162
- package/dist/protocols/evm/railgun/index.cjs.map +1 -1
- package/dist/protocols/evm/railgun/index.d.ts +138 -2
- package/dist/protocols/evm/railgun/index.js +1306 -165
- package/dist/protocols/evm/railgun/index.js.map +1 -1
- package/package.json +4 -2
|
@@ -19,9 +19,14 @@ The 0zk address and its balances are stored on the KeyGen record. Each node hold
|
|
|
19
19
|
| Public tokens that show the Railgun icon | `ctm_railgun_fetch_popular_assets` |
|
|
20
20
|
| This KeyGen's shielded balances | `ctm_railgun_fetch_private_balances` |
|
|
21
21
|
| Shield a public ERC-20 into the 0zk address | `ctm_railgun_build_shield_multisign` |
|
|
22
|
+
| Quote the shield, transfer, or unshield fee | `ctm_railgun_fee_quote` |
|
|
22
23
|
| Start a private transfer | `ctm_railgun_private_transfer` |
|
|
23
24
|
| Start an unshield to a public address | `ctm_railgun_unshield` |
|
|
24
|
-
| Agree
|
|
25
|
+
| Agree or reject a pending spend from Join, node chat, or Telegram | `list_sign_requests_awaiting_join`, then `sign_request_agree` |
|
|
26
|
+
| Execute a private transfer after the other nodes have accepted | `list_sign_requests_ready`, then `broadcast_sign_result` with the `RailgunSpend:` id. No Get Sig |
|
|
27
|
+
| Agree this node's share when the spend id is already known | `ctm_railgun_agree_spend` |
|
|
28
|
+
|
|
29
|
+
Call `ctm_railgun_fee_quote` before a shield, private transfer, or unshield, and tell the user the fee. Shield and unshield take a Railgun percentage from the amount. A private transfer has no protocol fee. Unshield and private transfer also take a broadcaster fee from the private balance. `purpose` on a private transfer or unshield, and `purposeText` on a shield, is the Purpose shown on Join. `thoughts` on `sign_request_agree` or `ctm_railgun_agree_spend` is stored on the Railgun spend the same way as on a normal sign request.
|
|
25
30
|
|
|
26
31
|
Call `ctm_railgun_ensure_wallet` first. Use the returned `railgunAddress` as the shield recipient. Call `ctm_railgun_fetch_private_balances` before an unshield or private transfer. Pass `refresh: true` when the stored scan may be stale. If `walletConfigured` is false, call `ctm_railgun_ensure_wallet` and then fetch again.
|
|
27
32
|
|
|
@@ -29,11 +34,15 @@ Call `ctm_railgun_ensure_wallet` first. Use the returned `railgunAddress` as the
|
|
|
29
34
|
|
|
30
35
|
## Shield
|
|
31
36
|
|
|
32
|
-
|
|
33
|
-
|
|
37
|
+
`ctm_railgun_ensure_wallet` returns `shieldSignature` when this KeyGen already has one. Do not pass `shieldSignature` into `ctm_railgun_build_shield_multisign`. The server reads it from the KeyGen.
|
|
38
|
+
|
|
39
|
+
1. Call `ctm_railgun_build_shield_multisign` with the amount and the 0zk address from `ctm_railgun_ensure_wallet`. If a shield key is stored, this submits the approve-and-shield transaction.
|
|
40
|
+
2. If no shield key is stored, the call returns a personal_sign. Submit it with `sign_request_agree`, then `trigger_sign_result`. The signature is stored on the KeyGen. Call `ctm_railgun_build_shield_multisign` again with the same amount and 0zk address. Do not pass `shieldSignature`.
|
|
34
41
|
|
|
35
|
-
The
|
|
42
|
+
The personal_sign is only of the text `RAILGUN_SHIELD`. It does not contain the amount. If allowance is short, the shield call includes an approve, and a zero-approve reset when a non-zero allowance is still too small. Shielding spends the KeyGen threshold key, not the 0zk spending key.
|
|
36
43
|
|
|
37
44
|
## Private transfer and unshield
|
|
38
45
|
|
|
39
|
-
These start a pending spend and agree this node's share. The response is `pending` until `approvals` reaches `quorum`.
|
|
46
|
+
A private transfer is signed with this node's management key before the spend is stored. An unshield is signed with this node's management key the same way. These start a pending spend and agree this node's share. The response is `pending` until `approvals` reaches `quorum`. The same spend appears on the other KeyGen nodes in `list_sign_requests_awaiting_join` with `agreementKind: railgun_spend`. When an operator asks whether any sign requests are pending, in node chat or Telegram, include those rows. Show the asset, `amountWei` in base units, the destination address, the memo, the proposal time, and the deadline. Agree or reject with `sign_request_agree` and the row's `requestId` (`RailgunSpend:<keyGenId>:<spendId>`). `accept: false` rejects it. Do not call `trigger_sign_result`. `ctm_railgun_agree_spend` is the same agree when the keyGen id and spend id are already known. When the quorum is reached, the spend leaves Join and appears on the originator's Execute tab, and in `list_sign_requests_ready` on that node. The originator executes it with `broadcast_sign_result` and that same requestId. That builds the proof and submits it to the Railgun broadcaster. There is no Get Sig step. Automated jobs must skip `agreementKind: railgun_spend`. A later balance scan shows the result. Unshield defaults the recipient to the KeyGen Ethereum address.
|
|
47
|
+
|
|
48
|
+
A private transfer to a contact uses `toContactName` on `ctm_railgun_private_transfer`. That reads `railgunAddress` from the address book, not the contact’s Ethereum `address`. If the contact has no 0zk address, say so and do not invent one. Save one with `add_to_address_book_registry` on an Ethereum contact that is not a contract. Pass `railgunAddress` as an empty string to clear it. `remove_from_address_book_registry` removes the contact, including its 0zk address.
|