@secondlayer/sdk 6.44.0 → 6.45.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/dist/index.d.ts +54 -4
- package/dist/index.js +5 -3
- package/dist/index.js.map +3 -3
- package/dist/subgraphs/index.d.ts +54 -4
- package/dist/subgraphs/index.js +5 -3
- package/dist/subgraphs/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1166,6 +1166,7 @@ type IndexUsage = {
|
|
|
1166
1166
|
type FtTransfer = {
|
|
1167
1167
|
cursor: string
|
|
1168
1168
|
block_height: number
|
|
1169
|
+
block_time?: string | null
|
|
1169
1170
|
tx_id: string
|
|
1170
1171
|
tx_index: number
|
|
1171
1172
|
event_index: number
|
|
@@ -1176,13 +1177,25 @@ type FtTransfer = {
|
|
|
1176
1177
|
recipient: string
|
|
1177
1178
|
amount: string
|
|
1178
1179
|
};
|
|
1179
|
-
type FtTransfersEnvelope = {
|
|
1180
|
-
events:
|
|
1180
|
+
type FtTransfersEnvelope<TRow = FtTransfer> = {
|
|
1181
|
+
events: TRow[]
|
|
1181
1182
|
next_cursor: string | null
|
|
1182
1183
|
tip: IndexTip
|
|
1183
1184
|
reorgs: IndexReorg[]
|
|
1184
1185
|
};
|
|
1186
|
+
/** Transfer columns that survive any projection — the consume contract
|
|
1187
|
+
* (`cursor`, `block_height`) plus the `event_type` discriminant. */
|
|
1188
|
+
type FtTransferAlwaysFields = "cursor" | "block_height" | "event_type";
|
|
1189
|
+
/** An ft-transfer row narrowed to the requested columns plus the always-present ones. */
|
|
1190
|
+
type FtTransferFields<F extends keyof FtTransfer & string> = Pick<FtTransfer, (F | FtTransferAlwaysFields) & keyof FtTransfer>;
|
|
1185
1191
|
type FtTransfersListParams = {
|
|
1192
|
+
/**
|
|
1193
|
+
* Columns to return. The server projects the row, so an unrequested column
|
|
1194
|
+
* is physically absent — and the narrowing overload on `list` makes reading
|
|
1195
|
+
* one a compile error rather than `undefined` at runtime. Omitting
|
|
1196
|
+
* `block_time` also lets the server skip the blocks join.
|
|
1197
|
+
*/
|
|
1198
|
+
fields?: readonly (keyof FtTransfer & string)[]
|
|
1186
1199
|
cursor?: string | null
|
|
1187
1200
|
fromCursor?: string | null
|
|
1188
1201
|
limit?: number
|
|
@@ -1199,6 +1212,7 @@ type FtTransfersWalkParams = Omit<FtTransfersListParams, "limit"> & {
|
|
|
1199
1212
|
type NftTransfer = {
|
|
1200
1213
|
cursor: string
|
|
1201
1214
|
block_height: number
|
|
1215
|
+
block_time?: string | null
|
|
1202
1216
|
tx_id: string
|
|
1203
1217
|
tx_index: number
|
|
1204
1218
|
event_index: number
|
|
@@ -1209,13 +1223,19 @@ type NftTransfer = {
|
|
|
1209
1223
|
recipient: string
|
|
1210
1224
|
value: string
|
|
1211
1225
|
};
|
|
1212
|
-
type NftTransfersEnvelope = {
|
|
1213
|
-
events:
|
|
1226
|
+
type NftTransfersEnvelope<TRow = NftTransfer> = {
|
|
1227
|
+
events: TRow[]
|
|
1214
1228
|
next_cursor: string | null
|
|
1215
1229
|
tip: IndexTip
|
|
1216
1230
|
reorgs: IndexReorg[]
|
|
1217
1231
|
};
|
|
1232
|
+
/** See {@link FtTransferAlwaysFields}. */
|
|
1233
|
+
type NftTransferAlwaysFields = "cursor" | "block_height" | "event_type";
|
|
1234
|
+
/** An nft-transfer row narrowed to the requested columns plus the always-present ones. */
|
|
1235
|
+
type NftTransferFields<F extends keyof NftTransfer & string> = Pick<NftTransfer, (F | NftTransferAlwaysFields) & keyof NftTransfer>;
|
|
1218
1236
|
type NftTransfersListParams = {
|
|
1237
|
+
/** Columns to return (see {@link FtTransfersListParams.fields}). */
|
|
1238
|
+
fields?: readonly (keyof NftTransfer & string)[]
|
|
1219
1239
|
cursor?: string | null
|
|
1220
1240
|
fromCursor?: string | null
|
|
1221
1241
|
limit?: number
|
|
@@ -2125,14 +2145,44 @@ interface Pox5Resource {
|
|
|
2125
2145
|
* no amount filtering and no asset-slug resolution on /v1/index/ft-transfers.
|
|
2126
2146
|
*/
|
|
2127
2147
|
interface FtTransfersResource {
|
|
2148
|
+
/** Narrowing overload for the callable shorthand — same wire path as
|
|
2149
|
+
* `list`, so it must narrow identically. */
|
|
2150
|
+
<const F extends keyof FtTransfer & string>(params: FtTransfersListParams & {
|
|
2151
|
+
fields: readonly F[]
|
|
2152
|
+
}): Promise<FtTransfersEnvelope<FtTransferFields<F>>>;
|
|
2128
2153
|
(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;
|
|
2154
|
+
/** Narrowing overload: `fields` shrinks the row type to exactly the
|
|
2155
|
+
* requested columns plus {@link FtTransferAlwaysFields}. */
|
|
2156
|
+
list<const F extends keyof FtTransfer & string>(params: FtTransfersListParams & {
|
|
2157
|
+
fields: readonly F[]
|
|
2158
|
+
}): Promise<FtTransfersEnvelope<FtTransferFields<F>>>;
|
|
2129
2159
|
list(params?: FtTransfersListParams): Promise<FtTransfersEnvelope>;
|
|
2160
|
+
/** Narrowing overload, matching `list`: `walk` forwards `fields` to the
|
|
2161
|
+
* wire, so without this the yielded rows are stripped while the type
|
|
2162
|
+
* still promises every column. */
|
|
2163
|
+
walk<const F extends keyof FtTransfer & string>(params: FtTransfersWalkParams & {
|
|
2164
|
+
fields: readonly F[]
|
|
2165
|
+
}): AsyncIterable<FtTransferFields<F>>;
|
|
2130
2166
|
walk(params?: FtTransfersWalkParams): AsyncIterable<FtTransfer>;
|
|
2131
2167
|
}
|
|
2132
2168
|
/** `index.nftTransfers` — callable shorthand for `.list()` (see {@link FtTransfersResource}). */
|
|
2133
2169
|
interface NftTransfersResource {
|
|
2170
|
+
/** Narrowing overload for the callable shorthand — same wire path as
|
|
2171
|
+
* `list`, so it must narrow identically. */
|
|
2172
|
+
<const F extends keyof NftTransfer & string>(params: NftTransfersListParams & {
|
|
2173
|
+
fields: readonly F[]
|
|
2174
|
+
}): Promise<NftTransfersEnvelope<NftTransferFields<F>>>;
|
|
2134
2175
|
(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;
|
|
2176
|
+
/** Narrowing overload: `fields` shrinks the row type to exactly the
|
|
2177
|
+
* requested columns plus {@link NftTransferAlwaysFields}. */
|
|
2178
|
+
list<const F extends keyof NftTransfer & string>(params: NftTransfersListParams & {
|
|
2179
|
+
fields: readonly F[]
|
|
2180
|
+
}): Promise<NftTransfersEnvelope<NftTransferFields<F>>>;
|
|
2135
2181
|
list(params?: NftTransfersListParams): Promise<NftTransfersEnvelope>;
|
|
2182
|
+
/** Narrowing overload, matching `list` (see {@link FtTransfersResource}). */
|
|
2183
|
+
walk<const F extends keyof NftTransfer & string>(params: NftTransfersWalkParams & {
|
|
2184
|
+
fields: readonly F[]
|
|
2185
|
+
}): AsyncIterable<NftTransferFields<F>>;
|
|
2136
2186
|
walk(params?: NftTransfersWalkParams): AsyncIterable<NftTransfer>;
|
|
2137
2187
|
}
|
|
2138
2188
|
/** `index.events` — callable shorthand for `.list()`; `eventType` is required. */
|
package/dist/index.js
CHANGED
|
@@ -1061,7 +1061,8 @@ class Index extends BaseClient {
|
|
|
1061
1061
|
sender: params.sender,
|
|
1062
1062
|
recipient: params.recipient,
|
|
1063
1063
|
from_height: params.fromHeight,
|
|
1064
|
-
to_height: params.toHeight
|
|
1064
|
+
to_height: params.toHeight,
|
|
1065
|
+
fields: params.fields?.join(",")
|
|
1065
1066
|
})}`);
|
|
1066
1067
|
}
|
|
1067
1068
|
async listNftTransfers(params = {}) {
|
|
@@ -1074,7 +1075,8 @@ class Index extends BaseClient {
|
|
|
1074
1075
|
sender: params.sender,
|
|
1075
1076
|
recipient: params.recipient,
|
|
1076
1077
|
from_height: params.fromHeight,
|
|
1077
|
-
to_height: params.toHeight
|
|
1078
|
+
to_height: params.toHeight,
|
|
1079
|
+
fields: params.fields?.join(",")
|
|
1078
1080
|
})}`);
|
|
1079
1081
|
}
|
|
1080
1082
|
async* keysetWalk(params, list, itemsOf) {
|
|
@@ -2884,5 +2886,5 @@ export {
|
|
|
2884
2886
|
ApiError
|
|
2885
2887
|
};
|
|
2886
2888
|
|
|
2887
|
-
//# debugId=
|
|
2889
|
+
//# debugId=798F8DCB6A6B9EBD64756E2164756E21
|
|
2888
2890
|
//# sourceMappingURL=index.js.map
|