@coinlist-co/react 0.10.0 → 0.11.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/README.md +32 -0
- package/dist/{chunk-GSSAB4K5.js → chunk-B2HCVPCQ.js} +225 -247
- package/dist/chunk-B2HCVPCQ.js.map +1 -0
- package/dist/chunk-KDGNDAHA.js +146 -0
- package/dist/chunk-KDGNDAHA.js.map +1 -0
- package/dist/chunk-UIIXXLA7.js +1863 -0
- package/dist/chunk-UIIXXLA7.js.map +1 -0
- package/dist/client/index.cjs +10559 -3442
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +4219 -862
- package/dist/client/index.d.ts +4219 -862
- package/dist/client/index.js +8729 -2370
- package/dist/client/index.js.map +1 -1
- package/dist/collections-BhDkYmzV.d.cts +65 -0
- package/dist/collections-CZhHoQHr.d.ts +65 -0
- package/dist/config-B5mwS_2l.d.cts +1926 -0
- package/dist/config-B5mwS_2l.d.ts +1926 -0
- package/dist/server/index.cjs +981 -464
- package/dist/server/index.cjs.map +1 -1
- package/dist/server/index.d.cts +190 -163
- package/dist/server/index.d.ts +190 -163
- package/dist/server/index.js +151 -156
- package/dist/server/index.js.map +1 -1
- package/dist/shared/index.cjs +1810 -907
- package/dist/shared/index.cjs.map +1 -1
- package/dist/shared/index.d.cts +243 -132
- package/dist/shared/index.d.ts +243 -132
- package/dist/shared/index.js +102 -114
- package/dist/shared/index.js.map +1 -1
- package/package.json +10 -7
- package/dist/chunk-7BJ2HAG7.js +0 -442
- package/dist/chunk-7BJ2HAG7.js.map +0 -1
- package/dist/chunk-AAER5LOL.js +0 -22
- package/dist/chunk-AAER5LOL.js.map +0 -1
- package/dist/chunk-GSSAB4K5.js.map +0 -1
- package/dist/chunk-TUZKKFNW.js +0 -836
- package/dist/chunk-TUZKKFNW.js.map +0 -1
- package/dist/collections-CJ24dOda.d.cts +0 -28
- package/dist/collections-ZYLKp8JB.d.ts +0 -28
- package/dist/requirement-CDi5NJI8.d.cts +0 -1036
- package/dist/requirement-CDi5NJI8.d.ts +0 -1036
package/dist/server/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as AuthorizationCode, C as CodeVerifier, a1 as OAuthSession, r as OAuthAccessToken, a2 as ClientCredentialsOAuth, q as Config, a3 as ClientSecret, a4 as Sender, s as OffersNamespace, y as Offer, a5 as PaginationParams, a6 as PaginatedResponse, O as OfferId, v as OfferDetail, R as RequirementsNamespace, e as OfferOptionId, o as Requirement, p as RequirementsNamespaceImpl, S as SharedNamespaceContext, W as WalletsNamespace, b as Erc20Namespace, d as CoinListTokenSaleNamespace, l as SuperstateSwapNamespace, h as OndoNamespace, t as TokensNamespace } from '../config-B5mwS_2l.js';
|
|
2
2
|
import 'viem';
|
|
3
3
|
|
|
4
4
|
interface SessionStore {
|
|
@@ -18,67 +18,39 @@ interface SessionStore {
|
|
|
18
18
|
* invalidated refresh token. Simply **omit** `setSession` to prevent any
|
|
19
19
|
* refresh from being attempted.
|
|
20
20
|
*
|
|
21
|
-
* {@link
|
|
22
|
-
* always require a writable store and
|
|
23
|
-
* {@link WritableSessionStoreRequiredError} if `setSession` is absent.
|
|
21
|
+
* {@link ServerAuthNamespace.completeOAuth} and
|
|
22
|
+
* {@link ServerAuthNamespace.logout} always require a writable store and
|
|
23
|
+
* throw {@link WritableSessionStoreRequiredError} if `setSession` is absent.
|
|
24
24
|
*/
|
|
25
25
|
setSession?(session: OAuthSession | null): Promise<void>;
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
* Whether SDK will throw an exception in cases it can be silent.
|
|
34
|
-
* For example, if token revokation on logout fails.
|
|
35
|
-
*/
|
|
36
|
-
readonly strict?: boolean;
|
|
27
|
+
/** The PKCE pair `CoinListClient#auth.completeOAuth` hands to the backend. */
|
|
28
|
+
interface CompleteOAuthParams {
|
|
29
|
+
/** The short-lived authorization code parsed out of the redirect URL. */
|
|
30
|
+
code: AuthorizationCode;
|
|
31
|
+
/** The `code_verifier` the browser generated when starting the flow. */
|
|
32
|
+
codeVerifier: CodeVerifier;
|
|
37
33
|
}
|
|
38
34
|
/**
|
|
39
|
-
*
|
|
35
|
+
* OAuth session lifecycle on your backend: exchanging authorization codes,
|
|
36
|
+
* keeping the access token fresh, minting app-level tokens, and logging out.
|
|
40
37
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* - **Writable store** (`setSession` provided) — full functionality: token
|
|
45
|
-
* refresh, {@link completeOAuth}, and {@link logout} all work normally.
|
|
46
|
-
*
|
|
47
|
-
* - **Read-only store** (no `setSession`) — token refresh is skipped entirely,
|
|
48
|
-
* meaning no network call is made and no refresh token is consumed.
|
|
49
|
-
* {@link completeOAuth} and {@link logout} throw
|
|
50
|
-
* {@link WritableSessionStoreRequiredError}. {@link accessToken} may return
|
|
51
|
-
* an expired token (see its docs). Use this mode in execution contexts that
|
|
52
|
-
* can read the session but cannot write it back, such as Next.js Server
|
|
53
|
-
* Components.
|
|
38
|
+
* This namespace is server-only: every method needs the `clientSecret` and the
|
|
39
|
+
* {@link SessionStore}, neither of which may exist in a browser.
|
|
54
40
|
*/
|
|
55
|
-
interface
|
|
41
|
+
interface ServerAuthNamespace {
|
|
56
42
|
/**
|
|
57
|
-
* Exchanges an authorization code
|
|
58
|
-
* {@link SessionStore.setSession}.
|
|
43
|
+
* Exchanges an authorization code from `CoinListClient#auth.completeOAuth`
|
|
44
|
+
* for an OAuth session and persists it via {@link SessionStore.setSession}.
|
|
59
45
|
*
|
|
60
46
|
* Throws {@link WritableSessionStoreRequiredError} if the session store does
|
|
61
47
|
* not provide `setSession`.
|
|
62
48
|
*/
|
|
63
|
-
completeOAuth(
|
|
49
|
+
completeOAuth(params: CompleteOAuthParams): Promise<OAuthSession>;
|
|
64
50
|
/**
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
* such as offers and offer requirements.
|
|
69
|
-
*
|
|
70
|
-
* The token is **not** persisted to the {@link SessionStore} and has no
|
|
71
|
-
* refresh token. It expires at `expiresAt`; once expired, call this method
|
|
72
|
-
* again to obtain a fresh token — the SDK does not renew it automatically.
|
|
73
|
-
*
|
|
74
|
-
* Pass the result to {@link fetchOffers}, {@link fetchOffersPage},
|
|
75
|
-
* {@link fetchOfferDetails}, or {@link fetchOfferRequirements} to call them
|
|
76
|
-
* without a user session.
|
|
77
|
-
*/
|
|
78
|
-
clientCredentialsOAuth(): Promise<ClientCredentialsOAuth>;
|
|
79
|
-
/**
|
|
80
|
-
* Returns a valid access token for the current session, refreshing it if
|
|
81
|
-
* it is expired or near expiry.
|
|
51
|
+
* Returns a valid access token for the current session, refreshing it if it
|
|
52
|
+
* is expired or near expiry. This is what you serve to
|
|
53
|
+
* {@link ClientConfig.getAccessToken}.
|
|
82
54
|
*
|
|
83
55
|
* **Writable store**: if the token is expired, the SDK exchanges the refresh
|
|
84
56
|
* token for a new session, persists it, and returns the fresh access token.
|
|
@@ -94,152 +66,207 @@ interface CoinListServer {
|
|
|
94
66
|
* @returns the access token, or `null` if there is no session or the session
|
|
95
67
|
* could not be refreshed.
|
|
96
68
|
*/
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Revokes the current token via POST /oauth/revoke and clears the session.
|
|
100
|
-
*
|
|
101
|
-
* Throws {@link WritableSessionStoreRequiredError} if the session store does
|
|
102
|
-
* not provide `setSession`.
|
|
103
|
-
*/
|
|
104
|
-
logout(): Promise<void>;
|
|
105
|
-
/**
|
|
106
|
-
* Fetches all offers by iterating through every paginated response.
|
|
107
|
-
*
|
|
108
|
-
* @param clientCreds optional app-level token from
|
|
109
|
-
* {@link clientCredentialsOAuth}. When provided, no user session is
|
|
110
|
-
* required; if a user session exists it takes precedence and `clientCreds`
|
|
111
|
-
* is used as a fallback.
|
|
112
|
-
*
|
|
113
|
-
* Throws {@link NotAuthenticatedError} if there is neither a user session
|
|
114
|
-
* nor `clientCreds`.
|
|
115
|
-
*/
|
|
116
|
-
fetchOffers(clientCreds?: ClientCredentialsOAuth): Promise<Offer[]>;
|
|
117
|
-
/**
|
|
118
|
-
* Fetches a single page of offers.
|
|
119
|
-
*
|
|
120
|
-
* @param clientCreds optional app-level token from
|
|
121
|
-
* {@link clientCredentialsOAuth}. When provided, no user session is
|
|
122
|
-
* required; if a user session exists it takes precedence and `clientCreds`
|
|
123
|
-
* is used as a fallback.
|
|
124
|
-
*
|
|
125
|
-
* Throws {@link NotAuthenticatedError} if there is neither a user session
|
|
126
|
-
* nor `clientCreds`.
|
|
127
|
-
*/
|
|
128
|
-
fetchOffersPage(params: PaginationParams, clientCreds?: ClientCredentialsOAuth): Promise<PaginatedResponse<Offer>>;
|
|
69
|
+
getAccessToken(): Promise<OAuthAccessToken | null>;
|
|
129
70
|
/**
|
|
130
|
-
*
|
|
71
|
+
* Obtains an app-level access token via the OAuth 2.0 `client_credentials`
|
|
72
|
+
* grant (RFC 6749 §4.4). No user is involved: the token authenticates the
|
|
73
|
+
* partner application itself and only grants access to app-level resources
|
|
74
|
+
* such as offers and offer requirements.
|
|
131
75
|
*
|
|
132
|
-
* @
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
* is used as a fallback.
|
|
76
|
+
* The token is **not** persisted to the {@link SessionStore} and has no
|
|
77
|
+
* refresh token. It expires at `expiresAt`; once expired, call this method
|
|
78
|
+
* again to obtain a fresh token — the SDK does not renew it automatically.
|
|
136
79
|
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
80
|
+
* Pass the result to `ServerOffersNamespace` or
|
|
81
|
+
* `ServerRequirementsNamespace.forOffer` to read without a user session.
|
|
139
82
|
*/
|
|
140
|
-
|
|
83
|
+
clientCredentials(): Promise<ClientCredentialsOAuth>;
|
|
141
84
|
/**
|
|
142
|
-
*
|
|
143
|
-
* chain. The user signs the returned {@link WalletOwnershipChallenge.message}
|
|
144
|
-
* with their wallet, then passes the signature to
|
|
145
|
-
* {@link connectExternalWallet}.
|
|
85
|
+
* Revokes the current token via `POST /oauth/revoke` and clears the session.
|
|
146
86
|
*
|
|
147
|
-
* Throws {@link
|
|
87
|
+
* Throws {@link WritableSessionStoreRequiredError} if the session store does
|
|
88
|
+
* not provide `setSession`.
|
|
148
89
|
*/
|
|
149
|
-
|
|
90
|
+
logout(): Promise<void>;
|
|
91
|
+
}
|
|
92
|
+
/** What {@link ServerAuthNamespaceImpl} needs out of `ServerConfig`. */
|
|
93
|
+
type ServerAuthConfig = Config & {
|
|
94
|
+
readonly clientSecret: ClientSecret;
|
|
95
|
+
readonly sessionStore: SessionStore;
|
|
96
|
+
/** Seconds before expiry at which a token counts as expired for refresh. */
|
|
97
|
+
readonly accessTokenExpiryBufferSeconds: number;
|
|
98
|
+
/** Whether to rethrow errors the SDK could otherwise swallow (e.g. revoke). */
|
|
99
|
+
readonly strict: boolean;
|
|
100
|
+
};
|
|
101
|
+
declare class ServerAuthNamespaceImpl implements ServerAuthNamespace {
|
|
102
|
+
private readonly api;
|
|
103
|
+
private readonly config;
|
|
104
|
+
constructor(api: Sender, config: ServerAuthConfig);
|
|
105
|
+
completeOAuth({ code, codeVerifier, }: CompleteOAuthParams): Promise<OAuthSession>;
|
|
106
|
+
getAccessToken(): Promise<OAuthAccessToken | null>;
|
|
107
|
+
private refreshSession;
|
|
108
|
+
clientCredentials(): Promise<ClientCredentialsOAuth>;
|
|
109
|
+
logout(): Promise<void>;
|
|
150
110
|
/**
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* Throws {@link NotAuthenticatedError} if the user is not authenticated.
|
|
111
|
+
* Returns the store's `setSession`, or throws — the guard every
|
|
112
|
+
* session-writing operation shares.
|
|
155
113
|
*/
|
|
156
|
-
|
|
114
|
+
private writableSessionStore;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* What the server-only namespaces need, on top of what
|
|
119
|
+
* {@link SharedNamespaceContext} provides: authentication that a caller can
|
|
120
|
+
* satisfy with an app-level token instead of a user session.
|
|
121
|
+
*/
|
|
122
|
+
interface ServerNamespaceContext {
|
|
123
|
+
readonly api: Sender;
|
|
157
124
|
/**
|
|
158
|
-
*
|
|
159
|
-
*
|
|
160
|
-
*
|
|
125
|
+
* Requires a user session, unless `clientCreds` is supplied — an app-level
|
|
126
|
+
* token authenticates the request on its own. Throws
|
|
127
|
+
* {@link NotAuthenticatedError} when neither is present.
|
|
161
128
|
*/
|
|
162
|
-
|
|
129
|
+
ensureAuthenticated(clientCreds?: ClientCredentialsOAuth): Promise<void>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The server-side offers namespace: the same reads as the shared
|
|
134
|
+
* {@link OffersNamespace}, each additionally callable with an app-level token
|
|
135
|
+
* from `ServerAuthNamespace.clientCredentials` instead of a user session.
|
|
136
|
+
*
|
|
137
|
+
* When a user session exists it takes precedence and `clientCreds` acts as a
|
|
138
|
+
* fallback. Without either, the reads throw {@link NotAuthenticatedError}.
|
|
139
|
+
*/
|
|
140
|
+
interface ServerOffersNamespace extends OffersNamespace {
|
|
141
|
+
/** @param clientCreds app-level token to read without a user session. */
|
|
142
|
+
list(clientCreds?: ClientCredentialsOAuth): Promise<Offer[]>;
|
|
143
|
+
/** @param clientCreds app-level token to read without a user session. */
|
|
144
|
+
listPage(params: PaginationParams, clientCreds?: ClientCredentialsOAuth): Promise<PaginatedResponse<Offer>>;
|
|
145
|
+
/** @param clientCreds app-level token to read without a user session. */
|
|
146
|
+
get(id: OfferId, clientCreds?: ClientCredentialsOAuth): Promise<OfferDetail>;
|
|
147
|
+
}
|
|
148
|
+
declare class ServerOffersNamespaceImpl implements ServerOffersNamespace {
|
|
149
|
+
private readonly ctx;
|
|
150
|
+
constructor(ctx: ServerNamespaceContext);
|
|
151
|
+
list(clientCreds?: ClientCredentialsOAuth): Promise<Offer[]>;
|
|
152
|
+
listPage(params: PaginationParams, clientCreds?: ClientCredentialsOAuth): Promise<PaginatedResponse<Offer>>;
|
|
153
|
+
get(id: OfferId, clientCreds?: ClientCredentialsOAuth): Promise<OfferDetail>;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The server-side requirements namespace: the same surface as the shared
|
|
158
|
+
* {@link RequirementsNamespace}, except {@link forOffer} — the offer's
|
|
159
|
+
* requirement definitions are app-level data, so it is additionally callable
|
|
160
|
+
* with a token from `ServerAuthNamespace.clientCredentials`.
|
|
161
|
+
*
|
|
162
|
+
* Everything else is per-user data and needs a user session. `handle` is
|
|
163
|
+
* client-only: there is no browser tab to open on a server.
|
|
164
|
+
*/
|
|
165
|
+
interface ServerRequirementsNamespace extends RequirementsNamespace {
|
|
166
|
+
/** @param clientCreds app-level token to read without a user session. */
|
|
167
|
+
forOffer(offerId: OfferId, clientCreds?: ClientCredentialsOAuth): Promise<Record<OfferOptionId, Requirement[]>>;
|
|
168
|
+
}
|
|
169
|
+
declare class ServerRequirementsNamespaceImpl extends RequirementsNamespaceImpl implements ServerRequirementsNamespace {
|
|
170
|
+
private readonly serverCtx;
|
|
171
|
+
constructor(serverCtx: SharedNamespaceContext & ServerNamespaceContext);
|
|
172
|
+
forOffer(offerId: OfferId, clientCreds?: ClientCredentialsOAuth): Promise<Record<OfferOptionId, Requirement[]>>;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
interface ServerConfig extends Config {
|
|
176
|
+
readonly clientSecret: ClientSecret;
|
|
177
|
+
readonly sessionStore: SessionStore;
|
|
178
|
+
/** Buffer in seconds before expiry to consider token expired for refresh. */
|
|
179
|
+
readonly accessTokenExpiryBufferSeconds?: number;
|
|
163
180
|
/**
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* Throws {@link NotAuthenticatedError} if the user is not authenticated.
|
|
181
|
+
* Whether SDK will throw an exception in cases it can be silent.
|
|
182
|
+
* For example, if token revokation on logout fails.
|
|
167
183
|
*/
|
|
168
|
-
|
|
184
|
+
readonly strict?: boolean;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Server-side CoinList SDK client.
|
|
188
|
+
*
|
|
189
|
+
* Functionality is grouped into namespaces — `coinlist.auth.getAccessToken()`,
|
|
190
|
+
* `coinlist.offers.list()`, `coinlist.requirements.statuses(offerId)`.
|
|
191
|
+
*
|
|
192
|
+
* Operates in one of two modes depending on whether {@link SessionStore}
|
|
193
|
+
* includes a `setSession` implementation:
|
|
194
|
+
*
|
|
195
|
+
* - **Writable store** (`setSession` provided) — full functionality: token
|
|
196
|
+
* refresh, `auth.completeOAuth`, and `auth.logout` all work normally.
|
|
197
|
+
*
|
|
198
|
+
* - **Read-only store** (no `setSession`) — token refresh is skipped entirely,
|
|
199
|
+
* meaning no network call is made and no refresh token is consumed.
|
|
200
|
+
* `auth.completeOAuth` and `auth.logout` throw
|
|
201
|
+
* {@link WritableSessionStoreRequiredError}. `auth.getAccessToken` may
|
|
202
|
+
* return an expired token (see its docs). Use this mode in execution
|
|
203
|
+
* contexts that can read the session but cannot write it back, such as
|
|
204
|
+
* Next.js Server Components.
|
|
205
|
+
*
|
|
206
|
+
* Unless a namespace says otherwise, its methods require a user session and
|
|
207
|
+
* throw {@link NotAuthenticatedError} when there is none.
|
|
208
|
+
*/
|
|
209
|
+
interface CoinListServer {
|
|
169
210
|
/**
|
|
170
|
-
*
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* {@link clientCredentialsOAuth}. When provided, no user session is
|
|
174
|
-
* required; if a user session exists it takes precedence and `clientCreds`
|
|
175
|
-
* is used as a fallback.
|
|
176
|
-
*
|
|
177
|
-
* Throws {@link NotAuthenticatedError} if there is neither a user session
|
|
178
|
-
* nor `clientCreds`.
|
|
211
|
+
* OAuth session lifecycle: exchanging an authorization code, serving a valid
|
|
212
|
+
* access token to the browser, minting app-level tokens, and logging out —
|
|
213
|
+
* e.g. `coinlist.auth.getAccessToken()`.
|
|
179
214
|
*/
|
|
180
|
-
|
|
215
|
+
readonly auth: ServerAuthNamespace;
|
|
181
216
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
*
|
|
217
|
+
* The offer catalogue — e.g. `coinlist.offers.list()`. Every read also
|
|
218
|
+
* accepts an app-level token from {@link ServerAuthNamespace.clientCredentials}
|
|
219
|
+
* so it can run without a user session.
|
|
185
220
|
*/
|
|
186
|
-
|
|
221
|
+
readonly offers: ServerOffersNamespace;
|
|
187
222
|
/**
|
|
188
|
-
*
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* W-8BEN. Fields the entity hasn't provided are `null`.
|
|
192
|
-
*
|
|
193
|
-
* Throws {@link NotAuthenticatedError} if the user is not authenticated.
|
|
223
|
+
* Offer requirements and the operations that satisfy them — e.g.
|
|
224
|
+
* `coinlist.requirements.statuses(offerId)`. `forOffer` also accepts an
|
|
225
|
+
* app-level token; the rest is per-user data and needs a user session.
|
|
194
226
|
*/
|
|
195
|
-
|
|
227
|
+
readonly requirements: ServerRequirementsNamespace;
|
|
196
228
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* signing-form values keyed by the document's DocuSeal field names,
|
|
200
|
-
* forwarded verbatim to Passport to pre-fill the document.
|
|
201
|
-
*
|
|
202
|
-
* Throws {@link NotAuthenticatedError} if the user is not authenticated.
|
|
229
|
+
* The user's external wallets: ownership proofs and offer-option bindings —
|
|
230
|
+
* e.g. `coinlist.wallets.list({ offerId, offerOptionId })`.
|
|
203
231
|
*/
|
|
204
|
-
|
|
232
|
+
readonly wallets: WalletsNamespace;
|
|
205
233
|
/**
|
|
206
234
|
* Generic ERC-20 reads (token allowance and balance) — e.g.
|
|
207
|
-
* `coinlist.erc20.
|
|
208
|
-
*
|
|
209
|
-
* These methods require a user session and throw
|
|
210
|
-
* {@link NotAuthenticatedError} if the user is not authenticated.
|
|
235
|
+
* `coinlist.erc20.getBalance({ ... })`.
|
|
211
236
|
*/
|
|
212
|
-
readonly erc20:
|
|
237
|
+
readonly erc20: Erc20Namespace;
|
|
213
238
|
/**
|
|
214
239
|
* Token-sale operations: listing, reading, and recording participations —
|
|
215
|
-
* e.g. `coinlist.tokenSale.
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* These methods require a user session and throw
|
|
219
|
-
* {@link NotAuthenticatedError} if the user is not authenticated.
|
|
240
|
+
* e.g. `coinlist.tokenSale.list()`. The on-chain `execute`
|
|
241
|
+
* flow is client-only and is not exposed here.
|
|
220
242
|
*/
|
|
221
243
|
readonly tokenSale: CoinListTokenSaleNamespace;
|
|
222
244
|
/**
|
|
223
245
|
* On-chain swap operations: quoting a swap, reading swap-contract state, and
|
|
224
|
-
*
|
|
225
|
-
* `coinlist.
|
|
246
|
+
* allow-listing a proven wallet — e.g.
|
|
247
|
+
* `coinlist.superstate.getOutputToken({ contractAddress, chain })`.
|
|
248
|
+
*/
|
|
249
|
+
readonly superstate: SuperstateSwapNamespace;
|
|
250
|
+
/**
|
|
251
|
+
* Ondo swap reads: trading status and quoting. Both are free to poll.
|
|
226
252
|
*
|
|
227
|
-
*
|
|
228
|
-
*
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
*
|
|
253
|
+
* No CoinList fee is applied to a quote; see {@link OndoNamespace}.
|
|
254
|
+
*
|
|
255
|
+
* This is Ondo's whole surface for now — the wallet-driven half arrives with
|
|
256
|
+
* ENG-1680 and will be client-only, since it needs a wallet to sign with.
|
|
257
|
+
*/
|
|
258
|
+
readonly ondo: OndoNamespace;
|
|
259
|
+
/**
|
|
260
|
+
* Token display metadata (name, symbol, decimals, logos) from CoinList's
|
|
261
|
+
* public token registry, keyed by chain + contract address — e.g.
|
|
262
|
+
* `coinlist.tokens.get({ chain, address })` for an entry of
|
|
263
|
+
* `OfferDetail.tokens`, or `coinlist.tokens.list(chain)` for a whole
|
|
264
|
+
* catalogue in one request.
|
|
239
265
|
*
|
|
240
|
-
*
|
|
266
|
+
* Public and unauthenticated: unlike the other namespaces, its methods never
|
|
267
|
+
* require a session, so it also works with a read-only store.
|
|
241
268
|
*/
|
|
242
|
-
|
|
269
|
+
readonly tokens: TokensNamespace;
|
|
243
270
|
}
|
|
244
271
|
declare function createCoinListServer(config: ServerConfig): CoinListServer;
|
|
245
272
|
|
|
@@ -247,4 +274,4 @@ declare class WritableSessionStoreRequiredError extends Error {
|
|
|
247
274
|
constructor(message?: string);
|
|
248
275
|
}
|
|
249
276
|
|
|
250
|
-
export { type CoinListServer, type ServerConfig, type SessionStore, WritableSessionStoreRequiredError, createCoinListServer };
|
|
277
|
+
export { type CoinListServer, type CompleteOAuthParams, type ServerAuthConfig, type ServerAuthNamespace, ServerAuthNamespaceImpl, type ServerConfig, type ServerNamespaceContext, type ServerOffersNamespace, ServerOffersNamespaceImpl, type ServerRequirementsNamespace, ServerRequirementsNamespaceImpl, type SessionStore, WritableSessionStoreRequiredError, createCoinListServer };
|