alkanesjs 1.1.9 → 1.2.1
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.browser.mjs +56295 -0
- package/dist/index.browser.mjs.map +7 -0
- package/dist/index.d.ts +1516 -0
- package/dist/index.js +46104 -0
- package/dist/index.js.map +7 -0
- package/package.json +1 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1516 @@
|
|
|
1
|
+
import * as bitcoin from 'bitcoinjs-lib';
|
|
2
|
+
import { Network, Psbt, Transaction } from 'bitcoinjs-lib';
|
|
3
|
+
import { BorshSchema, Infer } from 'borsher';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import * as ecpair from 'ecpair';
|
|
6
|
+
import { ECPairInterface } from 'ecpair';
|
|
7
|
+
|
|
8
|
+
/** Represents just the error shape (status: false) */
|
|
9
|
+
interface IBoxedError<E extends string | number> {
|
|
10
|
+
status: false;
|
|
11
|
+
errorType: E;
|
|
12
|
+
message?: string;
|
|
13
|
+
}
|
|
14
|
+
/** Represents just the success shape (status: true) */
|
|
15
|
+
interface IBoxedSuccess<T> {
|
|
16
|
+
status: true;
|
|
17
|
+
data: T;
|
|
18
|
+
}
|
|
19
|
+
/** A union that can be either an error or a success */
|
|
20
|
+
type BoxedResponse<T, E extends string | number> = IBoxedError<E> | IBoxedSuccess<T>;
|
|
21
|
+
/** A class implementing the error shape */
|
|
22
|
+
declare class BoxedError<E extends string | number> implements IBoxedError<E> {
|
|
23
|
+
status: false;
|
|
24
|
+
errorType: E;
|
|
25
|
+
message?: string;
|
|
26
|
+
constructor(errorType: E, message?: string);
|
|
27
|
+
}
|
|
28
|
+
/** A class implementing the success shape */
|
|
29
|
+
declare class BoxedSuccess<T> implements IBoxedSuccess<T> {
|
|
30
|
+
status: true;
|
|
31
|
+
data: T;
|
|
32
|
+
constructor(data: T);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare enum EsploraFetchError {
|
|
36
|
+
UnknownError = "UnknownError"
|
|
37
|
+
}
|
|
38
|
+
type EsploraAddressStats = {
|
|
39
|
+
funded_txo_count: number;
|
|
40
|
+
funded_txo_sum: number;
|
|
41
|
+
spent_txo_count: number;
|
|
42
|
+
spent_txo_sum: number;
|
|
43
|
+
tx_count: number;
|
|
44
|
+
};
|
|
45
|
+
interface IEsploraBlockHeader {
|
|
46
|
+
/** block height you asked for */
|
|
47
|
+
height: number;
|
|
48
|
+
/** 32‑byte block‑hash (hex, lowercase, no “0x”) */
|
|
49
|
+
hash: string;
|
|
50
|
+
/** 80‑byte raw header, hex‑encoded (160 chars) */
|
|
51
|
+
headerHex: string;
|
|
52
|
+
}
|
|
53
|
+
type EsploraAddressResponse = {
|
|
54
|
+
address: string;
|
|
55
|
+
chain_stats: EsploraAddressStats;
|
|
56
|
+
mempool_stats: EsploraAddressStats;
|
|
57
|
+
};
|
|
58
|
+
type EsploraUtxo = {
|
|
59
|
+
txid: string;
|
|
60
|
+
vout: number;
|
|
61
|
+
value: number;
|
|
62
|
+
status: {
|
|
63
|
+
confirmed: boolean;
|
|
64
|
+
block_height?: number;
|
|
65
|
+
block_hash?: string;
|
|
66
|
+
block_time?: number;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type IEsploraTransactionStatus = {
|
|
70
|
+
confirmed: boolean;
|
|
71
|
+
block_height?: number;
|
|
72
|
+
block_hash?: string;
|
|
73
|
+
block_time?: number;
|
|
74
|
+
};
|
|
75
|
+
type IEsploraPrevout = {
|
|
76
|
+
scriptpubkey: string;
|
|
77
|
+
scriptpubkey_asm: string;
|
|
78
|
+
scriptpubkey_type: string;
|
|
79
|
+
scriptpubkey_address: string;
|
|
80
|
+
value: number;
|
|
81
|
+
};
|
|
82
|
+
type IEsploraVin = {
|
|
83
|
+
txid: string;
|
|
84
|
+
vout: number;
|
|
85
|
+
prevout?: IEsploraPrevout;
|
|
86
|
+
scriptsig: string;
|
|
87
|
+
scriptsig_asm: string;
|
|
88
|
+
witness: string[];
|
|
89
|
+
is_coinbase: boolean;
|
|
90
|
+
sequence: number;
|
|
91
|
+
};
|
|
92
|
+
type IEsploraVout = {
|
|
93
|
+
scriptpubkey: string;
|
|
94
|
+
scriptpubkey_asm: string;
|
|
95
|
+
scriptpubkey_type: string;
|
|
96
|
+
scriptpubkey_address: string;
|
|
97
|
+
value: number;
|
|
98
|
+
};
|
|
99
|
+
type IEsploraTransaction = {
|
|
100
|
+
txid: string;
|
|
101
|
+
version: number;
|
|
102
|
+
locktime: number;
|
|
103
|
+
vin: IEsploraVin[];
|
|
104
|
+
vout: IEsploraVout[];
|
|
105
|
+
size: number;
|
|
106
|
+
weight: number;
|
|
107
|
+
fee: number;
|
|
108
|
+
status: IEsploraTransactionStatus;
|
|
109
|
+
};
|
|
110
|
+
type IEsploraSpendableUtxo = {
|
|
111
|
+
txid: string;
|
|
112
|
+
vout: number;
|
|
113
|
+
value: number;
|
|
114
|
+
prevTx: IEsploraTransaction & {
|
|
115
|
+
hex: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
declare enum RpcError {
|
|
120
|
+
UnknownError = "UnknownError",
|
|
121
|
+
InternalError = "InternalError"
|
|
122
|
+
}
|
|
123
|
+
type RpcTuple = [string, unknown[]];
|
|
124
|
+
type RpcResponse<T> = {
|
|
125
|
+
jsonrpc: "2.0";
|
|
126
|
+
id: number;
|
|
127
|
+
result?: T;
|
|
128
|
+
error?: {
|
|
129
|
+
code: number;
|
|
130
|
+
message: string;
|
|
131
|
+
data?: unknown;
|
|
132
|
+
};
|
|
133
|
+
};
|
|
134
|
+
interface RpcCall<T> {
|
|
135
|
+
payload: RpcTuple;
|
|
136
|
+
call: () => Promise<BoxedResponse<T, RpcError>>;
|
|
137
|
+
}
|
|
138
|
+
declare function buildRpcCall<T, E = unknown>(method: string, params: unknown[] | undefined, url: string): RpcCall<T>;
|
|
139
|
+
|
|
140
|
+
declare class WaitPacer {
|
|
141
|
+
private maxPerInterval;
|
|
142
|
+
private intervalMs;
|
|
143
|
+
private minGapMs;
|
|
144
|
+
private starts;
|
|
145
|
+
private lastStart;
|
|
146
|
+
private tail;
|
|
147
|
+
constructor(opts: {
|
|
148
|
+
maxPerInterval: number;
|
|
149
|
+
intervalMs: number;
|
|
150
|
+
});
|
|
151
|
+
setRate(maxPerInterval: number, intervalMs: number): void;
|
|
152
|
+
private now;
|
|
153
|
+
private sleep;
|
|
154
|
+
private pruneWindow;
|
|
155
|
+
/** Await this immediately before the call that could rate-limit */
|
|
156
|
+
waitForPacer(): Promise<void>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
interface ProviderConfig {
|
|
160
|
+
sandshrewUrl: string;
|
|
161
|
+
electrumApiUrl: string;
|
|
162
|
+
network: Network;
|
|
163
|
+
explorerUrl: string;
|
|
164
|
+
defaultFeeRate?: number;
|
|
165
|
+
btcTicker?: string;
|
|
166
|
+
pacerSettings?: PacerSettings;
|
|
167
|
+
}
|
|
168
|
+
declare enum AlkanesPollError {
|
|
169
|
+
UnknownError = "UnknownError"
|
|
170
|
+
}
|
|
171
|
+
type PacerSettings = {
|
|
172
|
+
intervalMs: number;
|
|
173
|
+
maxPerInterval: number;
|
|
174
|
+
};
|
|
175
|
+
type AlkanesParsedTraceResult = {
|
|
176
|
+
create?: AlkanesTraceCreateEvent["data"];
|
|
177
|
+
invoke?: AlkanesTraceInvokeEvent["data"];
|
|
178
|
+
return: AlkanesTraceReturnEvent["data"];
|
|
179
|
+
};
|
|
180
|
+
declare class Provider {
|
|
181
|
+
readonly sandshrewUrl: string;
|
|
182
|
+
readonly electrumApiUrl: string;
|
|
183
|
+
readonly network: Network;
|
|
184
|
+
readonly explorerUrl: string;
|
|
185
|
+
readonly pacerSettings: PacerSettings;
|
|
186
|
+
readonly btcTicker: string;
|
|
187
|
+
readonly jitterMs = 1000;
|
|
188
|
+
readonly rpc: BaseRpcProvider;
|
|
189
|
+
readonly defaultFeeRate: number;
|
|
190
|
+
private readonly TIMEOUT_MS;
|
|
191
|
+
private readonly INTERVAL_MS;
|
|
192
|
+
pacer: WaitPacer;
|
|
193
|
+
constructor(config: ProviderConfig);
|
|
194
|
+
protected txUrl(txid: string): string;
|
|
195
|
+
protected addressUrl(address: string): string;
|
|
196
|
+
buildRpcCall<T>(method: string, params?: unknown[]): RpcCall<T>;
|
|
197
|
+
execute(config: Omit<Parameters<typeof execute>[0], "provider">): ReturnType<typeof execute>;
|
|
198
|
+
simulate(request: Parameters<typeof simulate>[1]): ReturnType<typeof simulate>;
|
|
199
|
+
trace(...args: Parameters<typeof AlkanesRpcProvider.prototype.alkanes_trace>): ReturnType<ReturnType<typeof AlkanesRpcProvider.prototype.alkanes_trace>["call"]>;
|
|
200
|
+
waitForBlocks: (amount: number) => Promise<BoxedResponse<boolean, AlkanesPollError>>;
|
|
201
|
+
waitForTraceResult: (txid: string) => Promise<BoxedResponse<AlkanesParsedTraceResult, AlkanesTraceError>>;
|
|
202
|
+
waitForConfirmation: (txid: string) => Promise<BoxedResponse<boolean, AlkanesPollError>>;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
declare class ElectrumApiProvider {
|
|
206
|
+
private readonly provider;
|
|
207
|
+
constructor(provider: Provider);
|
|
208
|
+
private get electrumApiUrl();
|
|
209
|
+
esplora_getaddress(address: string): Promise<BoxedResponse<EsploraAddressResponse, EsploraFetchError>>;
|
|
210
|
+
esplora_getaddressbalance(address: string): Promise<BoxedResponse<number, EsploraFetchError>>;
|
|
211
|
+
esplora_getutxos(address: string): Promise<BoxedResponse<EsploraUtxo[], EsploraFetchError>>;
|
|
212
|
+
esplora_getfee(): Promise<BoxedResponse<number, EsploraFetchError>>;
|
|
213
|
+
esplora_broadcastTx(rawTransactionHex: string, customElectrumUrl?: string): Promise<BoxedResponse<string, EsploraFetchError>>;
|
|
214
|
+
esplora_getaddresstxs(address: string, lastSeenTransactionId?: string): Promise<BoxedResponse<IEsploraTransaction[], EsploraFetchError>>;
|
|
215
|
+
esplora_getbulktransactions(transactionIds: string[]): Promise<BoxedResponse<IEsploraTransaction[], EsploraFetchError>>;
|
|
216
|
+
esplora_getblocktiphash(): Promise<BoxedResponse<string, EsploraFetchError>>;
|
|
217
|
+
_esplora_getrawblock(blockHash: string): Promise<BoxedResponse<string, EsploraFetchError>>;
|
|
218
|
+
esplora_getrawblocktip(): Promise<BoxedResponse<string, EsploraFetchError>>;
|
|
219
|
+
esplora_gettransaction(transactionId: string): Promise<BoxedResponse<IEsploraTransaction, EsploraFetchError>>;
|
|
220
|
+
esplora_getrawtransaction(transactionId: string): Promise<BoxedResponse<string, EsploraFetchError>>;
|
|
221
|
+
esplora_getspendableinputs(utxoList: EsploraUtxo[]): Promise<BoxedResponse<IEsploraSpendableUtxo[], EsploraFetchError>>;
|
|
222
|
+
esplora_getutxofromparenttx(transaction: IEsploraTransaction, voutIndex: number): BoxedResponse<EsploraUtxo, EsploraFetchError>;
|
|
223
|
+
esplora_getutxo(utxoString: string): Promise<BoxedResponse<EsploraUtxo, EsploraFetchError>>;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
type RuneName = string;
|
|
227
|
+
interface OrdPaginatedIds {
|
|
228
|
+
ids: string[];
|
|
229
|
+
more: boolean;
|
|
230
|
+
page?: number;
|
|
231
|
+
page_index?: number;
|
|
232
|
+
}
|
|
233
|
+
interface OrdInscription {
|
|
234
|
+
address: string;
|
|
235
|
+
children: string[];
|
|
236
|
+
content_length: number;
|
|
237
|
+
content_type: string;
|
|
238
|
+
genesis_fee: number;
|
|
239
|
+
genesis_height: number;
|
|
240
|
+
inscription_id: string;
|
|
241
|
+
inscription_number: number;
|
|
242
|
+
next: string | null;
|
|
243
|
+
output_value: number;
|
|
244
|
+
parent: string | null;
|
|
245
|
+
previous: string | null;
|
|
246
|
+
rune: string | null;
|
|
247
|
+
sat: number;
|
|
248
|
+
satpoint: string;
|
|
249
|
+
timestamp: number;
|
|
250
|
+
}
|
|
251
|
+
type OrdOutputRune = {
|
|
252
|
+
amount: number;
|
|
253
|
+
divisibility: number;
|
|
254
|
+
};
|
|
255
|
+
interface OrdOutput {
|
|
256
|
+
value: number;
|
|
257
|
+
script_pubkey: string;
|
|
258
|
+
address: string;
|
|
259
|
+
transaction: string;
|
|
260
|
+
sat_ranges: number[][];
|
|
261
|
+
inscriptions: string[];
|
|
262
|
+
runes: Record<RuneName, OrdOutputRune>;
|
|
263
|
+
indexed?: boolean;
|
|
264
|
+
spent?: boolean;
|
|
265
|
+
output?: string;
|
|
266
|
+
}
|
|
267
|
+
interface OrdBlock {
|
|
268
|
+
hash: string;
|
|
269
|
+
target: string;
|
|
270
|
+
best_height: number;
|
|
271
|
+
height: number;
|
|
272
|
+
inscriptions: string[];
|
|
273
|
+
}
|
|
274
|
+
interface OrdSat {
|
|
275
|
+
number: number;
|
|
276
|
+
decimal: string;
|
|
277
|
+
degree: string;
|
|
278
|
+
name: string;
|
|
279
|
+
block: number;
|
|
280
|
+
cycle: number;
|
|
281
|
+
epoch: number;
|
|
282
|
+
period: number;
|
|
283
|
+
offset: number;
|
|
284
|
+
rarity: string;
|
|
285
|
+
percentile: string;
|
|
286
|
+
satpoint: string | null;
|
|
287
|
+
timestamp: number;
|
|
288
|
+
inscriptions: string[];
|
|
289
|
+
}
|
|
290
|
+
type DecodedCBORValue = string | number | boolean | null | undefined | DecodedCBOR | DecodedCBORValue[];
|
|
291
|
+
interface DecodedCBOR {
|
|
292
|
+
[key: string]: DecodedCBORValue;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
declare function decodeCBOR(hex: string): DecodedCBOR;
|
|
296
|
+
|
|
297
|
+
declare enum OrdFetchError {
|
|
298
|
+
UnknownError = "UnknownError",
|
|
299
|
+
RpcError = "RpcError"
|
|
300
|
+
}
|
|
301
|
+
declare class OrdRpcProvider {
|
|
302
|
+
private readonly provider;
|
|
303
|
+
constructor(provider: Provider);
|
|
304
|
+
private get rpc();
|
|
305
|
+
ord_getInscriptions(startingNumber?: string): RpcCall<OrdPaginatedIds>;
|
|
306
|
+
ord_getInscriptionsByBlockHash(blockHash: string): RpcCall<OrdBlock>;
|
|
307
|
+
ord_getInscriptionsByBlockHeight(blockHeight: string, page?: string): RpcCall<OrdBlock>;
|
|
308
|
+
ord_getInscriptionById(inscriptionId: string): RpcCall<OrdInscription>;
|
|
309
|
+
ord_getInscriptionByNumber(inscriptionNumber: string): RpcCall<OrdInscription>;
|
|
310
|
+
ord_getInscriptionContent(inscriptionId: string): RpcCall<string>;
|
|
311
|
+
ord_getInscriptionPreview(inscriptionId: string): RpcCall<string>;
|
|
312
|
+
ord_getInscriptionChildren(inscriptionId: string, page?: string): RpcCall<OrdPaginatedIds>;
|
|
313
|
+
ord_getTxOutput(txidAndVout: string): RpcCall<OrdOutput>;
|
|
314
|
+
ord_getSatByNumber(satoshiNumber: string): RpcCall<OrdSat>;
|
|
315
|
+
ord_getSatByDecimal(decimalNotation: string): RpcCall<OrdSat>;
|
|
316
|
+
ord_getSatByDegree(degreeNotation: string): RpcCall<OrdSat>;
|
|
317
|
+
ord_getSatByName(satoshiName: string): RpcCall<OrdSat>;
|
|
318
|
+
ord_getSatByPercentile(percentileString: string): RpcCall<OrdSat>;
|
|
319
|
+
ord_getInscriptionIdsBySat(satoshiNumber: string, page?: string): RpcCall<OrdPaginatedIds>;
|
|
320
|
+
ord_getInscriptionIdBySatAt(satoshiNumber: string, index?: string): RpcCall<{
|
|
321
|
+
id: string;
|
|
322
|
+
}>;
|
|
323
|
+
ord_getRuneByName(runeName: string): RpcCall<unknown>;
|
|
324
|
+
ord_getRuneById(runeId: string): RpcCall<unknown>;
|
|
325
|
+
ord_getRunes(): RpcCall<unknown>;
|
|
326
|
+
ord_getAddressData(address: string): RpcCall<unknown>;
|
|
327
|
+
ord_getInscriptionMetadata(inscriptionId: string): Promise<BoxedResponse<unknown, string>>;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
interface EncodedAlkaneId {
|
|
331
|
+
block: string;
|
|
332
|
+
tx: string;
|
|
333
|
+
}
|
|
334
|
+
type AlkaneEncoded = {
|
|
335
|
+
value: string;
|
|
336
|
+
} & EncodedAlkaneId;
|
|
337
|
+
type AlkaneId = {
|
|
338
|
+
block: bigint;
|
|
339
|
+
tx: bigint;
|
|
340
|
+
};
|
|
341
|
+
type Alkane = {
|
|
342
|
+
value: bigint;
|
|
343
|
+
} & AlkaneId;
|
|
344
|
+
interface AlkaneRune {
|
|
345
|
+
rune: {
|
|
346
|
+
id: EncodedAlkaneId;
|
|
347
|
+
name: string;
|
|
348
|
+
spacedName: string;
|
|
349
|
+
divisibility: number;
|
|
350
|
+
spacers: number;
|
|
351
|
+
symbol: string;
|
|
352
|
+
};
|
|
353
|
+
balance: string;
|
|
354
|
+
}
|
|
355
|
+
interface ProtoRunesToken {
|
|
356
|
+
id: EncodedAlkaneId;
|
|
357
|
+
name: string;
|
|
358
|
+
symbol: string;
|
|
359
|
+
}
|
|
360
|
+
type AlkaneReadableId = string;
|
|
361
|
+
type AlkanesUtxoEntry = {
|
|
362
|
+
value: string;
|
|
363
|
+
name: string;
|
|
364
|
+
symbol: string;
|
|
365
|
+
id: string;
|
|
366
|
+
};
|
|
367
|
+
type AlkanesOutpoint = {
|
|
368
|
+
token: {
|
|
369
|
+
id: {
|
|
370
|
+
block: string;
|
|
371
|
+
tx: string;
|
|
372
|
+
};
|
|
373
|
+
name: string;
|
|
374
|
+
symbol: string;
|
|
375
|
+
};
|
|
376
|
+
value: string;
|
|
377
|
+
};
|
|
378
|
+
type AlkanesOutpointExtended = AlkanesOutpoint & {
|
|
379
|
+
outpoint: string;
|
|
380
|
+
};
|
|
381
|
+
type AlkanesOutpoints = AlkanesOutpoint[];
|
|
382
|
+
type AlkanesOutpointsExtended = AlkanesOutpointExtended[];
|
|
383
|
+
type AlkanesByAddressResponse = {
|
|
384
|
+
outpoints: AlkanesByAddressOutpoint[];
|
|
385
|
+
};
|
|
386
|
+
type AlkanesByAddressOutpoint = {
|
|
387
|
+
runes: AlkanesByAddressRuneBalance[];
|
|
388
|
+
outpoint: {
|
|
389
|
+
txid: string;
|
|
390
|
+
vout: number;
|
|
391
|
+
};
|
|
392
|
+
output: {
|
|
393
|
+
value: number;
|
|
394
|
+
script: string;
|
|
395
|
+
};
|
|
396
|
+
height: number;
|
|
397
|
+
txindex: number;
|
|
398
|
+
};
|
|
399
|
+
type AlkanesByAddressRuneBalance = {
|
|
400
|
+
rune: {
|
|
401
|
+
id: {
|
|
402
|
+
block: string;
|
|
403
|
+
tx: string;
|
|
404
|
+
};
|
|
405
|
+
name: string;
|
|
406
|
+
spacedName: string;
|
|
407
|
+
divisibility: number;
|
|
408
|
+
spacers: number;
|
|
409
|
+
symbol: string;
|
|
410
|
+
};
|
|
411
|
+
balance: string;
|
|
412
|
+
};
|
|
413
|
+
interface AlkaneSimulateRequest {
|
|
414
|
+
alkanes?: any[];
|
|
415
|
+
transaction?: string;
|
|
416
|
+
height?: string;
|
|
417
|
+
txindex?: number;
|
|
418
|
+
target: AlkaneId;
|
|
419
|
+
callData: bigint[];
|
|
420
|
+
pointer?: number;
|
|
421
|
+
refundPointer?: number;
|
|
422
|
+
vout?: number;
|
|
423
|
+
}
|
|
424
|
+
type AlkaneEncodedSimulationRequest = {
|
|
425
|
+
alkanes: any[];
|
|
426
|
+
transaction: string;
|
|
427
|
+
block: string;
|
|
428
|
+
height: string;
|
|
429
|
+
txindex: number;
|
|
430
|
+
target: EncodedAlkaneId;
|
|
431
|
+
inputs: string[];
|
|
432
|
+
pointer: number;
|
|
433
|
+
refundPointer: number;
|
|
434
|
+
vout: number;
|
|
435
|
+
};
|
|
436
|
+
interface AlkaneToken {
|
|
437
|
+
name: string;
|
|
438
|
+
symbol: string;
|
|
439
|
+
totalSupply: number;
|
|
440
|
+
cap: number;
|
|
441
|
+
minted: number;
|
|
442
|
+
mintActive: boolean;
|
|
443
|
+
percentageMinted: number;
|
|
444
|
+
mintAmount: number;
|
|
445
|
+
}
|
|
446
|
+
interface AlkanesParsedSimulationResult {
|
|
447
|
+
string: string;
|
|
448
|
+
bytes: string;
|
|
449
|
+
le: string;
|
|
450
|
+
be: string;
|
|
451
|
+
}
|
|
452
|
+
interface AlkanesRawSimulationResponse {
|
|
453
|
+
status: number;
|
|
454
|
+
gasUsed: number;
|
|
455
|
+
execution: {
|
|
456
|
+
alkanes: unknown[];
|
|
457
|
+
storage: unknown[];
|
|
458
|
+
data: string;
|
|
459
|
+
error?: string;
|
|
460
|
+
};
|
|
461
|
+
parsed: unknown;
|
|
462
|
+
}
|
|
463
|
+
type AlkanesSimulationResult = {
|
|
464
|
+
raw: AlkanesRawSimulationResponse;
|
|
465
|
+
parsed: AlkanesParsedSimulationResult | undefined;
|
|
466
|
+
};
|
|
467
|
+
interface AlkanesTraceEncodedCreateEvent {
|
|
468
|
+
event: "create";
|
|
469
|
+
data: EncodedAlkaneId;
|
|
470
|
+
}
|
|
471
|
+
interface AlkanesTraceEncodedInvokeEvent {
|
|
472
|
+
event: "invoke";
|
|
473
|
+
data: {
|
|
474
|
+
type: "call";
|
|
475
|
+
context: {
|
|
476
|
+
myself: EncodedAlkaneId;
|
|
477
|
+
caller: EncodedAlkaneId;
|
|
478
|
+
inputs: string[];
|
|
479
|
+
incomingAlkanes: AlkaneEncoded[];
|
|
480
|
+
vout: number;
|
|
481
|
+
};
|
|
482
|
+
fuel: number;
|
|
483
|
+
};
|
|
484
|
+
}
|
|
485
|
+
interface AlkanesTraceEncodedReturnEvent {
|
|
486
|
+
event: "return";
|
|
487
|
+
data: {
|
|
488
|
+
status: "success";
|
|
489
|
+
response: {
|
|
490
|
+
alkanes: AlkaneEncoded[];
|
|
491
|
+
data: string;
|
|
492
|
+
storage: {
|
|
493
|
+
key: string;
|
|
494
|
+
value: string;
|
|
495
|
+
}[];
|
|
496
|
+
};
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
type AlkanesTraceEncodedEvent = AlkanesTraceEncodedCreateEvent | AlkanesTraceEncodedInvokeEvent | AlkanesTraceEncodedReturnEvent;
|
|
500
|
+
type AlkanesTraceEncodedResult = AlkanesTraceEncodedEvent[];
|
|
501
|
+
interface AlkanesTraceCreateEvent {
|
|
502
|
+
event: "create";
|
|
503
|
+
data: AlkaneId;
|
|
504
|
+
}
|
|
505
|
+
interface AlkanesTraceInvokeEvent {
|
|
506
|
+
event: "invoke";
|
|
507
|
+
data: {
|
|
508
|
+
type: "call";
|
|
509
|
+
context: {
|
|
510
|
+
myself: AlkaneId;
|
|
511
|
+
caller: AlkaneId;
|
|
512
|
+
inputs: bigint[];
|
|
513
|
+
incomingAlkanes: Alkane[];
|
|
514
|
+
vout: number;
|
|
515
|
+
};
|
|
516
|
+
fuel: number;
|
|
517
|
+
};
|
|
518
|
+
}
|
|
519
|
+
interface AlkanesTraceReturnEvent {
|
|
520
|
+
event: "return";
|
|
521
|
+
data: {
|
|
522
|
+
status: "success" | "revert";
|
|
523
|
+
response: {
|
|
524
|
+
alkanes: Alkane[];
|
|
525
|
+
data: string;
|
|
526
|
+
storage: {
|
|
527
|
+
key: string;
|
|
528
|
+
value: bigint;
|
|
529
|
+
}[];
|
|
530
|
+
};
|
|
531
|
+
};
|
|
532
|
+
}
|
|
533
|
+
type AlkanesTraceEvent = AlkanesTraceCreateEvent | AlkanesTraceInvokeEvent | AlkanesTraceReturnEvent;
|
|
534
|
+
type AlkanesTraceResult = AlkanesTraceEvent[];
|
|
535
|
+
|
|
536
|
+
type FormattedUtxo = {
|
|
537
|
+
txId: string;
|
|
538
|
+
outputIndex: number;
|
|
539
|
+
satoshis: number;
|
|
540
|
+
scriptPk: string;
|
|
541
|
+
address: string;
|
|
542
|
+
inscriptions: string[];
|
|
543
|
+
runes: Record<RuneName, OrdOutputRune>;
|
|
544
|
+
alkanes: Record<AlkaneReadableId, AlkanesUtxoEntry>;
|
|
545
|
+
confirmations: number;
|
|
546
|
+
indexed: boolean;
|
|
547
|
+
prevTx: IEsploraTransaction;
|
|
548
|
+
prevTxHex: string;
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
declare enum SandshrewFetchError {
|
|
552
|
+
UnknownError = "UnknownError",
|
|
553
|
+
InternalError = "InternalError"
|
|
554
|
+
}
|
|
555
|
+
declare class SandshrewRpcProvider {
|
|
556
|
+
private readonly provider;
|
|
557
|
+
private readonly electrumApiProvider;
|
|
558
|
+
private readonly ordRpcProvider;
|
|
559
|
+
private readonly alkanesRpcProvider;
|
|
560
|
+
constructor(provider: Provider, electrumApiProvider: ElectrumApiProvider, ordRpcProvider: OrdRpcProvider, alkanesRpcProvider: AlkanesRpcProvider);
|
|
561
|
+
sandshrew_multcall<T>(rpcCalls: RpcCall<T>[]): Promise<BoxedResponse<T[], SandshrewFetchError>>;
|
|
562
|
+
sandshrew_getFormattedUtxosForAddress(address: string): Promise<BoxedResponse<FormattedUtxo[], SandshrewFetchError>>;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
interface Rune {
|
|
566
|
+
id: string;
|
|
567
|
+
name: string;
|
|
568
|
+
spacedName: string;
|
|
569
|
+
divisibility: number;
|
|
570
|
+
spacers: number;
|
|
571
|
+
symbol: string;
|
|
572
|
+
}
|
|
573
|
+
interface RuneBalance {
|
|
574
|
+
rune: Rune;
|
|
575
|
+
balance: string;
|
|
576
|
+
}
|
|
577
|
+
interface RunesOutpoint {
|
|
578
|
+
runes: RuneBalance[];
|
|
579
|
+
outpoint: {
|
|
580
|
+
txid: string;
|
|
581
|
+
vout: number;
|
|
582
|
+
};
|
|
583
|
+
output: {
|
|
584
|
+
value: string;
|
|
585
|
+
script: string;
|
|
586
|
+
};
|
|
587
|
+
height: number;
|
|
588
|
+
txindex: number;
|
|
589
|
+
}
|
|
590
|
+
interface RunesAddressResult {
|
|
591
|
+
outpoints: RunesOutpoint[];
|
|
592
|
+
balanceSheet: RuneBalance[];
|
|
593
|
+
}
|
|
594
|
+
type RunesOutpointResult = RunesOutpoint;
|
|
595
|
+
|
|
596
|
+
declare enum RunesFetchError {
|
|
597
|
+
UnknownError = "UnknownError",
|
|
598
|
+
RpcError = "RpcError"
|
|
599
|
+
}
|
|
600
|
+
declare class RunesRpcProvider {
|
|
601
|
+
private readonly provider;
|
|
602
|
+
constructor(provider: Provider);
|
|
603
|
+
private get rpc();
|
|
604
|
+
runes_getAddress(address: string, blockHeight?: string): RpcCall<RunesAddressResult>;
|
|
605
|
+
runes_getOutpoint(txidAndVout: string, blockHeight?: string): RpcCall<RunesOutpoint>;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
declare class BaseRpcProvider {
|
|
609
|
+
readonly electrum: ElectrumApiProvider;
|
|
610
|
+
readonly ord: OrdRpcProvider;
|
|
611
|
+
readonly alkanes: AlkanesRpcProvider;
|
|
612
|
+
readonly sandshrew: SandshrewRpcProvider;
|
|
613
|
+
readonly runes: RunesRpcProvider;
|
|
614
|
+
constructor(coreProvider: Provider);
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
declare const stripHex: (s: string) => string;
|
|
618
|
+
declare function toU64LittleEndianHex(numStr: string): string;
|
|
619
|
+
declare function makeFakeBlock(height: number | bigint): string;
|
|
620
|
+
declare function toU64BigEndianHex(numStr: string): string;
|
|
621
|
+
declare function toU128LittleEndianHex(numStr: string): string;
|
|
622
|
+
declare function mapToPrimitives(v: any): any;
|
|
623
|
+
declare function unmapFromPrimitives(v: any): any;
|
|
624
|
+
declare function parseSimulateReturn(v: string): AlkanesParsedSimulationResult | undefined;
|
|
625
|
+
declare function decodeAlkanesTrace(encoded: AlkanesTraceEncodedResult): AlkanesTraceResult;
|
|
626
|
+
declare function extractAbiErrorMessage(data: string): string | null;
|
|
627
|
+
|
|
628
|
+
declare enum AlkanesFetchError {
|
|
629
|
+
UnknownError = "UnknownError",
|
|
630
|
+
RpcError = "RpcError"
|
|
631
|
+
}
|
|
632
|
+
declare enum AlkanesTraceError {
|
|
633
|
+
DecodeError = "DecodeError",
|
|
634
|
+
NoTraceFound = "NoTraceFound",
|
|
635
|
+
TransactionReverted = "TransactionReverted"
|
|
636
|
+
}
|
|
637
|
+
declare class AlkanesRpcProvider {
|
|
638
|
+
private readonly provider;
|
|
639
|
+
constructor(provider: Provider);
|
|
640
|
+
private get rpc();
|
|
641
|
+
alkanes_metashrewHeight(): RpcCall<string>;
|
|
642
|
+
alkanes_getAlkanesByAddress(address: string, protocolTag?: string, runeName?: string): Promise<BoxedResponse<AlkanesByAddressResponse, string>>;
|
|
643
|
+
alkanes_getAlkanesByHeight(height: number, protocolTag?: string): void;
|
|
644
|
+
alkanes_getAlkanesByOutpoint(txid: string, vout: number, protocolTag?: string, height?: string): RpcCall<AlkanesOutpoints[]>;
|
|
645
|
+
alkanes_trace(txid: string, vout: number): {
|
|
646
|
+
payload: (string | {
|
|
647
|
+
txid: string;
|
|
648
|
+
vout: number;
|
|
649
|
+
}[])[];
|
|
650
|
+
call: () => Promise<BoxedResponse<AlkanesTraceResult, AlkanesTraceError>>;
|
|
651
|
+
};
|
|
652
|
+
alkanes_getAlkaneById(id: AlkaneId): RpcCall<unknown>;
|
|
653
|
+
alkanes_simulate(req: AlkaneSimulateRequest): Promise<BoxedResponse<AlkanesSimulationResult, string>>;
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
/**
|
|
657
|
+
* Schema that accepts any bigint in the closed interval
|
|
658
|
+
* [0, 2^128 - 1]. Throws a ZodError otherwise.
|
|
659
|
+
*/
|
|
660
|
+
declare const u128Schema: z.ZodEffects<z.ZodBigInt, bigint, bigint>;
|
|
661
|
+
declare const schemaAlkaneId: BorshSchema<{
|
|
662
|
+
block: number;
|
|
663
|
+
tx: bigint;
|
|
664
|
+
}>;
|
|
665
|
+
type ISchemaAlkaneId = Infer<typeof schemaAlkaneId>;
|
|
666
|
+
|
|
667
|
+
declare const sleep: (ms: number) => Promise<unknown>;
|
|
668
|
+
declare function hexToUint8Array(hex: string): Uint8Array;
|
|
669
|
+
declare function excludeFields<K, T extends object>(obj: T, fields: (keyof T)[]): K;
|
|
670
|
+
type Expand<T> = T extends infer O ? {
|
|
671
|
+
[K in keyof O]: O[K];
|
|
672
|
+
} : never;
|
|
673
|
+
declare class ParsableAlkaneId {
|
|
674
|
+
readonly alkaneId: AlkaneId | ISchemaAlkaneId;
|
|
675
|
+
constructor(alkaneId: AlkaneId | ISchemaAlkaneId);
|
|
676
|
+
toSchemaAlkaneId(): ISchemaAlkaneId;
|
|
677
|
+
toAlkaneId(): AlkaneId;
|
|
678
|
+
}
|
|
679
|
+
declare function reverseHexBytes(hex: string): string;
|
|
680
|
+
|
|
681
|
+
type PsbtInputExtended = Expand<Parameters<Psbt["addInput"]>[0]>;
|
|
682
|
+
type IFeeOpts = {
|
|
683
|
+
vsize: number;
|
|
684
|
+
input_length: number;
|
|
685
|
+
};
|
|
686
|
+
declare class AlkanesInscription<T> {
|
|
687
|
+
readonly shape: T;
|
|
688
|
+
readonly borshSchema: BorshSchema<T>;
|
|
689
|
+
constructor(shape: T, borshSchema: BorshSchema<T>);
|
|
690
|
+
}
|
|
691
|
+
declare class ProtostoneTransactionWithInscription<T> {
|
|
692
|
+
private readonly changeAddress;
|
|
693
|
+
private readonly inscription;
|
|
694
|
+
private readonly opts;
|
|
695
|
+
private commitBuilder;
|
|
696
|
+
private revealBuilder;
|
|
697
|
+
private script;
|
|
698
|
+
private commitPsbt?;
|
|
699
|
+
private tweakedDummySigner;
|
|
700
|
+
private tweakedPublicKey;
|
|
701
|
+
private revealPsbt?;
|
|
702
|
+
private inscriptionBytes;
|
|
703
|
+
private baseSigner;
|
|
704
|
+
private signedCommitTx;
|
|
705
|
+
private signedCommitEsploraTx;
|
|
706
|
+
private baseFeeRate;
|
|
707
|
+
private utxoTweak;
|
|
708
|
+
constructor(changeAddress: string, inscription: AlkanesInscription<T>, opts: ProtostoneTransactionOptions);
|
|
709
|
+
buildCommit(): Promise<Psbt>;
|
|
710
|
+
finalizeCommit(txHex: string): void;
|
|
711
|
+
buildReveal(): Promise<Psbt>;
|
|
712
|
+
extractPsbts(): [string, string];
|
|
713
|
+
private taprootAddress;
|
|
714
|
+
}
|
|
715
|
+
declare class ProtostoneTransaction {
|
|
716
|
+
private readonly addressProvided;
|
|
717
|
+
private readonly options;
|
|
718
|
+
private MINIMUM_FEE;
|
|
719
|
+
private MINIMUM_PROTOCOL_DUST;
|
|
720
|
+
private availableUtxos;
|
|
721
|
+
private utxos;
|
|
722
|
+
private psbt;
|
|
723
|
+
fee: number;
|
|
724
|
+
private transactionOptions;
|
|
725
|
+
private changeAddress;
|
|
726
|
+
private cumulativeSpendRequirementBtc;
|
|
727
|
+
private cumulativeSpendRequirementAlkanes;
|
|
728
|
+
private cumulativeValueInPsbts;
|
|
729
|
+
constructor(addressProvided: string, options: ProtostoneTransactionOptions);
|
|
730
|
+
private get sandshrew_getFormattedUtxosForAddress();
|
|
731
|
+
private get esplora_getfee();
|
|
732
|
+
private addInputDynamic;
|
|
733
|
+
private fetchResources;
|
|
734
|
+
private calculateFee;
|
|
735
|
+
private calcCumulativeSpendRequirements;
|
|
736
|
+
private mappableAlkaneId;
|
|
737
|
+
private isUnlockedUtxo;
|
|
738
|
+
private getAlkanesUtxosToMeetAlkanesRequirement;
|
|
739
|
+
private getEsploraUtxosToMeetAllRequirements;
|
|
740
|
+
private fetchUtxos;
|
|
741
|
+
private initialize;
|
|
742
|
+
private getBtcOutputs;
|
|
743
|
+
private addOutputs;
|
|
744
|
+
private addInputs;
|
|
745
|
+
private createEdicts;
|
|
746
|
+
private addProtostoneData;
|
|
747
|
+
private appendSinglePsbtToTx;
|
|
748
|
+
private appendPsbtsToTx;
|
|
749
|
+
build(): Promise<[number, Buffer | undefined]>;
|
|
750
|
+
finalizeWithDry(): Promise<Transaction>;
|
|
751
|
+
extractPsbtBase64(): string;
|
|
752
|
+
getPsbt(): Psbt;
|
|
753
|
+
}
|
|
754
|
+
type SingularBTCTransfer = {
|
|
755
|
+
asset: "btc";
|
|
756
|
+
amount: number;
|
|
757
|
+
address: string;
|
|
758
|
+
ignorePush?: boolean;
|
|
759
|
+
};
|
|
760
|
+
type SingularAlkanesTransfer = {
|
|
761
|
+
asset: AlkaneId;
|
|
762
|
+
amount: bigint;
|
|
763
|
+
address: string;
|
|
764
|
+
};
|
|
765
|
+
type SingularTransfer = SingularBTCTransfer | SingularAlkanesTransfer;
|
|
766
|
+
type ProtostoneTransactionOptions = (typeof ProtostoneTransaction)["prototype"]["transactionOptions"];
|
|
767
|
+
type IProtostoneTransactionDryRunResponse = {
|
|
768
|
+
dummyTx: Transaction;
|
|
769
|
+
dummyInputLength: number;
|
|
770
|
+
useMaraPool: boolean;
|
|
771
|
+
feeOpts: IFeeOpts;
|
|
772
|
+
};
|
|
773
|
+
declare function getDummyProtostoneTransaction(addressProvided: string, options: ProtostoneTransactionOptions): Promise<BoxedResponse<IProtostoneTransactionDryRunResponse, string>>;
|
|
774
|
+
declare function getProtostoneUnsignedPsbtBase64(addressProvided: string, options: Omit<ProtostoneTransactionOptions, "psbtTransfers">): Promise<BoxedResponse<{
|
|
775
|
+
fee: number;
|
|
776
|
+
psbtBase64: string;
|
|
777
|
+
vsize: number;
|
|
778
|
+
useMaraPool: boolean;
|
|
779
|
+
}, string>>;
|
|
780
|
+
declare function getProtostoneTransactionsWithInscription<T>(addressProvided: string, inscription: AlkanesInscription<T>, signPsbt: (unisignedPsbtBase64: string) => Promise<string>, options: Omit<ProtostoneTransactionOptions, "psbtTransfers">): Promise<BoxedResponse<[string, string], string>>;
|
|
781
|
+
|
|
782
|
+
declare enum AddressType {
|
|
783
|
+
P2PKH = 0,
|
|
784
|
+
P2TR = 1,
|
|
785
|
+
P2SH_P2WPKH = 2,
|
|
786
|
+
P2WPKH = 3
|
|
787
|
+
}
|
|
788
|
+
type Account = {
|
|
789
|
+
taproot: {
|
|
790
|
+
pubkey: string;
|
|
791
|
+
pubKeyXOnly: string;
|
|
792
|
+
address: string;
|
|
793
|
+
hdPath: string;
|
|
794
|
+
};
|
|
795
|
+
nativeSegwit: {
|
|
796
|
+
pubkey: string;
|
|
797
|
+
address: string;
|
|
798
|
+
hdPath: string;
|
|
799
|
+
};
|
|
800
|
+
nestedSegwit: {
|
|
801
|
+
pubkey: string;
|
|
802
|
+
address: string;
|
|
803
|
+
hdPath: string;
|
|
804
|
+
};
|
|
805
|
+
legacy: {
|
|
806
|
+
pubkey: string;
|
|
807
|
+
address: string;
|
|
808
|
+
hdPath: string;
|
|
809
|
+
};
|
|
810
|
+
spendStrategy: SpendStrategy;
|
|
811
|
+
network: bitcoin.Network;
|
|
812
|
+
};
|
|
813
|
+
type AddressKey = "nativeSegwit" | "taproot" | "nestedSegwit" | "legacy";
|
|
814
|
+
type WalletStandard = "bip44_account_last" | "bip44_standard" | "bip32_simple";
|
|
815
|
+
type HDPaths = {
|
|
816
|
+
legacy?: string;
|
|
817
|
+
nestedSegwit?: string;
|
|
818
|
+
nativeSegwit?: string;
|
|
819
|
+
taproot?: string;
|
|
820
|
+
};
|
|
821
|
+
interface SpendStrategy {
|
|
822
|
+
addressOrder: AddressKey[];
|
|
823
|
+
utxoSortGreatestToLeast: boolean;
|
|
824
|
+
changeAddress: AddressKey;
|
|
825
|
+
}
|
|
826
|
+
type AlkanesUtxo = {
|
|
827
|
+
id: string;
|
|
828
|
+
value_sats: string;
|
|
829
|
+
block: number;
|
|
830
|
+
vout_index: number;
|
|
831
|
+
transaction: string | null;
|
|
832
|
+
};
|
|
833
|
+
type AlkaneDetails = {
|
|
834
|
+
id: {
|
|
835
|
+
block: bigint;
|
|
836
|
+
tx: bigint;
|
|
837
|
+
};
|
|
838
|
+
name: string;
|
|
839
|
+
spacedName: string;
|
|
840
|
+
divisibility: number;
|
|
841
|
+
spacers: number;
|
|
842
|
+
symbol: string;
|
|
843
|
+
};
|
|
844
|
+
interface AlkanesUtxoBalance {
|
|
845
|
+
balance: bigint;
|
|
846
|
+
utxo: AlkanesUtxo;
|
|
847
|
+
alkane: AlkaneDetails;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
declare const EcPair: ecpair.ECPairAPI;
|
|
851
|
+
type BasePsbtParams = {
|
|
852
|
+
feeRate?: number;
|
|
853
|
+
fee?: number;
|
|
854
|
+
};
|
|
855
|
+
declare const addressFormats: {
|
|
856
|
+
readonly mainnet: {
|
|
857
|
+
readonly p2pkh: RegExp;
|
|
858
|
+
readonly p2sh: RegExp;
|
|
859
|
+
readonly p2wpkh: RegExp;
|
|
860
|
+
readonly p2wsh: RegExp;
|
|
861
|
+
readonly p2tr: RegExp;
|
|
862
|
+
};
|
|
863
|
+
readonly testnet: {
|
|
864
|
+
readonly p2pkh: RegExp;
|
|
865
|
+
readonly p2sh: RegExp;
|
|
866
|
+
readonly p2wpkh: RegExp;
|
|
867
|
+
readonly p2wsh: RegExp;
|
|
868
|
+
readonly p2tr: RegExp;
|
|
869
|
+
};
|
|
870
|
+
readonly signet: {
|
|
871
|
+
readonly p2pkh: RegExp;
|
|
872
|
+
readonly p2sh: RegExp;
|
|
873
|
+
readonly p2wpkh: RegExp;
|
|
874
|
+
readonly p2wsh: RegExp;
|
|
875
|
+
readonly p2tr: RegExp;
|
|
876
|
+
};
|
|
877
|
+
readonly regtest: {
|
|
878
|
+
readonly p2pkh: RegExp;
|
|
879
|
+
readonly p2sh: RegExp;
|
|
880
|
+
readonly p2wpkh: RegExp;
|
|
881
|
+
readonly p2wsh: RegExp;
|
|
882
|
+
readonly p2tr: RegExp;
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
declare const addressTypeToName: {
|
|
886
|
+
readonly p2pkh: "legacy";
|
|
887
|
+
readonly p2sh: "nested-segwit";
|
|
888
|
+
readonly p2wsh: "native-segwit";
|
|
889
|
+
readonly p2wpkh: "segwit";
|
|
890
|
+
readonly p2tr: "taproot";
|
|
891
|
+
};
|
|
892
|
+
declare const addressNameToType: {
|
|
893
|
+
readonly legacy: "p2pkh";
|
|
894
|
+
readonly segwit: "p2wpkh";
|
|
895
|
+
readonly "nested-segwit": "p2sh";
|
|
896
|
+
readonly "native-segwit": "p2wsh";
|
|
897
|
+
readonly taproot: "p2tr";
|
|
898
|
+
};
|
|
899
|
+
declare function getAddressType(address: string): AddressType | null;
|
|
900
|
+
declare function redeemTypeFromOutput(script: Buffer, network: bitcoin.Network): AddressType | null;
|
|
901
|
+
declare function addInputDynamic(psbt: bitcoin.Psbt, network: bitcoin.Network, utxo: FormattedUtxo): void;
|
|
902
|
+
declare const psbtBuilder: <T extends BasePsbtParams>(provider: Provider, psbtBuilder: (params: T) => Promise<{
|
|
903
|
+
psbtBase64: string;
|
|
904
|
+
fee?: number;
|
|
905
|
+
}>, params: T) => Promise<{
|
|
906
|
+
psbtBase64: string;
|
|
907
|
+
fee: number;
|
|
908
|
+
vsize: number;
|
|
909
|
+
}>;
|
|
910
|
+
declare const getEstimatedFee: ({ provider, feeRate, psbtBase64, }: {
|
|
911
|
+
provider: Provider;
|
|
912
|
+
feeRate: number;
|
|
913
|
+
psbtBase64: string;
|
|
914
|
+
}) => Promise<{
|
|
915
|
+
fee: number;
|
|
916
|
+
vsize: number;
|
|
917
|
+
}>;
|
|
918
|
+
declare function calculateTaprootTxSize(taprootInputCount: number, nonTaprootInputCount: number, outputCount: number): number;
|
|
919
|
+
declare const minimumFee: ({ taprootInputCount, nonTaprootInputCount, outputCount, }: {
|
|
920
|
+
taprootInputCount: number;
|
|
921
|
+
nonTaprootInputCount: number;
|
|
922
|
+
outputCount: number;
|
|
923
|
+
}) => number;
|
|
924
|
+
declare function trimUndefined<T extends object>(obj: T): T;
|
|
925
|
+
declare function extractWithDummySigs(psbt: bitcoin.Psbt): bitcoin.Transaction;
|
|
926
|
+
declare function toEsploraTx(tx: bitcoin.Transaction, status?: IEsploraTransactionStatus, network?: bitcoin.Network): IEsploraTransaction;
|
|
927
|
+
declare function witnessStackToScriptWitness(stack: Buffer[]): Buffer;
|
|
928
|
+
declare function tapTweakHash(pubKey: Buffer, h: Buffer | undefined): Buffer;
|
|
929
|
+
declare const assertHex: (pubKey: Buffer) => Buffer<ArrayBufferLike>;
|
|
930
|
+
declare function tweakSigner(signer: ECPairInterface, opts: {
|
|
931
|
+
network: bitcoin.Network;
|
|
932
|
+
tweakHash?: Buffer;
|
|
933
|
+
}): bitcoin.Signer;
|
|
934
|
+
declare const getVSize: (data: Buffer) => number;
|
|
935
|
+
declare const formatInputsToSign: ({ _psbt, senderPublicKey, network, }: {
|
|
936
|
+
_psbt: bitcoin.Psbt;
|
|
937
|
+
senderPublicKey: string;
|
|
938
|
+
network: bitcoin.Network;
|
|
939
|
+
}) => bitcoin.Psbt;
|
|
940
|
+
declare const toFormattedUtxo: (esploraTx: IEsploraTransaction, hex: string, address: string, vout: number) => FormattedUtxo;
|
|
941
|
+
|
|
942
|
+
declare enum AlkanesExecuteError {
|
|
943
|
+
UnknownError = "UnknownError",
|
|
944
|
+
InvalidParams = "InvalidParams"
|
|
945
|
+
}
|
|
946
|
+
interface AlkanesExecuteResponse {
|
|
947
|
+
psbt: string;
|
|
948
|
+
fee: number;
|
|
949
|
+
vsize: number;
|
|
950
|
+
}
|
|
951
|
+
declare const simulate: (provider: Provider, params: AlkaneSimulateRequest) => Promise<BoxedResponse<AlkanesSimulationResult, string>>;
|
|
952
|
+
declare const execute: ({ provider, address, callData, feeRate, transfers, inscription, signPsbt, }: {
|
|
953
|
+
provider: Provider;
|
|
954
|
+
address: string;
|
|
955
|
+
callData: bigint[];
|
|
956
|
+
signPsbt: (unsignedPsbtBase64: string) => Promise<string>;
|
|
957
|
+
feeRate?: number;
|
|
958
|
+
transfers?: SingularTransfer[];
|
|
959
|
+
inscription?: AlkanesInscription<unknown>;
|
|
960
|
+
}) => Promise<BoxedResponse<string[], AlkanesExecuteError>>;
|
|
961
|
+
|
|
962
|
+
interface DecoderFns<Obj> {
|
|
963
|
+
string: (bytes: Uint8Array) => string;
|
|
964
|
+
boolean: (bytes: Uint8Array) => boolean;
|
|
965
|
+
bigint: (bytes: Uint8Array) => bigint;
|
|
966
|
+
hex: (bytes: Uint8Array) => string;
|
|
967
|
+
uint8Array: (bytes: Uint8Array) => Uint8Array;
|
|
968
|
+
bigintArray: (bytes: Uint8Array) => bigint[];
|
|
969
|
+
tokenValue: (bytes: Uint8Array) => number;
|
|
970
|
+
object: (bytes: Uint8Array) => Obj;
|
|
971
|
+
}
|
|
972
|
+
/** all legal strings accepted by `decodeTo` */
|
|
973
|
+
type AvailableDecodeKind = keyof DecoderFns<unknown>;
|
|
974
|
+
declare class DecodableAlkanesResponse<T = unknown> {
|
|
975
|
+
readonly bytes: Uint8Array;
|
|
976
|
+
private readonly borshSchema?;
|
|
977
|
+
constructor(payload: Uint8Array | bigint | AlkanesSimulationResult | AlkanesTraceReturnEvent["data"], schema?: BorshSchema<T>);
|
|
978
|
+
private decoderTable;
|
|
979
|
+
decodeTo<K extends AvailableDecodeKind>(kind: K): ReturnType<DecoderFns<T>[K]>;
|
|
980
|
+
}
|
|
981
|
+
type IDecodableAlkanesResponse<T> = DecodableAlkanesResponse<T>;
|
|
982
|
+
declare enum DecodeError {
|
|
983
|
+
UnknownError = "UnknownError"
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
declare enum EncodeError {
|
|
987
|
+
InvalidPayload = "Invalid payload type",
|
|
988
|
+
NameTooLong = "Name payload exceeds 2 \u00D7 u128",
|
|
989
|
+
CharTooLong = "Char payload exceeds 1 \u00D7 u128",
|
|
990
|
+
BorshMissing = "Borsh schema is required for object serialization"
|
|
991
|
+
}
|
|
992
|
+
interface EncoderFns<Obj> {
|
|
993
|
+
string: (data: unknown) => BoxedResponse<bigint[], EncodeError>;
|
|
994
|
+
name: (data: unknown) => BoxedResponse<bigint[], EncodeError>;
|
|
995
|
+
bigint: (data: unknown) => BoxedResponse<bigint[], EncodeError>;
|
|
996
|
+
char: (data: unknown) => BoxedResponse<bigint[], EncodeError>;
|
|
997
|
+
object: (data: unknown, schema?: BorshSchema<Obj>) => BoxedResponse<bigint[], EncodeError>;
|
|
998
|
+
}
|
|
999
|
+
type AvailableEncodeKind = keyof EncoderFns<unknown>;
|
|
1000
|
+
declare class Encodable<T = unknown> {
|
|
1001
|
+
readonly payload: unknown;
|
|
1002
|
+
private readonly borshSchema?;
|
|
1003
|
+
constructor(payload: unknown, borshSchema?: BorshSchema<T> | undefined);
|
|
1004
|
+
private encoderTable;
|
|
1005
|
+
encodeFrom<K extends AvailableEncodeKind>(kind: K): BoxedResponse<bigint[], EncodeError>;
|
|
1006
|
+
}
|
|
1007
|
+
type IEncodable<T> = Expand<Encodable<T>>;
|
|
1008
|
+
|
|
1009
|
+
declare const VOID_ENC: "__void";
|
|
1010
|
+
type VoidEnc = typeof VOID_ENC;
|
|
1011
|
+
type ProtostoneTransactionOptionsPartial = Partial<ProtostoneTransactionOptions>;
|
|
1012
|
+
/** Encode‑kind augmented with a sentinel for “no args”. */
|
|
1013
|
+
type Enc = AvailableEncodeKind | VoidEnc;
|
|
1014
|
+
type Dec = Exclude<AvailableDecodeKind, "object"> | BorshSchema<any> | ArraySchema<any> | ObjectSchema<any>;
|
|
1015
|
+
interface ArraySchema<E extends Schema> {
|
|
1016
|
+
kind: "array";
|
|
1017
|
+
element: E;
|
|
1018
|
+
}
|
|
1019
|
+
interface ObjectSchema<F extends Record<string, Schema>> {
|
|
1020
|
+
kind: "object";
|
|
1021
|
+
fields: F;
|
|
1022
|
+
}
|
|
1023
|
+
type Schema = Enc | BorshSchema<any> | ArraySchema<any> | ObjectSchema<any>;
|
|
1024
|
+
type ResolveSchema<S> = S extends VoidEnc ? never : S extends "string" ? string : S extends "number" ? number : S extends "bigint" ? bigint : S extends "boolean" ? boolean : S extends BorshSchema<infer _Any> ? Infer<S> : S extends BorshSchema<any> ? Infer<S> : S extends ArraySchema<infer E> ? ResolveSchema<E>[] : S extends ObjectSchema<infer F> ? {
|
|
1025
|
+
[K in keyof F]: ResolveSchema<F[K]>;
|
|
1026
|
+
} : never;
|
|
1027
|
+
declare const VIEW_TAG: unique symbol;
|
|
1028
|
+
declare const EXEC_TAG: unique symbol;
|
|
1029
|
+
declare const CUSTOM_TAG: unique symbol;
|
|
1030
|
+
interface ViewSpec<I extends Schema = Schema, O extends Dec = Dec> {
|
|
1031
|
+
_t: typeof VIEW_TAG;
|
|
1032
|
+
opcode: bigint;
|
|
1033
|
+
input: I;
|
|
1034
|
+
output: O;
|
|
1035
|
+
impl?: (this: AlkanesBaseContract, arg: ResolveSchema<I>) => any;
|
|
1036
|
+
}
|
|
1037
|
+
/** inscription (K) is either a BorshSchema or the sentinel */
|
|
1038
|
+
interface ExecuteSpec<I extends Schema = Schema, K extends BorshSchema<any> | VoidEnc = VoidEnc, O extends Dec = Dec> {
|
|
1039
|
+
_t: typeof EXEC_TAG;
|
|
1040
|
+
opcode: bigint;
|
|
1041
|
+
input: I;
|
|
1042
|
+
output: O;
|
|
1043
|
+
inscription: K;
|
|
1044
|
+
impl?: (this: AlkanesBaseContract, address: string, arg: ResolveSchema<I>, argInscription: ResolveSchema<K>, txOpts?: ProtostoneTransactionOptionsPartial) => any;
|
|
1045
|
+
}
|
|
1046
|
+
type CustomImpl<P> = (this: AlkanesBaseContract, opcode: bigint, params: P) => any;
|
|
1047
|
+
interface CustomSpec<I, O, Impl extends CustomImpl<I>> {
|
|
1048
|
+
_t: typeof CUSTOM_TAG;
|
|
1049
|
+
opcode: bigint;
|
|
1050
|
+
input: I;
|
|
1051
|
+
output: O;
|
|
1052
|
+
impl: Impl;
|
|
1053
|
+
}
|
|
1054
|
+
type AnySpec = ViewSpec<any, any> | ExecuteSpec<any, any, any> | CustomSpec<any, any, any>;
|
|
1055
|
+
declare const createViewBuilder: <I extends Schema>(opcode: bigint, input: I) => {
|
|
1056
|
+
readonly returns: <O extends Dec = "uint8Array">(output?: O) => ViewSpec<I, O>;
|
|
1057
|
+
};
|
|
1058
|
+
declare const createExecuteBuilder: <I extends Schema = VoidEnc, K extends BorshSchema<any> | VoidEnc = VoidEnc>(opcode: bigint, input: I, inscription?: K) => {
|
|
1059
|
+
readonly returns: <O extends Dec = "uint8Array">(output?: O) => ExecuteSpec<I, K, O>;
|
|
1060
|
+
};
|
|
1061
|
+
type ExtractParam<T> = T extends (this: any, opcode: bigint, params: infer P) => any ? P : never;
|
|
1062
|
+
declare function attach<Spec extends Record<string, any>, Base extends typeof AlkanesBaseContract>(BaseClass: Base, spec: Spec): {
|
|
1063
|
+
new (...a: ConstructorParameters<Base>): (Omit<InstanceType<Base>, keyof Spec | "OpCodes"> & {
|
|
1064
|
+
OpCodes: OpcodeTable;
|
|
1065
|
+
}) & { [K in keyof Spec]: Spec[K] extends {
|
|
1066
|
+
_t: typeof VIEW_TAG;
|
|
1067
|
+
} ? (arg: Spec[K]["input"] extends "__void" ? void : ResolveSchema<Spec[K]["input"]>) => Promise<BoxedResponse<ResolveSchema<Spec[K]["output"]>, AlkanesSimulationError>> : Spec[K] extends {
|
|
1068
|
+
_t: typeof EXEC_TAG;
|
|
1069
|
+
} ? (address: string, ...args: [...Spec[K]["input"] extends "__void" ? Spec[K]["inscription"] extends "__void" ? [] : [ResolveSchema<Spec[K]["inscription"]>] : Spec[K]["inscription"] extends "__void" ? [ResolveSchema<Spec[K]["input"]>] : [ResolveSchema<Spec[K]["input"]>, ResolveSchema<Spec[K]["inscription"]>], (Partial<{
|
|
1070
|
+
provider: Provider;
|
|
1071
|
+
callData?: bigint[];
|
|
1072
|
+
ignoreAlkanesUtxoCheck?: boolean;
|
|
1073
|
+
transfers: SingularTransfer[];
|
|
1074
|
+
feeOpts?: {
|
|
1075
|
+
vsize: number;
|
|
1076
|
+
input_length: number;
|
|
1077
|
+
};
|
|
1078
|
+
feeRate?: number;
|
|
1079
|
+
availableUtxoTweak?: {
|
|
1080
|
+
remove: Set<string>;
|
|
1081
|
+
add: FormattedUtxo[];
|
|
1082
|
+
};
|
|
1083
|
+
ignoreAlkanesRequirementCheck?: boolean;
|
|
1084
|
+
psbtTransfers?: SingularBTCTransfer[];
|
|
1085
|
+
overrideInputs?: FormattedUtxo[] | null;
|
|
1086
|
+
includeInputs?: {
|
|
1087
|
+
input_extended: PsbtInputExtended;
|
|
1088
|
+
input_formatted: FormattedUtxo;
|
|
1089
|
+
}[];
|
|
1090
|
+
includePsbts?: string[];
|
|
1091
|
+
excludeProtostone?: boolean;
|
|
1092
|
+
}> | undefined)?]) => Promise<BoxedResponse<{
|
|
1093
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<ResolveSchema<Spec[K]["output"]>>, AlkanesExecuteError>>;
|
|
1094
|
+
txid: string;
|
|
1095
|
+
}, AlkanesExecuteError>> : Spec[K] extends {
|
|
1096
|
+
_t: typeof CUSTOM_TAG;
|
|
1097
|
+
} ? Spec[K]["input"] extends never ? () => ReturnType<NonNullable<Spec[K]["impl"]>> : (params: Spec[K]["input"]) => ReturnType<NonNullable<Spec[K]["impl"]>> : never; };
|
|
1098
|
+
};
|
|
1099
|
+
declare function contract<Base extends Record<string, any>>(base: Base): Base & {
|
|
1100
|
+
extend: <Extra extends Record<string, any>>(extra: Extra) => Base & Extra & {
|
|
1101
|
+
extend: <Extra_1 extends Record<string, any>>(extra: Extra_1) => Base & Extra & Extra_1 & {
|
|
1102
|
+
extend: <Extra_2 extends Record<string, any>>(extra: Extra_2) => Base & Extra & Extra_1 & Extra_2 & {
|
|
1103
|
+
extend: <Extra_3 extends Record<string, any>>(extra: Extra_3) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & {
|
|
1104
|
+
extend: <Extra_4 extends Record<string, any>>(extra: Extra_4) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & {
|
|
1105
|
+
extend: <Extra_5 extends Record<string, any>>(extra: Extra_5) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & {
|
|
1106
|
+
extend: <Extra_6 extends Record<string, any>>(extra: Extra_6) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & {
|
|
1107
|
+
extend: <Extra_7 extends Record<string, any>>(extra: Extra_7) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & {
|
|
1108
|
+
extend: <Extra_8 extends Record<string, any>>(extra: Extra_8) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & {
|
|
1109
|
+
extend: <Extra_9 extends Record<string, any>>(extra: Extra_9) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & Extra_9 & {
|
|
1110
|
+
extend: <Extra_10 extends Record<string, any>>(extra: Extra_10) => Base & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & Extra_9 & Extra_10 & {
|
|
1111
|
+
extend: /*elided*/ any;
|
|
1112
|
+
};
|
|
1113
|
+
};
|
|
1114
|
+
};
|
|
1115
|
+
};
|
|
1116
|
+
};
|
|
1117
|
+
};
|
|
1118
|
+
};
|
|
1119
|
+
};
|
|
1120
|
+
};
|
|
1121
|
+
};
|
|
1122
|
+
};
|
|
1123
|
+
};
|
|
1124
|
+
declare const abi: {
|
|
1125
|
+
readonly opcode: (code: bigint) => {
|
|
1126
|
+
readonly view: {
|
|
1127
|
+
<I extends Schema>(input: I): ReturnType<typeof createViewBuilder<I>>;
|
|
1128
|
+
(): ReturnType<typeof createViewBuilder<VoidEnc>>;
|
|
1129
|
+
};
|
|
1130
|
+
readonly execute: {
|
|
1131
|
+
<I extends Schema, K extends BorshSchema<any>>(input: I, inscription: K): ReturnType<typeof createExecuteBuilder<I, K>>;
|
|
1132
|
+
<K extends BorshSchema<any>>(input: undefined, inscription: K): ReturnType<typeof createExecuteBuilder<VoidEnc, K>>;
|
|
1133
|
+
<I extends Schema>(input: I): ReturnType<typeof createExecuteBuilder<I, VoidEnc>>;
|
|
1134
|
+
(): ReturnType<typeof createExecuteBuilder<VoidEnc, VoidEnc>>;
|
|
1135
|
+
};
|
|
1136
|
+
readonly custom: <Impl extends CustomImpl<any>, O extends Dec = "uint8Array">(impl: Impl, opts?: {
|
|
1137
|
+
output?: O;
|
|
1138
|
+
}) => CustomSpec<ExtractParam<Impl>, O, Impl>;
|
|
1139
|
+
};
|
|
1140
|
+
readonly contract: typeof contract;
|
|
1141
|
+
readonly attach: typeof attach;
|
|
1142
|
+
readonly extend: <A extends Record<string, AnySpec>, B extends Record<string, AnySpec>>(a: A, b: B) => A & B;
|
|
1143
|
+
};
|
|
1144
|
+
|
|
1145
|
+
declare enum AlkanesSimulationError {
|
|
1146
|
+
UnknownError = "UnknownError",
|
|
1147
|
+
TransactionReverted = "Revert"
|
|
1148
|
+
}
|
|
1149
|
+
type OpcodeTable = {
|
|
1150
|
+
readonly [K in string]: bigint;
|
|
1151
|
+
};
|
|
1152
|
+
type AlkanesPushExecuteResponse<T> = Expand<{
|
|
1153
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<T>, AlkanesExecuteError>>;
|
|
1154
|
+
txid: string;
|
|
1155
|
+
}>;
|
|
1156
|
+
declare abstract class AlkanesBaseContract {
|
|
1157
|
+
protected readonly provider: Provider;
|
|
1158
|
+
readonly alkaneId: AlkaneId;
|
|
1159
|
+
private readonly signPsbtFn;
|
|
1160
|
+
constructor(provider: Provider, alkaneId: AlkaneId, signPsbtFn: (unsigned: string) => Promise<string>);
|
|
1161
|
+
protected abstract get OpCodes(): OpcodeTable;
|
|
1162
|
+
protected get rpc(): <T>(method: string, params?: unknown[]) => RpcCall<T>;
|
|
1163
|
+
protected get execute(): (config: Omit<Parameters<typeof execute>[0], "provider">) => ReturnType<typeof execute>;
|
|
1164
|
+
protected get trace(): (txid: string, vout: number) => ReturnType<ReturnType<(txid: string, vout: number) => {
|
|
1165
|
+
payload: (string | {
|
|
1166
|
+
txid: string;
|
|
1167
|
+
vout: number;
|
|
1168
|
+
}[])[];
|
|
1169
|
+
call: () => Promise<BoxedResponse<AlkanesTraceResult, AlkanesTraceError>>;
|
|
1170
|
+
}>["call"]>;
|
|
1171
|
+
get signPsbt(): (unsigned: string) => Promise<string>;
|
|
1172
|
+
simulate(request: Omit<Parameters<Provider["simulate"]>[0], "target">): ReturnType<Provider["simulate"]>;
|
|
1173
|
+
private getEncodedCallData;
|
|
1174
|
+
private getDecodedResponse;
|
|
1175
|
+
pushExecute: <T>(config: Parameters<Provider["execute"]>[0], borshSchema?: BorshSchema<T>) => Promise<BoxedResponse<AlkanesPushExecuteResponse<T>, AlkanesExecuteError>>;
|
|
1176
|
+
handleView<I extends Schema, O extends Schema>(opcode: bigint, arg: ResolveSchema<I>, inShape: I, // may or may not be a BorshSchema
|
|
1177
|
+
outShape: O): Promise<BoxedResponse<ResolveSchema<O>, AlkanesSimulationError>>;
|
|
1178
|
+
handleExecute<I extends Schema, K extends BorshSchema<unknown>, O extends Dec>(address: string, opcode: bigint, arg: ResolveSchema<I>, argInscription: ResolveSchema<K> | undefined, inShape: I, inInscriptionShape: K | undefined, // may or may not be a BorshSchema
|
|
1179
|
+
outShape: O, txOpts?: Partial<ProtostoneTransactionOptions>): Promise<BoxedResponse<AlkanesPushExecuteResponse<ResolveSchema<O>>, AlkanesExecuteError>>;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
declare const paramSchema: z.ZodObject<{
|
|
1183
|
+
premine: z.ZodOptional<z.ZodBigInt>;
|
|
1184
|
+
valuePerMint: z.ZodOptional<z.ZodBigInt>;
|
|
1185
|
+
cap: z.ZodOptional<z.ZodBigInt>;
|
|
1186
|
+
name: z.ZodString;
|
|
1187
|
+
symbol: z.ZodString;
|
|
1188
|
+
}, "strip", z.ZodTypeAny, {
|
|
1189
|
+
symbol: string;
|
|
1190
|
+
name: string;
|
|
1191
|
+
premine?: bigint | undefined;
|
|
1192
|
+
valuePerMint?: bigint | undefined;
|
|
1193
|
+
cap?: bigint | undefined;
|
|
1194
|
+
}, {
|
|
1195
|
+
symbol: string;
|
|
1196
|
+
name: string;
|
|
1197
|
+
premine?: bigint | undefined;
|
|
1198
|
+
valuePerMint?: bigint | undefined;
|
|
1199
|
+
cap?: bigint | undefined;
|
|
1200
|
+
}>;
|
|
1201
|
+
type ITokenParamsSchema = z.infer<typeof paramSchema>;
|
|
1202
|
+
declare const TokenABI: {
|
|
1203
|
+
initialize: CustomSpec<{
|
|
1204
|
+
address: string;
|
|
1205
|
+
tokenParams: ITokenParamsSchema;
|
|
1206
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1207
|
+
address: string;
|
|
1208
|
+
tokenParams: ITokenParamsSchema;
|
|
1209
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1210
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1211
|
+
txid: string;
|
|
1212
|
+
}>>>;
|
|
1213
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1214
|
+
getName: ViewSpec<"__void", "string">;
|
|
1215
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1216
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1217
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1218
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1219
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1220
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1221
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1222
|
+
} & {
|
|
1223
|
+
extend: <Extra extends Record<string, any>>(extra: Extra) => {
|
|
1224
|
+
initialize: CustomSpec<{
|
|
1225
|
+
address: string;
|
|
1226
|
+
tokenParams: ITokenParamsSchema;
|
|
1227
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1228
|
+
address: string;
|
|
1229
|
+
tokenParams: ITokenParamsSchema;
|
|
1230
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1231
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1232
|
+
txid: string;
|
|
1233
|
+
}>>>;
|
|
1234
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1235
|
+
getName: ViewSpec<"__void", "string">;
|
|
1236
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1237
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1238
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1239
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1240
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1241
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1242
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1243
|
+
} & Extra & {
|
|
1244
|
+
extend: <Extra_1 extends Record<string, any>>(extra: Extra_1) => {
|
|
1245
|
+
initialize: CustomSpec<{
|
|
1246
|
+
address: string;
|
|
1247
|
+
tokenParams: ITokenParamsSchema;
|
|
1248
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1249
|
+
address: string;
|
|
1250
|
+
tokenParams: ITokenParamsSchema;
|
|
1251
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1252
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1253
|
+
txid: string;
|
|
1254
|
+
}>>>;
|
|
1255
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1256
|
+
getName: ViewSpec<"__void", "string">;
|
|
1257
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1258
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1259
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1260
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1261
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1262
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1263
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1264
|
+
} & Extra & Extra_1 & {
|
|
1265
|
+
extend: <Extra_2 extends Record<string, any>>(extra: Extra_2) => {
|
|
1266
|
+
initialize: CustomSpec<{
|
|
1267
|
+
address: string;
|
|
1268
|
+
tokenParams: ITokenParamsSchema;
|
|
1269
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1270
|
+
address: string;
|
|
1271
|
+
tokenParams: ITokenParamsSchema;
|
|
1272
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1273
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1274
|
+
txid: string;
|
|
1275
|
+
}>>>;
|
|
1276
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1277
|
+
getName: ViewSpec<"__void", "string">;
|
|
1278
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1279
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1280
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1281
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1282
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1283
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1284
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1285
|
+
} & Extra & Extra_1 & Extra_2 & {
|
|
1286
|
+
extend: <Extra_3 extends Record<string, any>>(extra: Extra_3) => {
|
|
1287
|
+
initialize: CustomSpec<{
|
|
1288
|
+
address: string;
|
|
1289
|
+
tokenParams: ITokenParamsSchema;
|
|
1290
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1291
|
+
address: string;
|
|
1292
|
+
tokenParams: ITokenParamsSchema;
|
|
1293
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1294
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1295
|
+
txid: string;
|
|
1296
|
+
}>>>;
|
|
1297
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1298
|
+
getName: ViewSpec<"__void", "string">;
|
|
1299
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1300
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1301
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1302
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1303
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1304
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1305
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1306
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & {
|
|
1307
|
+
extend: <Extra_4 extends Record<string, any>>(extra: Extra_4) => {
|
|
1308
|
+
initialize: CustomSpec<{
|
|
1309
|
+
address: string;
|
|
1310
|
+
tokenParams: ITokenParamsSchema;
|
|
1311
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1312
|
+
address: string;
|
|
1313
|
+
tokenParams: ITokenParamsSchema;
|
|
1314
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1315
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1316
|
+
txid: string;
|
|
1317
|
+
}>>>;
|
|
1318
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1319
|
+
getName: ViewSpec<"__void", "string">;
|
|
1320
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1321
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1322
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1323
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1324
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1325
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1326
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1327
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & {
|
|
1328
|
+
extend: <Extra_5 extends Record<string, any>>(extra: Extra_5) => {
|
|
1329
|
+
initialize: CustomSpec<{
|
|
1330
|
+
address: string;
|
|
1331
|
+
tokenParams: ITokenParamsSchema;
|
|
1332
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1333
|
+
address: string;
|
|
1334
|
+
tokenParams: ITokenParamsSchema;
|
|
1335
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1336
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1337
|
+
txid: string;
|
|
1338
|
+
}>>>;
|
|
1339
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1340
|
+
getName: ViewSpec<"__void", "string">;
|
|
1341
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1342
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1343
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1344
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1345
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1346
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1347
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1348
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & {
|
|
1349
|
+
extend: <Extra_6 extends Record<string, any>>(extra: Extra_6) => {
|
|
1350
|
+
initialize: CustomSpec<{
|
|
1351
|
+
address: string;
|
|
1352
|
+
tokenParams: ITokenParamsSchema;
|
|
1353
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1354
|
+
address: string;
|
|
1355
|
+
tokenParams: ITokenParamsSchema;
|
|
1356
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1357
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1358
|
+
txid: string;
|
|
1359
|
+
}>>>;
|
|
1360
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1361
|
+
getName: ViewSpec<"__void", "string">;
|
|
1362
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1363
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1364
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1365
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1366
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1367
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1368
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1369
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & {
|
|
1370
|
+
extend: <Extra_7 extends Record<string, any>>(extra: Extra_7) => {
|
|
1371
|
+
initialize: CustomSpec<{
|
|
1372
|
+
address: string;
|
|
1373
|
+
tokenParams: ITokenParamsSchema;
|
|
1374
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1375
|
+
address: string;
|
|
1376
|
+
tokenParams: ITokenParamsSchema;
|
|
1377
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1378
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1379
|
+
txid: string;
|
|
1380
|
+
}>>>;
|
|
1381
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1382
|
+
getName: ViewSpec<"__void", "string">;
|
|
1383
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1384
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1385
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1386
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1387
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1388
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1389
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1390
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & {
|
|
1391
|
+
extend: <Extra_8 extends Record<string, any>>(extra: Extra_8) => {
|
|
1392
|
+
initialize: CustomSpec<{
|
|
1393
|
+
address: string;
|
|
1394
|
+
tokenParams: ITokenParamsSchema;
|
|
1395
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1396
|
+
address: string;
|
|
1397
|
+
tokenParams: ITokenParamsSchema;
|
|
1398
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1399
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1400
|
+
txid: string;
|
|
1401
|
+
}>>>;
|
|
1402
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1403
|
+
getName: ViewSpec<"__void", "string">;
|
|
1404
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1405
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1406
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1407
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1408
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1409
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1410
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1411
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & {
|
|
1412
|
+
extend: <Extra_9 extends Record<string, any>>(extra: Extra_9) => {
|
|
1413
|
+
initialize: CustomSpec<{
|
|
1414
|
+
address: string;
|
|
1415
|
+
tokenParams: ITokenParamsSchema;
|
|
1416
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1417
|
+
address: string;
|
|
1418
|
+
tokenParams: ITokenParamsSchema;
|
|
1419
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1420
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1421
|
+
txid: string;
|
|
1422
|
+
}>>>;
|
|
1423
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1424
|
+
getName: ViewSpec<"__void", "string">;
|
|
1425
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1426
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1427
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1428
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1429
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1430
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1431
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1432
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & Extra_9 & {
|
|
1433
|
+
extend: <Extra_10 extends Record<string, any>>(extra: Extra_10) => {
|
|
1434
|
+
initialize: CustomSpec<{
|
|
1435
|
+
address: string;
|
|
1436
|
+
tokenParams: ITokenParamsSchema;
|
|
1437
|
+
}, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, params: {
|
|
1438
|
+
address: string;
|
|
1439
|
+
tokenParams: ITokenParamsSchema;
|
|
1440
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1441
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1442
|
+
txid: string;
|
|
1443
|
+
}>>>;
|
|
1444
|
+
mintTokens: ExecuteSpec<"__void", "__void", "uint8Array">;
|
|
1445
|
+
getName: ViewSpec<"__void", "string">;
|
|
1446
|
+
getSymbol: ViewSpec<"__void", "string">;
|
|
1447
|
+
getTotalSupply: ViewSpec<"__void", "tokenValue">;
|
|
1448
|
+
getCap: ViewSpec<"__void", "bigint">;
|
|
1449
|
+
getMinted: ViewSpec<"__void", "bigint">;
|
|
1450
|
+
getValuePerMint: ViewSpec<"__void", "tokenValue">;
|
|
1451
|
+
getData: ViewSpec<"__void", "uint8Array">;
|
|
1452
|
+
getBalance: CustomSpec<string, "uint8Array", (this: AlkanesBaseContract, opcode: bigint, address: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>>;
|
|
1453
|
+
} & Extra & Extra_1 & Extra_2 & Extra_3 & Extra_4 & Extra_5 & Extra_6 & Extra_7 & Extra_8 & Extra_9 & Extra_10 & /*elided*/ any;
|
|
1454
|
+
};
|
|
1455
|
+
};
|
|
1456
|
+
};
|
|
1457
|
+
};
|
|
1458
|
+
};
|
|
1459
|
+
};
|
|
1460
|
+
};
|
|
1461
|
+
};
|
|
1462
|
+
};
|
|
1463
|
+
};
|
|
1464
|
+
};
|
|
1465
|
+
declare const TokenContract_base: new (provider: Provider, alkaneId: AlkaneId, signPsbtFn: (unsigned: string) => Promise<string>) => Omit<AlkanesBaseContract, "initialize" | "extend" | "OpCodes" | "mintTokens" | "getName" | "getSymbol" | "getTotalSupply" | "getCap" | "getMinted" | "getValuePerMint" | "getData" | "getBalance"> & {
|
|
1466
|
+
OpCodes: OpcodeTable;
|
|
1467
|
+
} & {
|
|
1468
|
+
initialize: (params: {
|
|
1469
|
+
address: string;
|
|
1470
|
+
tokenParams: ITokenParamsSchema;
|
|
1471
|
+
}) => Promise<BoxedError<AlkanesExecuteError.InvalidParams> | BoxedSuccess<{
|
|
1472
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<unknown>, AlkanesExecuteError>>;
|
|
1473
|
+
txid: string;
|
|
1474
|
+
}>>;
|
|
1475
|
+
mintTokens: (address: string, args_0?: Partial<{
|
|
1476
|
+
provider: Provider;
|
|
1477
|
+
callData?: bigint[];
|
|
1478
|
+
ignoreAlkanesUtxoCheck?: boolean;
|
|
1479
|
+
transfers: SingularTransfer[];
|
|
1480
|
+
feeOpts?: {
|
|
1481
|
+
vsize: number;
|
|
1482
|
+
input_length: number;
|
|
1483
|
+
};
|
|
1484
|
+
feeRate?: number;
|
|
1485
|
+
availableUtxoTweak?: {
|
|
1486
|
+
remove: Set<string>;
|
|
1487
|
+
add: FormattedUtxo[];
|
|
1488
|
+
};
|
|
1489
|
+
ignoreAlkanesRequirementCheck?: boolean;
|
|
1490
|
+
psbtTransfers?: SingularBTCTransfer[];
|
|
1491
|
+
overrideInputs?: FormattedUtxo[] | null;
|
|
1492
|
+
includeInputs?: {
|
|
1493
|
+
input_extended: PsbtInputExtended;
|
|
1494
|
+
input_formatted: FormattedUtxo;
|
|
1495
|
+
}[];
|
|
1496
|
+
includePsbts?: string[];
|
|
1497
|
+
excludeProtostone?: boolean;
|
|
1498
|
+
}> | undefined) => Promise<BoxedResponse<{
|
|
1499
|
+
waitForResult: () => Promise<BoxedResponse<IDecodableAlkanesResponse<never>, AlkanesExecuteError>>;
|
|
1500
|
+
txid: string;
|
|
1501
|
+
}, AlkanesExecuteError>>;
|
|
1502
|
+
getName: (arg: void) => Promise<BoxedResponse<string, AlkanesSimulationError>>;
|
|
1503
|
+
getSymbol: (arg: void) => Promise<BoxedResponse<string, AlkanesSimulationError>>;
|
|
1504
|
+
getTotalSupply: (arg: void) => Promise<BoxedResponse<never, AlkanesSimulationError>>;
|
|
1505
|
+
getCap: (arg: void) => Promise<BoxedResponse<bigint, AlkanesSimulationError>>;
|
|
1506
|
+
getMinted: (arg: void) => Promise<BoxedResponse<bigint, AlkanesSimulationError>>;
|
|
1507
|
+
getValuePerMint: (arg: void) => Promise<BoxedResponse<never, AlkanesSimulationError>>;
|
|
1508
|
+
getData: (arg: void) => Promise<BoxedResponse<never, AlkanesSimulationError>>;
|
|
1509
|
+
getBalance: (params: string) => Promise<BoxedSuccess<number> | BoxedError<AlkanesFetchError.UnknownError>>;
|
|
1510
|
+
extend: never;
|
|
1511
|
+
};
|
|
1512
|
+
declare class TokenContract extends TokenContract_base {
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
export { AddressType, AlkanesBaseContract, AlkanesExecuteError, AlkanesFetchError, AlkanesInscription, AlkanesRpcProvider, AlkanesSimulationError, AlkanesTraceError, BaseRpcProvider, DecodableAlkanesResponse, DecodeError, EcPair, ElectrumApiProvider, Encodable, EncodeError, EsploraFetchError, OrdFetchError, OrdRpcProvider, ParsableAlkaneId, ProtostoneTransaction, ProtostoneTransactionWithInscription, Provider, RpcError, RunesFetchError, RunesRpcProvider, SandshrewFetchError, SandshrewRpcProvider, TokenABI, TokenContract, abi, addInputDynamic, addressFormats, addressNameToType, addressTypeToName, assertHex, buildRpcCall, calculateTaprootTxSize, decodeAlkanesTrace, decodeCBOR, excludeFields, execute, extractAbiErrorMessage, extractWithDummySigs, formatInputsToSign, getAddressType, getDummyProtostoneTransaction, getEstimatedFee, getProtostoneTransactionsWithInscription, getProtostoneUnsignedPsbtBase64, getVSize, hexToUint8Array, makeFakeBlock, mapToPrimitives, minimumFee, parseSimulateReturn, psbtBuilder, redeemTypeFromOutput, reverseHexBytes, schemaAlkaneId, simulate, sleep, stripHex, tapTweakHash, toEsploraTx, toFormattedUtxo, toU128LittleEndianHex, toU64BigEndianHex, toU64LittleEndianHex, trimUndefined, tweakSigner, u128Schema, unmapFromPrimitives, witnessStackToScriptWitness };
|
|
1516
|
+
export type { Account, AddressKey, Alkane, AlkaneDetails, AlkaneEncoded, AlkaneEncodedSimulationRequest, AlkaneId, AlkaneReadableId, AlkaneRune, AlkaneSimulateRequest, AlkaneToken, AlkanesByAddressOutpoint, AlkanesByAddressResponse, AlkanesByAddressRuneBalance, AlkanesExecuteResponse, AlkanesOutpoint, AlkanesOutpointExtended, AlkanesOutpoints, AlkanesOutpointsExtended, AlkanesParsedSimulationResult, AlkanesParsedTraceResult, AlkanesPushExecuteResponse, AlkanesRawSimulationResponse, AlkanesSimulationResult, AlkanesTraceCreateEvent, AlkanesTraceEncodedCreateEvent, AlkanesTraceEncodedEvent, AlkanesTraceEncodedInvokeEvent, AlkanesTraceEncodedResult, AlkanesTraceEncodedReturnEvent, AlkanesTraceEvent, AlkanesTraceInvokeEvent, AlkanesTraceResult, AlkanesTraceReturnEvent, AlkanesUtxo, AlkanesUtxoBalance, AlkanesUtxoEntry, AvailableDecodeKind, AvailableEncodeKind, CustomSpec, Dec, DecodedCBOR, DecodedCBORValue, DecoderFns, Enc, EncodedAlkaneId, EncoderFns, EsploraAddressResponse, EsploraAddressStats, EsploraUtxo, ExecuteSpec, Expand, FormattedUtxo, HDPaths, IDecodableAlkanesResponse, IEncodable, IEsploraBlockHeader, IEsploraPrevout, IEsploraSpendableUtxo, IEsploraTransaction, IEsploraTransactionStatus, IEsploraVin, IEsploraVout, ISchemaAlkaneId, OpcodeTable, OrdBlock, OrdInscription, OrdOutput, OrdOutputRune, OrdPaginatedIds, OrdSat, ProtoRunesToken, ProtostoneTransactionOptions, ProtostoneTransactionOptionsPartial, ProviderConfig, PsbtInputExtended, ResolveSchema, RpcCall, RpcResponse, RpcTuple, Rune, RuneBalance, RuneName, RunesAddressResult, RunesOutpoint, RunesOutpointResult, Schema, SingularAlkanesTransfer, SingularBTCTransfer, SingularTransfer, SpendStrategy, ViewSpec, WalletStandard };
|