@sereel/sdk 0.1.5 → 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/README.md +46 -46
- package/dist/index.cjs +485 -49
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -20
- package/dist/index.d.ts +12 -20
- package/dist/index.js +482 -49
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -76,8 +76,8 @@ const client = createClient({
|
|
|
76
76
|
```ts
|
|
77
77
|
const { data, count } = await client.getAssets();
|
|
78
78
|
|
|
79
|
-
for (const
|
|
80
|
-
console.log(
|
|
79
|
+
for (const asset of data) {
|
|
80
|
+
console.log(asset.token_name, asset.issuer?.legal_name);
|
|
81
81
|
}
|
|
82
82
|
```
|
|
83
83
|
|
|
@@ -86,14 +86,17 @@ for (const record of data) {
|
|
|
86
86
|
### `client.getAssetByTokenAddress(tokenAddress)`
|
|
87
87
|
|
|
88
88
|
`GET /sdk/assets/{token_address}` — returns a single asset by its on-chain
|
|
89
|
-
token address.
|
|
89
|
+
token address. The response is a single `SdkSecurityDetails` object that
|
|
90
|
+
contains the token, issuer, primary book, and network details all in one
|
|
91
|
+
place.
|
|
90
92
|
|
|
91
93
|
```ts
|
|
92
94
|
const { data } = await client.getAssetByTokenAddress("0xabc…");
|
|
93
95
|
|
|
94
|
-
console.log(data.
|
|
95
|
-
console.log(data.
|
|
96
|
-
console.log(data.
|
|
96
|
+
console.log(data.token_name);
|
|
97
|
+
console.log(data.rule_engine?.name); // present if token has compliance rules
|
|
98
|
+
console.log(data.book?.status); // present if token has a book
|
|
99
|
+
console.log(data.network.name);
|
|
97
100
|
```
|
|
98
101
|
|
|
99
102
|
---
|
|
@@ -108,28 +111,20 @@ specific issuer. The `issuerId` is the `id` field from `SdkIssuerSummary`
|
|
|
108
111
|
const { data, count } = await client.getAssetsByIssuer("64f1a2b3c4d5e6f7a8b9c0d1");
|
|
109
112
|
|
|
110
113
|
console.log(`${count} tokens from this issuer`);
|
|
111
|
-
data.forEach(
|
|
114
|
+
data.forEach(asset => console.log(asset.token_symbol));
|
|
112
115
|
```
|
|
113
116
|
|
|
114
117
|
---
|
|
115
118
|
|
|
116
119
|
## Response shape
|
|
117
120
|
|
|
118
|
-
Every API method returns one or more `
|
|
119
|
-
|
|
120
|
-
```ts
|
|
121
|
-
interface SdkAssetRecord {
|
|
122
|
-
security: SdkSecurityDetails;
|
|
123
|
-
issuer: SdkIssuerSummary;
|
|
124
|
-
books: SdkBookSummary[];
|
|
125
|
-
network: NetworkDetails;
|
|
126
|
-
}
|
|
127
|
-
```
|
|
121
|
+
Every API method returns one or more `SdkSecurityDetails` objects.
|
|
128
122
|
|
|
129
123
|
### `SdkSecurityDetails`
|
|
130
124
|
|
|
131
|
-
Full token details
|
|
132
|
-
|
|
125
|
+
Full token details with issuer, book, and network flattened into a single
|
|
126
|
+
object. Internal and sensitive fields are intentionally excluded (`id`,
|
|
127
|
+
`org_id`, `deployment_txn_hash`, `token_program_id`, `engines` (raw),
|
|
133
128
|
`extra_information_attributes`, `allowlist_manager`, `iota_*` fields,
|
|
134
129
|
`individual_token_price`, `rule_engine_id`, `updated_at`).
|
|
135
130
|
|
|
@@ -144,15 +139,20 @@ interface SdkSecurityDetails {
|
|
|
144
139
|
admin: string; // token admin wallet address
|
|
145
140
|
icon_url: string | null;
|
|
146
141
|
prospectus: SdkTokenProspectus | null;
|
|
142
|
+
issuer: SdkIssuerSummary | null;
|
|
143
|
+
book: SdkBookSummary | null;
|
|
147
144
|
partners: SdkTokenPartner[] | null;
|
|
148
145
|
rule_engine: SdkRuleEngineSummary | null; // present when token has compliance rules
|
|
146
|
+
network: NetworkDetails;
|
|
149
147
|
created_at: string | null;
|
|
148
|
+
trex_claim_topics: number[] | null;
|
|
149
|
+
trex_issuers: string[] | null;
|
|
150
150
|
}
|
|
151
151
|
```
|
|
152
152
|
|
|
153
153
|
### `SdkRuleEngineSummary`
|
|
154
154
|
|
|
155
|
-
When a token has an associated compliance rule engine, it is
|
|
155
|
+
When a token has an associated compliance rule engine, it is included in the
|
|
156
156
|
security details. Only the name, address, and a slim view of each linked rule
|
|
157
157
|
are exposed.
|
|
158
158
|
|
|
@@ -200,9 +200,12 @@ interface SdkIssuerSummary {
|
|
|
200
200
|
|
|
201
201
|
### `SdkBookSummary`
|
|
202
202
|
|
|
203
|
-
Fund details attached to the token.
|
|
203
|
+
Fund (order book) details attached to the token. Wallet addresses are
|
|
204
|
+
intentionally excluded from this response.
|
|
204
205
|
|
|
205
206
|
```ts
|
|
207
|
+
type IssuanceStatus = "OPEN" | "CLOSED" | "FINALIZED" | "SETTLED" | "CANCELLED";
|
|
208
|
+
|
|
206
209
|
interface SdkFundConfig {
|
|
207
210
|
nav_staleness_threshold: string;
|
|
208
211
|
min_subscription: string;
|
|
@@ -211,25 +214,24 @@ interface SdkFundConfig {
|
|
|
211
214
|
exit_fee_bps: string;
|
|
212
215
|
dealing_mode: number;
|
|
213
216
|
redemption_gate_bps: string;
|
|
214
|
-
protocol_subscription_fee_bps: string;
|
|
215
|
-
protocol_fee_recipient: string;
|
|
216
217
|
management_fee_bps_per_annum: string;
|
|
217
218
|
}
|
|
218
219
|
|
|
219
220
|
interface SdkBookSummary {
|
|
220
|
-
id:
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
221
|
+
id: string | null;
|
|
222
|
+
organization_id: string;
|
|
223
|
+
name: string | null;
|
|
224
|
+
book_type: string | null; // e.g. "open"
|
|
225
|
+
token_address: string;
|
|
226
|
+
network_id: string;
|
|
227
|
+
settlement_token: string;
|
|
228
|
+
order_book_address: string;
|
|
229
|
+
fund_address: string;
|
|
230
|
+
fund_id: string;
|
|
231
|
+
initial_nav: string;
|
|
232
|
+
fund_config: SdkFundConfig;
|
|
233
|
+
status: IssuanceStatus;
|
|
234
|
+
created_at: string | null;
|
|
233
235
|
}
|
|
234
236
|
```
|
|
235
237
|
|
|
@@ -239,16 +241,14 @@ On-chain network the token is deployed on.
|
|
|
239
241
|
|
|
240
242
|
```ts
|
|
241
243
|
interface NetworkDetails {
|
|
242
|
-
network_id:
|
|
243
|
-
name:
|
|
244
|
-
family:
|
|
245
|
-
chain_id:
|
|
246
|
-
native_currency:
|
|
247
|
-
rpc_endpoint:
|
|
248
|
-
explorer_urls:
|
|
249
|
-
|
|
250
|
-
is_testnet: boolean;
|
|
251
|
-
is_supported: boolean;
|
|
244
|
+
network_id: string;
|
|
245
|
+
name: string;
|
|
246
|
+
family: string; // e.g. "ethereum" | "solana" | "iota"
|
|
247
|
+
chain_id: number | null;
|
|
248
|
+
native_currency: NativeCurrency;
|
|
249
|
+
rpc_endpoint: string;
|
|
250
|
+
explorer_urls: string[];
|
|
251
|
+
is_testnet: boolean;
|
|
252
252
|
}
|
|
253
253
|
```
|
|
254
254
|
|