@degen-insurance/sdk 0.2.0
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/CHANGELOG.md +54 -0
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/abi.d.ts +418 -0
- package/dist/abi.js +49 -0
- package/dist/alerts/state.d.ts +52 -0
- package/dist/alerts/state.js +56 -0
- package/dist/deployment.d.ts +59 -0
- package/dist/deployment.js +46 -0
- package/dist/errors.d.ts +18 -0
- package/dist/errors.js +99 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/limits.d.ts +135 -0
- package/dist/limits.js +180 -0
- package/dist/telegram/render.d.ts +14 -0
- package/dist/telegram/render.js +44 -0
- package/dist/tx/build.d.ts +51 -0
- package/dist/tx/build.js +92 -0
- package/package.json +41 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
This package is versioned independently of the protocol. Breaking changes are called out
|
|
4
|
+
because partners pin a version and need to know what moved.
|
|
5
|
+
|
|
6
|
+
## 0.2.0
|
|
7
|
+
|
|
8
|
+
The SDK had not been updated since before the protocol escrowed insured positions, so parts of
|
|
9
|
+
it described a system that no longer existed.
|
|
10
|
+
|
|
11
|
+
### Breaking
|
|
12
|
+
|
|
13
|
+
- **Builders take a `Deployment` instead of loose addresses.** `buildBuyWithCover` now takes
|
|
14
|
+
`{ deployment, ... }` rather than `{ router, ... }`; `buildClaim`, `buildSellAndVoid`,
|
|
15
|
+
`buildVoidAndRelease` and `buildPartnerClaim` take a deployment as their first argument. This
|
|
16
|
+
is what makes multi-chain safe: addresses that have to agree now travel together, so one
|
|
17
|
+
chain's core with another's router cannot be expressed. There is deliberately no `setChain()`
|
|
18
|
+
— a global current-chain races when a bot serves several chains at once.
|
|
19
|
+
- **`TIERS` is now `ROBINHOOD_RATE_CARD`,** named for the chain it was measured on, and
|
|
20
|
+
`tierById(card, id)` takes the card. Premiums are the deliverable of a calibration run and
|
|
21
|
+
belong to one chain; the contracts revert `NoRateCard` elsewhere rather than reuse them, and
|
|
22
|
+
this package now holds the same line.
|
|
23
|
+
- **`PolicyView.stillHeld` is gone.** It was read from the holder's token balance, which under
|
|
24
|
+
escrow is zero for every live policy — so it answered "sold" every time. Anyone branching on
|
|
25
|
+
it was disabling claims on every policy in existence.
|
|
26
|
+
- **`position_sold` alert is now `cover_ended`,** and `PolicyStatus` gains `voided`.
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- `buildSellAndVoid` and `buildVoidAndRelease` — the two ways out of an escrowed position.
|
|
31
|
+
Without them a partner can only offer "wait for expiry".
|
|
32
|
+
- `amountRange`, `shareHeadroom`, `notionalForTokens`, `maxTotalForCapacity` — what a user may
|
|
33
|
+
actually buy. Three limits decide it, denominated in three different things: the registry's
|
|
34
|
+
bounds are notional, capacity is a payout, the share cap counts tokens.
|
|
35
|
+
- `explainRevert` and `REVERT_REASONS` — 31 contract errors in plain language, so a bot can say
|
|
36
|
+
"that amount is below the minimum trade size" rather than relaying `0xeddee5b2`. Returns
|
|
37
|
+
`null` when it cannot attribute a failure, so a transport error is never reported as a
|
|
38
|
+
rejected trade.
|
|
39
|
+
- `readRateCard` and `assertRateCard` — read the live card, and fail loudly if a local one
|
|
40
|
+
disagrees.
|
|
41
|
+
- `assertChain`, `defineDeployment`, `ROBINHOOD_TESTNET`.
|
|
42
|
+
|
|
43
|
+
### Packaging
|
|
44
|
+
|
|
45
|
+
- Ships compiled JavaScript and type declarations. Sources, tests and every document except
|
|
46
|
+
this changelog and the README stay out of the tarball, enforced by `verify-package`.
|
|
47
|
+
- `viem` moved to `peerDependencies`. A second copy in a consumer's tree means two sets of
|
|
48
|
+
structurally identical, mutually incompatible types.
|
|
49
|
+
- MIT licence added.
|
|
50
|
+
|
|
51
|
+
## 0.1.0
|
|
52
|
+
|
|
53
|
+
First release: transaction builders, partner revenue share, alert state machine, Telegram
|
|
54
|
+
rendering.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Vetted-Pro
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# @degen-insurance/sdk
|
|
2
|
+
|
|
3
|
+
```sh
|
|
4
|
+
npm install @degen-insurance/sdk viem
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
`viem` is a peer dependency: you almost certainly have it already, and a second copy in the
|
|
8
|
+
tree means two sets of structurally identical, mutually incompatible types.
|
|
9
|
+
|
|
10
|
+
Ships compiled JavaScript with type declarations. Requires Node 18+ or any bundler; ESM only.
|
|
11
|
+
|
|
12
|
+
Integration surface for Telegram bots and front ends. Maestro is already live on Robinhood
|
|
13
|
+
Chain and NockBot is native to it, so distribution exists without building a custodial bot.
|
|
14
|
+
|
|
15
|
+
Publishing is documented in [RELEASING.md](RELEASING.md).
|
|
16
|
+
|
|
17
|
+
## The SDK never holds keys
|
|
18
|
+
|
|
19
|
+
It builds transaction requests. Partners keep custody and their own UX and sign with the user's
|
|
20
|
+
key. That is the difference between integrating with a bot and becoming one, and it keeps the
|
|
21
|
+
security and regulatory surface of a custodial exchange out of scope entirely.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { buildBuyWithCover, minOutWithSlippage, ROBINHOOD_TESTNET } from "@degen-insurance/sdk";
|
|
25
|
+
|
|
26
|
+
const tx = buildBuyWithCover({
|
|
27
|
+
deployment: ROBINHOOD_TESTNET,
|
|
28
|
+
token,
|
|
29
|
+
totalValue: parseEther("1.1"), // trade plus premium, one payment
|
|
30
|
+
minOut: minOutWithSlippage(quoted, 100),
|
|
31
|
+
tier: 2, // 0 Basic, 1 Standard, 2 Degen Max
|
|
32
|
+
referrer: MY_BOT_ADDRESS, // earns the revenue share
|
|
33
|
+
});
|
|
34
|
+
await walletClient.sendTransaction(tx);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Chains
|
|
38
|
+
|
|
39
|
+
There is no `setChain()`, deliberately. A setter implies one current chain, which is fine for a
|
|
40
|
+
browser tab and wrong for a bot serving many users at once: two requests for different chains
|
|
41
|
+
arriving together would race on the global, and the loser would build calldata for one chain and
|
|
42
|
+
send it to another. A `Deployment` is a value, and values cannot race.
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const tx = buildBuyWithCover({ deployment: ROBINHOOD_TESTNET, token, ... });
|
|
46
|
+
// somewhere else, at the same time, safely:
|
|
47
|
+
const other = buildBuyWithCover({ deployment: MY_OTHER_CHAIN, token, ... });
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
It also keeps addresses that have to agree travelling together. There is no signature that
|
|
51
|
+
takes `core` and `router` separately any more, so one chain's core with another's router cannot
|
|
52
|
+
be expressed.
|
|
53
|
+
|
|
54
|
+
`ROBINHOOD_TESTNET` is the only deployment shipped, because it is the only one whose addresses
|
|
55
|
+
have been checked against the chain from here. Robinhood mainnet has a deployment in
|
|
56
|
+
`broadcast/`; define it yourself once you have confirmed it:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
const ROBINHOOD = defineDeployment({
|
|
60
|
+
chainId: 4663, name: "Robinhood Chain",
|
|
61
|
+
core: "0x...", router: "0x...", registry: "0x...", partnerRegistry: "0x...",
|
|
62
|
+
calibrated: true,
|
|
63
|
+
});
|
|
64
|
+
await assertChain(publicClient, ROBINHOOD); // before signing anything
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`assertChain` is worth the round trip. A client on the wrong RPC produces calldata that is
|
|
68
|
+
perfectly well formed and addressed to contracts that are not there, and the failure arrives as
|
|
69
|
+
an unrelated-looking revert.
|
|
70
|
+
|
|
71
|
+
## Premiums belong to the chain they were measured on
|
|
72
|
+
|
|
73
|
+
`ROBINHOOD_RATE_CARD` is named for its chain because that is the whole of its validity. The
|
|
74
|
+
premiums come from a calibration run over 4,679 pools and 301,612 buys on Robinhood Chain.
|
|
75
|
+
`Chains.card()` in the contracts reverts `NoRateCard` for every other chain rather than reuse
|
|
76
|
+
them, and this SDK holds the same line: a premium is a claim about how often tokens collapse in
|
|
77
|
+
one chain's flow, not a property of the product.
|
|
78
|
+
|
|
79
|
+
Use the local card to render a quote before you have a connection. Once you have one, read the
|
|
80
|
+
real card and check:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
const card = await readRateCard(publicClient, deployment.registry, riskRegistryAbi);
|
|
84
|
+
assertRateCard(ROBINHOOD_RATE_CARD, card); // throws if this deployment prices differently
|
|
85
|
+
|
|
86
|
+
const range = amountRange(capacity, tierById(card, 2), limits);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Quoting one chain's premiums against another chain's risk is the failure worth being noisy
|
|
90
|
+
about: the trade succeeds, at the wrong price, and nothing downstream looks wrong.
|
|
91
|
+
|
|
92
|
+
## Revenue share
|
|
93
|
+
|
|
94
|
+
Pass `referrer` and the partner accrues a share of the premium, claimable at any time. The
|
|
95
|
+
trader pays the same tier rate either way: the share comes out of protocol revenue, not out of
|
|
96
|
+
the buyer's premium and not out of reserves. Partner revenue is junior to policyholders and can
|
|
97
|
+
only be paid from free reserves.
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
await walletClient.sendTransaction(buildPartnerClaim(deployment, myTreasury));
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Alerts
|
|
104
|
+
|
|
105
|
+
For insurance the alerts are worth more than in-chat buying, and they need no custody at all.
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
const { alerts, sent } = sweep(policies, now, alreadySent);
|
|
109
|
+
for (const a of alerts) {
|
|
110
|
+
await bot.sendMessage(chatId, renderAlert(a, byId[a.policyId], now), {
|
|
111
|
+
parse_mode: "MarkdownV2",
|
|
112
|
+
reply_markup: a.kind === "triggered_claimable" ? claimKeyboard(a.policyId, DEEP_LINK) : undefined,
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Delivery is once per kind per policy. Repeating an alert on every poll trains people to mute
|
|
118
|
+
the bot, and then they miss the one message that mattered. Persist `sent` between runs.
|
|
119
|
+
|
|
120
|
+
## Claiming
|
|
121
|
+
|
|
122
|
+
Always `buildClaim`, which sends `latchAndClaim`. Claiming without latching fails whenever
|
|
123
|
+
nobody else happened to record the trigger first.
|
|
124
|
+
|
|
125
|
+
## Leaving early
|
|
126
|
+
|
|
127
|
+
The core holds the insured position in escrow for the life of the policy, so a holder cannot
|
|
128
|
+
sell it the ordinary way. That is what makes a claim honest -- the payout is for a loss taken
|
|
129
|
+
by holding, and custody proves the position was held the whole time rather than borrowed for
|
|
130
|
+
one transaction. It also means a partner has to offer the exit, or users are stuck until
|
|
131
|
+
expiry.
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
// Sell and end the cover, in one transaction. Costs no more than selling would have.
|
|
135
|
+
await walletClient.sendTransaction(buildSellAndVoid(deployment, policyId, minOutWei));
|
|
136
|
+
|
|
137
|
+
// Or take the tokens back and keep them. Ends the cover too.
|
|
138
|
+
await walletClient.sendTransaction(buildVoidAndRelease(deployment, policyId));
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Either leaves the policy `voided`, which is a normal outcome and not a failure. Do not read a
|
|
142
|
+
holder's token balance to decide whether cover is live: under escrow it is zero for every
|
|
143
|
+
active policy, and treating that as "sold" disables claiming on everything.
|
|
144
|
+
|
|
145
|
+
## Amount limits
|
|
146
|
+
|
|
147
|
+
Three limits decide what a user may buy, and they are denominated in three different things:
|
|
148
|
+
the registry's minimum and maximum are notional wei, remaining capacity is a *payout*, and the
|
|
149
|
+
share cap counts *tokens*. Quoting any one of them at a user is misleading -- capacity in
|
|
150
|
+
particular is 2.2x smaller than the trade it supports at Degen Max.
|
|
151
|
+
|
|
152
|
+
```ts
|
|
153
|
+
const limits = riskLimitsFromParams(await core.read.getParams());
|
|
154
|
+
const room = shareHeadroom(supply, walletTokensInsured, tokenTokensInsured, limits);
|
|
155
|
+
const range = amountRange(remainingCapacity, tierById(card, 2), {
|
|
156
|
+
...limits,
|
|
157
|
+
maxShareNotionalWei: notionalForTokens(pool, room),
|
|
158
|
+
});
|
|
159
|
+
// -> "Enter between 0.00011 and 0.001214 ETH"
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Both share caps are cumulative, so headroom depends on the wallet and on every policy already
|
|
163
|
+
open against the token. A band computed for a fresh wallet will be refused for a busy one.
|
|
164
|
+
`amountRange` keeps a 1% margin under the share cap because that cap counts tokens while the
|
|
165
|
+
user pays in the quote asset, and the rate between them moves on every trade.
|
|
166
|
+
|
|
167
|
+
## Explaining a refusal
|
|
168
|
+
|
|
169
|
+
A wallet that cannot estimate gas has no fee to show and no way to say why, so a reverting buy
|
|
170
|
+
reaches the user as "Network fee: Unavailable" or a bare selector. Simulate first and say what
|
|
171
|
+
happened.
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
try {
|
|
175
|
+
await publicClient.call({ ...tx, account: user });
|
|
176
|
+
} catch (err) {
|
|
177
|
+
const why = explainRevert(err);
|
|
178
|
+
if (why) return bot.sendMessage(chatId, why);
|
|
179
|
+
throw err; // not a refusal -- do not report it as one
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
`explainRevert` returns `null` when it cannot attribute the failure, so a transport error is
|
|
184
|
+
never reported to a user as a rejected trade. 31 selectors are mapped, each pinned by a test
|
|
185
|
+
that derives the expected set from the Solidity source.
|
package/dist/abi.d.ts
ADDED
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
export declare const universalRouterAbi: readonly [{
|
|
2
|
+
readonly name: "buyWithCover";
|
|
3
|
+
readonly type: "function";
|
|
4
|
+
readonly stateMutability: "payable";
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly type: "address";
|
|
7
|
+
readonly name: "token";
|
|
8
|
+
}, {
|
|
9
|
+
readonly type: "uint256";
|
|
10
|
+
readonly name: "minOut";
|
|
11
|
+
}, {
|
|
12
|
+
readonly type: "uint8";
|
|
13
|
+
readonly name: "tier";
|
|
14
|
+
}];
|
|
15
|
+
readonly outputs: readonly [{
|
|
16
|
+
readonly type: "uint256";
|
|
17
|
+
readonly name: "received";
|
|
18
|
+
}, {
|
|
19
|
+
readonly type: "uint256";
|
|
20
|
+
readonly name: "policyId";
|
|
21
|
+
}];
|
|
22
|
+
}, {
|
|
23
|
+
readonly name: "buyWithCoverVia";
|
|
24
|
+
readonly type: "function";
|
|
25
|
+
readonly stateMutability: "payable";
|
|
26
|
+
readonly inputs: readonly [{
|
|
27
|
+
readonly type: "address";
|
|
28
|
+
readonly name: "token";
|
|
29
|
+
}, {
|
|
30
|
+
readonly type: "uint256";
|
|
31
|
+
readonly name: "minOut";
|
|
32
|
+
}, {
|
|
33
|
+
readonly type: "uint8";
|
|
34
|
+
readonly name: "tier";
|
|
35
|
+
}, {
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
readonly name: "referrer";
|
|
38
|
+
}];
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly type: "uint256";
|
|
41
|
+
readonly name: "received";
|
|
42
|
+
}, {
|
|
43
|
+
readonly type: "uint256";
|
|
44
|
+
readonly name: "policyId";
|
|
45
|
+
}];
|
|
46
|
+
}, {
|
|
47
|
+
readonly name: "buy";
|
|
48
|
+
readonly type: "function";
|
|
49
|
+
readonly stateMutability: "payable";
|
|
50
|
+
readonly inputs: readonly [{
|
|
51
|
+
readonly type: "address";
|
|
52
|
+
readonly name: "token";
|
|
53
|
+
}, {
|
|
54
|
+
readonly type: "uint256";
|
|
55
|
+
readonly name: "minOut";
|
|
56
|
+
}];
|
|
57
|
+
readonly outputs: readonly [{
|
|
58
|
+
readonly type: "uint256";
|
|
59
|
+
readonly name: "received";
|
|
60
|
+
}];
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "previewCover";
|
|
63
|
+
readonly type: "function";
|
|
64
|
+
readonly stateMutability: "view";
|
|
65
|
+
readonly inputs: readonly [{
|
|
66
|
+
readonly type: "uint8";
|
|
67
|
+
readonly name: "tier";
|
|
68
|
+
}, {
|
|
69
|
+
readonly type: "uint256";
|
|
70
|
+
readonly name: "totalValue";
|
|
71
|
+
}];
|
|
72
|
+
readonly outputs: readonly [{
|
|
73
|
+
readonly type: "uint256";
|
|
74
|
+
readonly name: "notional";
|
|
75
|
+
}, {
|
|
76
|
+
readonly type: "uint256";
|
|
77
|
+
readonly name: "premium";
|
|
78
|
+
}];
|
|
79
|
+
}];
|
|
80
|
+
export declare const insuranceCoreAbi: readonly [{
|
|
81
|
+
readonly name: "latchTrigger";
|
|
82
|
+
readonly type: "function";
|
|
83
|
+
readonly stateMutability: "nonpayable";
|
|
84
|
+
readonly inputs: readonly [{
|
|
85
|
+
readonly type: "address";
|
|
86
|
+
readonly name: "token";
|
|
87
|
+
}];
|
|
88
|
+
readonly outputs: readonly [{
|
|
89
|
+
readonly type: "bool";
|
|
90
|
+
}];
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "claim";
|
|
93
|
+
readonly type: "function";
|
|
94
|
+
readonly stateMutability: "nonpayable";
|
|
95
|
+
readonly inputs: readonly [{
|
|
96
|
+
readonly type: "uint256";
|
|
97
|
+
readonly name: "id";
|
|
98
|
+
}];
|
|
99
|
+
readonly outputs: readonly [{
|
|
100
|
+
readonly type: "uint256";
|
|
101
|
+
}];
|
|
102
|
+
}, {
|
|
103
|
+
readonly name: "latchAndClaim";
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
readonly stateMutability: "nonpayable";
|
|
106
|
+
readonly inputs: readonly [{
|
|
107
|
+
readonly type: "uint256";
|
|
108
|
+
readonly name: "id";
|
|
109
|
+
}];
|
|
110
|
+
readonly outputs: readonly [{
|
|
111
|
+
readonly type: "uint256";
|
|
112
|
+
}];
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "remainingCapacity";
|
|
115
|
+
readonly type: "function";
|
|
116
|
+
readonly stateMutability: "view";
|
|
117
|
+
readonly inputs: readonly [{
|
|
118
|
+
readonly type: "address";
|
|
119
|
+
readonly name: "token";
|
|
120
|
+
}];
|
|
121
|
+
readonly outputs: readonly [{
|
|
122
|
+
readonly type: "uint256";
|
|
123
|
+
}];
|
|
124
|
+
}, {
|
|
125
|
+
readonly name: "sellAndVoid";
|
|
126
|
+
readonly type: "function";
|
|
127
|
+
readonly stateMutability: "nonpayable";
|
|
128
|
+
readonly inputs: readonly [{
|
|
129
|
+
readonly type: "uint256";
|
|
130
|
+
readonly name: "id";
|
|
131
|
+
}, {
|
|
132
|
+
readonly type: "uint256";
|
|
133
|
+
readonly name: "minOut";
|
|
134
|
+
}];
|
|
135
|
+
readonly outputs: readonly [{
|
|
136
|
+
readonly type: "uint256";
|
|
137
|
+
}];
|
|
138
|
+
}, {
|
|
139
|
+
readonly name: "voidAndRelease";
|
|
140
|
+
readonly type: "function";
|
|
141
|
+
readonly stateMutability: "nonpayable";
|
|
142
|
+
readonly inputs: readonly [{
|
|
143
|
+
readonly type: "uint256";
|
|
144
|
+
readonly name: "id";
|
|
145
|
+
}];
|
|
146
|
+
readonly outputs: readonly [{
|
|
147
|
+
readonly type: "uint256";
|
|
148
|
+
}];
|
|
149
|
+
}, {
|
|
150
|
+
readonly name: "policyCount";
|
|
151
|
+
readonly type: "function";
|
|
152
|
+
readonly stateMutability: "view";
|
|
153
|
+
readonly inputs: readonly [];
|
|
154
|
+
readonly outputs: readonly [{
|
|
155
|
+
readonly type: "uint256";
|
|
156
|
+
}];
|
|
157
|
+
}, {
|
|
158
|
+
readonly name: "policies";
|
|
159
|
+
readonly type: "function";
|
|
160
|
+
readonly stateMutability: "view";
|
|
161
|
+
readonly inputs: readonly [{
|
|
162
|
+
readonly type: "uint256";
|
|
163
|
+
readonly name: "id";
|
|
164
|
+
}];
|
|
165
|
+
readonly outputs: readonly [{
|
|
166
|
+
readonly type: "tuple";
|
|
167
|
+
readonly components: readonly [{
|
|
168
|
+
readonly type: "address";
|
|
169
|
+
}, {
|
|
170
|
+
readonly type: "uint96";
|
|
171
|
+
}, {
|
|
172
|
+
readonly type: "address";
|
|
173
|
+
}, {
|
|
174
|
+
readonly type: "uint48";
|
|
175
|
+
}, {
|
|
176
|
+
readonly type: "uint48";
|
|
177
|
+
}, {
|
|
178
|
+
readonly type: "uint128";
|
|
179
|
+
}, {
|
|
180
|
+
readonly type: "uint128";
|
|
181
|
+
}, {
|
|
182
|
+
readonly type: "uint128";
|
|
183
|
+
}, {
|
|
184
|
+
readonly type: "uint128";
|
|
185
|
+
}, {
|
|
186
|
+
readonly type: "uint8";
|
|
187
|
+
}, {
|
|
188
|
+
readonly type: "uint8";
|
|
189
|
+
}, {
|
|
190
|
+
readonly type: "uint16";
|
|
191
|
+
}];
|
|
192
|
+
}];
|
|
193
|
+
}, {
|
|
194
|
+
readonly name: "quote";
|
|
195
|
+
readonly type: "function";
|
|
196
|
+
readonly stateMutability: "view";
|
|
197
|
+
readonly inputs: readonly [{
|
|
198
|
+
readonly type: "address";
|
|
199
|
+
readonly name: "token";
|
|
200
|
+
}, {
|
|
201
|
+
readonly type: "uint256";
|
|
202
|
+
readonly name: "notional";
|
|
203
|
+
}, {
|
|
204
|
+
readonly type: "uint256";
|
|
205
|
+
readonly name: "tokensOut";
|
|
206
|
+
}, {
|
|
207
|
+
readonly type: "uint8";
|
|
208
|
+
readonly name: "tier";
|
|
209
|
+
}];
|
|
210
|
+
readonly outputs: readonly [{
|
|
211
|
+
readonly type: "uint256";
|
|
212
|
+
readonly name: "premium";
|
|
213
|
+
}, {
|
|
214
|
+
readonly type: "uint256";
|
|
215
|
+
readonly name: "payout";
|
|
216
|
+
}, {
|
|
217
|
+
readonly type: "uint256";
|
|
218
|
+
readonly name: "entryPrice";
|
|
219
|
+
}, {
|
|
220
|
+
readonly type: "uint256";
|
|
221
|
+
readonly name: "floorPrice";
|
|
222
|
+
}];
|
|
223
|
+
}, {
|
|
224
|
+
readonly name: "walletTokensInsured";
|
|
225
|
+
readonly type: "function";
|
|
226
|
+
readonly stateMutability: "view";
|
|
227
|
+
readonly inputs: readonly [{
|
|
228
|
+
readonly type: "address";
|
|
229
|
+
readonly name: "token";
|
|
230
|
+
}, {
|
|
231
|
+
readonly type: "address";
|
|
232
|
+
readonly name: "holder";
|
|
233
|
+
}];
|
|
234
|
+
readonly outputs: readonly [{
|
|
235
|
+
readonly type: "uint256";
|
|
236
|
+
}];
|
|
237
|
+
}, {
|
|
238
|
+
readonly name: "tokenTokensInsured";
|
|
239
|
+
readonly type: "function";
|
|
240
|
+
readonly stateMutability: "view";
|
|
241
|
+
readonly inputs: readonly [{
|
|
242
|
+
readonly type: "address";
|
|
243
|
+
readonly name: "token";
|
|
244
|
+
}];
|
|
245
|
+
readonly outputs: readonly [{
|
|
246
|
+
readonly type: "uint256";
|
|
247
|
+
}];
|
|
248
|
+
}];
|
|
249
|
+
export declare const riskRegistryAbi: readonly [{
|
|
250
|
+
readonly name: "checkToken";
|
|
251
|
+
readonly type: "function";
|
|
252
|
+
readonly stateMutability: "view";
|
|
253
|
+
readonly inputs: readonly [{
|
|
254
|
+
readonly type: "address";
|
|
255
|
+
readonly name: "token";
|
|
256
|
+
}];
|
|
257
|
+
readonly outputs: readonly [{
|
|
258
|
+
readonly type: "bool";
|
|
259
|
+
readonly name: "ok";
|
|
260
|
+
}, {
|
|
261
|
+
readonly type: "uint8";
|
|
262
|
+
readonly name: "reason";
|
|
263
|
+
}];
|
|
264
|
+
}, {
|
|
265
|
+
readonly name: "tiers";
|
|
266
|
+
readonly type: "function";
|
|
267
|
+
readonly stateMutability: "view";
|
|
268
|
+
readonly inputs: readonly [{
|
|
269
|
+
readonly type: "uint256";
|
|
270
|
+
readonly name: "id";
|
|
271
|
+
}];
|
|
272
|
+
readonly outputs: readonly [{
|
|
273
|
+
readonly type: "tuple";
|
|
274
|
+
readonly components: readonly [{
|
|
275
|
+
readonly type: "uint16";
|
|
276
|
+
}, {
|
|
277
|
+
readonly type: "uint16";
|
|
278
|
+
}, {
|
|
279
|
+
readonly type: "uint16";
|
|
280
|
+
}, {
|
|
281
|
+
readonly type: "bool";
|
|
282
|
+
}];
|
|
283
|
+
}];
|
|
284
|
+
}, {
|
|
285
|
+
readonly name: "getParams";
|
|
286
|
+
readonly type: "function";
|
|
287
|
+
readonly stateMutability: "view";
|
|
288
|
+
readonly inputs: readonly [];
|
|
289
|
+
readonly outputs: readonly [{
|
|
290
|
+
readonly type: "tuple";
|
|
291
|
+
readonly components: readonly [{
|
|
292
|
+
readonly type: "uint32";
|
|
293
|
+
}, {
|
|
294
|
+
readonly type: "uint32";
|
|
295
|
+
}, {
|
|
296
|
+
readonly type: "uint32";
|
|
297
|
+
}, {
|
|
298
|
+
readonly type: "uint16";
|
|
299
|
+
}, {
|
|
300
|
+
readonly type: "uint16";
|
|
301
|
+
}, {
|
|
302
|
+
readonly type: "uint16";
|
|
303
|
+
}, {
|
|
304
|
+
readonly type: "uint16";
|
|
305
|
+
}, {
|
|
306
|
+
readonly type: "uint16";
|
|
307
|
+
}, {
|
|
308
|
+
readonly type: "uint16";
|
|
309
|
+
}, {
|
|
310
|
+
readonly type: "uint128";
|
|
311
|
+
}, {
|
|
312
|
+
readonly type: "uint128";
|
|
313
|
+
}, {
|
|
314
|
+
readonly type: "uint128";
|
|
315
|
+
}, {
|
|
316
|
+
readonly type: "uint128";
|
|
317
|
+
}];
|
|
318
|
+
}];
|
|
319
|
+
}];
|
|
320
|
+
export declare const launchPoolAbi: readonly [{
|
|
321
|
+
readonly name: "quoteReserve";
|
|
322
|
+
readonly type: "function";
|
|
323
|
+
readonly stateMutability: "view";
|
|
324
|
+
readonly inputs: readonly [];
|
|
325
|
+
readonly outputs: readonly [{
|
|
326
|
+
readonly type: "uint256";
|
|
327
|
+
}];
|
|
328
|
+
}, {
|
|
329
|
+
readonly name: "tokenReserve";
|
|
330
|
+
readonly type: "function";
|
|
331
|
+
readonly stateMutability: "view";
|
|
332
|
+
readonly inputs: readonly [];
|
|
333
|
+
readonly outputs: readonly [{
|
|
334
|
+
readonly type: "uint256";
|
|
335
|
+
}];
|
|
336
|
+
}, {
|
|
337
|
+
readonly name: "feeBps";
|
|
338
|
+
readonly type: "function";
|
|
339
|
+
readonly stateMutability: "view";
|
|
340
|
+
readonly inputs: readonly [];
|
|
341
|
+
readonly outputs: readonly [{
|
|
342
|
+
readonly type: "uint16";
|
|
343
|
+
}];
|
|
344
|
+
}, {
|
|
345
|
+
readonly name: "launchPrice";
|
|
346
|
+
readonly type: "function";
|
|
347
|
+
readonly stateMutability: "view";
|
|
348
|
+
readonly inputs: readonly [];
|
|
349
|
+
readonly outputs: readonly [{
|
|
350
|
+
readonly type: "uint256";
|
|
351
|
+
}];
|
|
352
|
+
}, {
|
|
353
|
+
readonly name: "spotPrice";
|
|
354
|
+
readonly type: "function";
|
|
355
|
+
readonly stateMutability: "view";
|
|
356
|
+
readonly inputs: readonly [];
|
|
357
|
+
readonly outputs: readonly [{
|
|
358
|
+
readonly type: "uint256";
|
|
359
|
+
}];
|
|
360
|
+
}];
|
|
361
|
+
export declare const erc20Abi: readonly [{
|
|
362
|
+
readonly name: "balanceOf";
|
|
363
|
+
readonly type: "function";
|
|
364
|
+
readonly stateMutability: "view";
|
|
365
|
+
readonly inputs: readonly [{
|
|
366
|
+
readonly type: "address";
|
|
367
|
+
}];
|
|
368
|
+
readonly outputs: readonly [{
|
|
369
|
+
readonly type: "uint256";
|
|
370
|
+
}];
|
|
371
|
+
}, {
|
|
372
|
+
readonly name: "totalSupply";
|
|
373
|
+
readonly type: "function";
|
|
374
|
+
readonly stateMutability: "view";
|
|
375
|
+
readonly inputs: readonly [];
|
|
376
|
+
readonly outputs: readonly [{
|
|
377
|
+
readonly type: "uint256";
|
|
378
|
+
}];
|
|
379
|
+
}, {
|
|
380
|
+
readonly name: "symbol";
|
|
381
|
+
readonly type: "function";
|
|
382
|
+
readonly stateMutability: "view";
|
|
383
|
+
readonly inputs: readonly [];
|
|
384
|
+
readonly outputs: readonly [{
|
|
385
|
+
readonly type: "string";
|
|
386
|
+
}];
|
|
387
|
+
}, {
|
|
388
|
+
readonly name: "decimals";
|
|
389
|
+
readonly type: "function";
|
|
390
|
+
readonly stateMutability: "view";
|
|
391
|
+
readonly inputs: readonly [];
|
|
392
|
+
readonly outputs: readonly [{
|
|
393
|
+
readonly type: "uint8";
|
|
394
|
+
}];
|
|
395
|
+
}];
|
|
396
|
+
export declare const partnerRegistryAbi: readonly [{
|
|
397
|
+
readonly name: "outstanding";
|
|
398
|
+
readonly type: "function";
|
|
399
|
+
readonly stateMutability: "view";
|
|
400
|
+
readonly inputs: readonly [{
|
|
401
|
+
readonly type: "address";
|
|
402
|
+
readonly name: "partner";
|
|
403
|
+
}];
|
|
404
|
+
readonly outputs: readonly [{
|
|
405
|
+
readonly type: "uint256";
|
|
406
|
+
}];
|
|
407
|
+
}, {
|
|
408
|
+
readonly name: "claim";
|
|
409
|
+
readonly type: "function";
|
|
410
|
+
readonly stateMutability: "nonpayable";
|
|
411
|
+
readonly inputs: readonly [{
|
|
412
|
+
readonly type: "address";
|
|
413
|
+
readonly name: "to";
|
|
414
|
+
}];
|
|
415
|
+
readonly outputs: readonly [{
|
|
416
|
+
readonly type: "uint256";
|
|
417
|
+
}];
|
|
418
|
+
}];
|