@leather.io/models 0.45.0 → 0.47.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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +26 -0
- package/dist/index.d.ts +618 -337
- package/dist/index.js +328 -106
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/assets/asset-id.model.ts +1 -0
- package/src/assets/asset.model.ts +1 -0
- package/src/assets/sip9-asset.model.ts +5 -0
- package/src/balance.model.ts +4 -5
- package/src/bitcoin.model.ts +4 -1
- package/src/bns.model.ts +2 -0
- package/src/fees/transaction-fees.model.ts +56 -0
- package/src/index.ts +23 -13
- package/src/inscription-mime-type.model.ts +0 -17
- package/src/market.model.ts +14 -0
- package/src/network/network.model.ts +10 -1
- package/src/settings.model.ts +5 -2
- package/src/transactions/bitcoin-transaction.model.ts +27 -1
- package/src/utxo.model.ts +7 -7
- package/src/yield/helpers/yield.helpers.ts +216 -0
- package/src/yield/providers/bitflow.model.ts +31 -0
- package/src/yield/providers/granite.model.ts +31 -0
- package/src/yield/providers/stacking-dao.model.ts +45 -0
- package/src/yield/providers/zest.model.ts +22 -0
- package/src/yield/yield-position.base.model.ts +12 -0
- package/src/yield/yield-position.model.ts +14 -0
- package/src/yield/yield-product.model.ts +43 -0
- package/src/yield/yield-provider.model.ts +16 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,89 @@
|
|
|
1
|
-
import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
|
|
2
1
|
import { z } from 'zod';
|
|
2
|
+
import BigNumber, { BigNumber as BigNumber$1 } from 'bignumber.js';
|
|
3
3
|
import { MempoolTransaction, Transaction } from '@stacks/stacks-blockchain-api-types';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
declare const walletIdSchema: z.ZodObject<{
|
|
6
|
+
fingerprint: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
declare const accountIdSchema: z.ZodIntersection<z.ZodObject<{
|
|
9
|
+
fingerprint: z.ZodString;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
accountIndex: z.ZodNumber;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
declare const bitcoinAddressInfoSchema: z.ZodObject<{
|
|
14
|
+
taprootDescriptor: z.ZodString;
|
|
15
|
+
nativeSegwitDescriptor: z.ZodString;
|
|
16
|
+
zeroIndexTaprootPayerAddress: z.ZodOptional<z.ZodString>;
|
|
17
|
+
zeroIndexNativeSegwitPayerAddress: z.ZodOptional<z.ZodString>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
declare const stacksAddressInfoSchema: z.ZodObject<{
|
|
20
|
+
stxAddress: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
declare const accountAddressesSchema: z.ZodObject<{
|
|
23
|
+
id: z.ZodIntersection<z.ZodObject<{
|
|
24
|
+
fingerprint: z.ZodString;
|
|
25
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
26
|
+
accountIndex: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
bitcoin: z.ZodOptional<z.ZodObject<{
|
|
29
|
+
taprootDescriptor: z.ZodString;
|
|
30
|
+
nativeSegwitDescriptor: z.ZodString;
|
|
31
|
+
zeroIndexTaprootPayerAddress: z.ZodOptional<z.ZodString>;
|
|
32
|
+
zeroIndexNativeSegwitPayerAddress: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, z.core.$strip>>;
|
|
34
|
+
stacks: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
stxAddress: z.ZodString;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
}, z.core.$strip>;
|
|
38
|
+
type WalletId = z.infer<typeof walletIdSchema>;
|
|
39
|
+
type AccountId = z.infer<typeof accountIdSchema>;
|
|
40
|
+
type BitcoinAddressInfo = z.infer<typeof bitcoinAddressInfoSchema>;
|
|
41
|
+
type StacksAddressInfo = z.infer<typeof stacksAddressInfoSchema>;
|
|
42
|
+
type AccountAddresses = z.infer<typeof accountAddressesSchema>;
|
|
43
|
+
|
|
44
|
+
declare const ActivityLevels: {
|
|
45
|
+
readonly account: "account";
|
|
46
|
+
readonly app: "app";
|
|
7
47
|
};
|
|
8
|
-
type
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
48
|
+
type ActivityLevel = keyof typeof ActivityLevels;
|
|
49
|
+
|
|
50
|
+
declare const OnChainActivityStatuses: {
|
|
51
|
+
readonly pending: "pending";
|
|
52
|
+
readonly success: "success";
|
|
53
|
+
readonly failed: "failed";
|
|
54
|
+
};
|
|
55
|
+
type OnChainActivityStatus = keyof typeof OnChainActivityStatuses;
|
|
56
|
+
|
|
57
|
+
declare const OnChainActivityTypes: {
|
|
58
|
+
readonly deploySmartContract: "deploySmartContract";
|
|
59
|
+
readonly executeSmartContract: "executeSmartContract";
|
|
60
|
+
readonly lockAsset: "lockAsset";
|
|
61
|
+
readonly sendAsset: "sendAsset";
|
|
62
|
+
readonly receiveAsset: "receiveAsset";
|
|
63
|
+
readonly swapAssets: "swapAssets";
|
|
64
|
+
};
|
|
65
|
+
type OnChainActivityType = keyof typeof OnChainActivityTypes;
|
|
66
|
+
declare const WalletActivityTypes: {
|
|
67
|
+
readonly connectApp: "connectApp";
|
|
68
|
+
readonly signMessage: "signMessage";
|
|
69
|
+
};
|
|
70
|
+
type WalletActivityType = keyof typeof WalletActivityTypes;
|
|
71
|
+
declare const GeneralActivityTypes: {
|
|
72
|
+
readonly walletAdded: "walletAdded";
|
|
73
|
+
readonly receiveAnnouncement: "receiveAnnouncement";
|
|
74
|
+
readonly featureWaitlistNotification: "featureWaitlistNotification";
|
|
75
|
+
};
|
|
76
|
+
type GeneralActivityType = keyof typeof GeneralActivityTypes;
|
|
77
|
+
type ActivityType = OnChainActivityType | WalletActivityType | GeneralActivityType;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Inscriptions contain arbitrary data. When retrieving an inscription, it should be
|
|
81
|
+
* classified into one of the types below, indicating that the app can handle it
|
|
82
|
+
* appropriately and securely. Inscriptions of types not ready to be handled by the
|
|
83
|
+
* app should be classified as "other".
|
|
84
|
+
*/
|
|
85
|
+
declare const inscriptionMimeTypes: readonly ["audio", "gltf", "html", "image", "svg", "text", "video", "other"];
|
|
86
|
+
type InscriptionMimeType = (typeof inscriptionMimeTypes)[number];
|
|
15
87
|
|
|
16
88
|
type ValueOf<T> = T[keyof T];
|
|
17
89
|
interface AllowAdditionalProperties {
|
|
@@ -42,80 +114,6 @@ interface Money {
|
|
|
42
114
|
readonly decimals: number;
|
|
43
115
|
}
|
|
44
116
|
|
|
45
|
-
interface BaseCryptoAssetBalance {
|
|
46
|
-
/**
|
|
47
|
-
* Balance as confirmed on chain
|
|
48
|
-
*/
|
|
49
|
-
readonly totalBalance: Money;
|
|
50
|
-
/**
|
|
51
|
-
* Balance of pending receipt into account given pending transactions
|
|
52
|
-
*/
|
|
53
|
-
readonly inboundBalance: Money;
|
|
54
|
-
/**
|
|
55
|
-
* Balance of pending delivery from account given pending transactions
|
|
56
|
-
*/
|
|
57
|
-
readonly outboundBalance: Money;
|
|
58
|
-
/**
|
|
59
|
-
* totalBalance plus inboundBalance minus outboundBalance
|
|
60
|
-
*/
|
|
61
|
-
readonly pendingBalance: Money;
|
|
62
|
-
/**
|
|
63
|
-
* totalBalance after filtering out outboundBalance, protectedBalance, and uneconomicalBalance
|
|
64
|
-
*/
|
|
65
|
-
readonly availableBalance: Money;
|
|
66
|
-
}
|
|
67
|
-
interface BtcBalance extends BaseCryptoAssetBalance {
|
|
68
|
-
/**
|
|
69
|
-
* Balance of UTXOs with collectibles
|
|
70
|
-
*/
|
|
71
|
-
readonly protectedBalance: Money;
|
|
72
|
-
/**
|
|
73
|
-
* Balance across UTXOs with need for larger fee than principal by UTXO given standard rate
|
|
74
|
-
*/
|
|
75
|
-
readonly uneconomicalBalance: Money;
|
|
76
|
-
/**
|
|
77
|
-
* Balance of the union set of protected and uneconomical UTXOs
|
|
78
|
-
*/
|
|
79
|
-
readonly unspendableBalance: Money;
|
|
80
|
-
}
|
|
81
|
-
interface StxBalance extends BaseCryptoAssetBalance {
|
|
82
|
-
/**
|
|
83
|
-
* availableBalance minus lockedBalance
|
|
84
|
-
*/
|
|
85
|
-
readonly availableUnlockedBalance: Money;
|
|
86
|
-
/**
|
|
87
|
-
* total amount locked by contracts
|
|
88
|
-
*/
|
|
89
|
-
readonly lockedBalance: Money;
|
|
90
|
-
/**
|
|
91
|
-
* totalBalance minus lockedBalance
|
|
92
|
-
*/
|
|
93
|
-
readonly unlockedBalance: Money;
|
|
94
|
-
}
|
|
95
|
-
type CryptoAssetBalance = BaseCryptoAssetBalance | BtcBalance | StxBalance;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Inscriptions contain arbitrary data. When retrieving an inscription, it should be
|
|
99
|
-
* classified into one of the types below, indicating that the app can handle it
|
|
100
|
-
* appropriately and securely. Inscriptions of types not ready to be handled by the
|
|
101
|
-
* app should be classified as "other".
|
|
102
|
-
*/
|
|
103
|
-
declare const inscriptionMimeTypes: readonly ["audio", "gltf", "html", "image", "svg", "text", "video", "other"];
|
|
104
|
-
type InscriptionMimeType = (typeof inscriptionMimeTypes)[number];
|
|
105
|
-
interface Inscription extends InscriptionAsset {
|
|
106
|
-
preview: string;
|
|
107
|
-
src: string;
|
|
108
|
-
title: string;
|
|
109
|
-
output: string;
|
|
110
|
-
txid: string;
|
|
111
|
-
offset: string;
|
|
112
|
-
address: string;
|
|
113
|
-
genesisBlockHash: string;
|
|
114
|
-
genesisTimestamp: number;
|
|
115
|
-
genesisBlockHeight: number;
|
|
116
|
-
value: string;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
117
|
declare const sip9ContentTypes: readonly ["image/jpeg", "image/jpg", "image/png", "image/gif", "image/webp", "image/svg+xml", "image/bmp", "image/tiff", "image/avif", "video/mp4", "video/webm", "video/mov", "video/quicktime", "video/avi", "video/x-msvideo", "video/ogg", "audio/mpeg", "audio/mp3", "audio/wav", "audio/x-wav", "audio/ogg", "audio/aac", "audio/flac", "audio/webm", "model/gltf+json", "model/gltf-binary", "application/octet-stream", "text/plain", "text/html", "text/markdown", "application/pdf", "application/json", "text/javascript", "application/javascript", "application/zip", "unknown", ""];
|
|
120
118
|
type Sip9ContentType = (typeof sip9ContentTypes)[number];
|
|
121
119
|
interface Sip9Collection {
|
|
@@ -143,6 +141,10 @@ interface Sip9Asset extends BaseNonFungibleCryptoAsset {
|
|
|
143
141
|
readonly content: Sip9AssetContent;
|
|
144
142
|
readonly attributes?: Sip9Attribute[];
|
|
145
143
|
readonly collection?: Sip9Collection;
|
|
144
|
+
readonly creator?: string;
|
|
145
|
+
readonly floorPrice?: Money;
|
|
146
|
+
readonly latestSale?: Money;
|
|
147
|
+
readonly rarityRank?: number;
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
declare const CryptoAssetChains: {
|
|
@@ -271,6 +273,7 @@ interface StampAsset extends BaseNonFungibleCryptoAsset {
|
|
|
271
273
|
readonly stamp: number;
|
|
272
274
|
readonly stampUrl: string;
|
|
273
275
|
readonly stampExplorerUrl: string;
|
|
276
|
+
readonly blockHeight: number;
|
|
274
277
|
}
|
|
275
278
|
type NonFungibleCryptoAsset = InscriptionAsset | StampAsset | Sip9Asset;
|
|
276
279
|
type CryptoAsset = FungibleCryptoAsset | NonFungibleCryptoAsset;
|
|
@@ -279,9 +282,102 @@ interface FungibleAssetId {
|
|
|
279
282
|
id: string;
|
|
280
283
|
}
|
|
281
284
|
|
|
285
|
+
interface BaseActivity {
|
|
286
|
+
readonly level: ActivityLevel;
|
|
287
|
+
readonly type: ActivityType;
|
|
288
|
+
readonly timestamp: number;
|
|
289
|
+
}
|
|
290
|
+
interface AccountLevelActivity extends BaseActivity {
|
|
291
|
+
readonly level: 'account';
|
|
292
|
+
readonly account: AccountId;
|
|
293
|
+
}
|
|
294
|
+
interface AppLevelActivity extends BaseActivity {
|
|
295
|
+
readonly level: 'app';
|
|
296
|
+
}
|
|
297
|
+
interface BaseOnChainActivity extends AccountLevelActivity {
|
|
298
|
+
readonly type: OnChainActivityType;
|
|
299
|
+
readonly txid: string;
|
|
300
|
+
readonly status: OnChainActivityStatus;
|
|
301
|
+
}
|
|
302
|
+
interface DeploySmartContractActivity extends BaseOnChainActivity {
|
|
303
|
+
readonly type: 'deploySmartContract';
|
|
304
|
+
readonly contractId: string;
|
|
305
|
+
}
|
|
306
|
+
interface ExecuteSmartContractActivity extends BaseOnChainActivity {
|
|
307
|
+
readonly type: 'executeSmartContract';
|
|
308
|
+
readonly contractId: string;
|
|
309
|
+
readonly functionName: string;
|
|
310
|
+
}
|
|
311
|
+
interface LockAssetActivity extends BaseOnChainActivity {
|
|
312
|
+
readonly type: 'lockAsset';
|
|
313
|
+
readonly asset: CryptoAsset;
|
|
314
|
+
readonly amount: BigNumber$1;
|
|
315
|
+
readonly value?: {
|
|
316
|
+
crypto: Money;
|
|
317
|
+
quote: Money;
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
interface SendAssetActivity extends BaseOnChainActivity {
|
|
321
|
+
readonly type: 'sendAsset';
|
|
322
|
+
readonly asset: CryptoAsset;
|
|
323
|
+
readonly receivers: string[];
|
|
324
|
+
readonly amount: BigNumber$1;
|
|
325
|
+
readonly value?: {
|
|
326
|
+
crypto: Money;
|
|
327
|
+
quote: Money;
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
interface ReceiveAssetActivity extends BaseOnChainActivity {
|
|
331
|
+
readonly type: 'receiveAsset';
|
|
332
|
+
readonly asset: CryptoAsset;
|
|
333
|
+
readonly senders: string[];
|
|
334
|
+
readonly amount: BigNumber$1;
|
|
335
|
+
readonly value?: {
|
|
336
|
+
crypto: Money;
|
|
337
|
+
quote: Money;
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
interface SwapAssetsActivity extends BaseOnChainActivity {
|
|
341
|
+
readonly type: 'swapAssets';
|
|
342
|
+
readonly fromAsset: CryptoAsset;
|
|
343
|
+
readonly fromAmount: BigNumber$1;
|
|
344
|
+
readonly fromValue?: {
|
|
345
|
+
crypto: Money;
|
|
346
|
+
quote: Money;
|
|
347
|
+
};
|
|
348
|
+
readonly toAsset: CryptoAsset;
|
|
349
|
+
readonly toAmount: BigNumber$1;
|
|
350
|
+
readonly toValue?: {
|
|
351
|
+
crypto: Money;
|
|
352
|
+
quote: Money;
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
interface BaseWalletActivity extends AccountLevelActivity {
|
|
356
|
+
readonly type: WalletActivityType;
|
|
357
|
+
}
|
|
358
|
+
interface ConnectAppActivity extends BaseWalletActivity {
|
|
359
|
+
readonly type: 'connectApp';
|
|
360
|
+
readonly appName: string;
|
|
361
|
+
readonly appUrl: string;
|
|
362
|
+
}
|
|
363
|
+
interface SignMessageActivity extends BaseWalletActivity {
|
|
364
|
+
readonly type: 'signMessage';
|
|
365
|
+
readonly appName: string;
|
|
366
|
+
readonly appUrl: string;
|
|
367
|
+
}
|
|
368
|
+
interface GeneralActivity extends AppLevelActivity {
|
|
369
|
+
readonly type: GeneralActivityType;
|
|
370
|
+
readonly title: string;
|
|
371
|
+
readonly message: string;
|
|
372
|
+
}
|
|
373
|
+
type OnChainActivity = DeploySmartContractActivity | ExecuteSmartContractActivity | LockAssetActivity | SendAssetActivity | ReceiveAssetActivity | SwapAssetsActivity;
|
|
374
|
+
type WalletActivity = ConnectAppActivity | SignMessageActivity;
|
|
375
|
+
type Activity = OnChainActivity | WalletActivity | GeneralActivity;
|
|
376
|
+
|
|
282
377
|
interface CryptoAssetId {
|
|
283
378
|
protocol: CryptoAssetProtocol;
|
|
284
379
|
id: string;
|
|
380
|
+
tokenId?: number;
|
|
285
381
|
}
|
|
286
382
|
|
|
287
383
|
declare function isFungibleAsset(asset: CryptoAsset): asset is FungibleCryptoAsset;
|
|
@@ -299,20 +395,119 @@ declare function isInscriptionAsset(asset: CryptoAsset): asset is InscriptionAss
|
|
|
299
395
|
declare function isStampAsset(asset: CryptoAsset): asset is StampAsset;
|
|
300
396
|
declare function isSip9Asset(asset: CryptoAsset): asset is Sip9Asset;
|
|
301
397
|
|
|
302
|
-
interface
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
398
|
+
interface BaseCryptoAssetBalance {
|
|
399
|
+
/**
|
|
400
|
+
* Balance as confirmed on chain
|
|
401
|
+
*/
|
|
402
|
+
readonly totalBalance: Money;
|
|
403
|
+
/**
|
|
404
|
+
* Balance of pending receipt into account given pending transactions
|
|
405
|
+
*/
|
|
406
|
+
readonly inboundBalance: Money;
|
|
407
|
+
/**
|
|
408
|
+
* Balance of pending delivery from account given pending transactions
|
|
409
|
+
*/
|
|
410
|
+
readonly outboundBalance: Money;
|
|
411
|
+
/**
|
|
412
|
+
* totalBalance plus inboundBalance minus outboundBalance
|
|
413
|
+
*/
|
|
414
|
+
readonly pendingBalance: Money;
|
|
415
|
+
/**
|
|
416
|
+
* totalBalance after filtering out outboundBalance, protectedBalance, and dustBalance
|
|
417
|
+
*/
|
|
418
|
+
readonly availableBalance: Money;
|
|
419
|
+
}
|
|
420
|
+
interface BtcBalance extends BaseCryptoAssetBalance {
|
|
421
|
+
/**
|
|
422
|
+
* Balance of UTXOs with collectibles
|
|
423
|
+
*/
|
|
424
|
+
readonly protectedBalance: Money;
|
|
425
|
+
/**
|
|
426
|
+
* Balance across UTXOs with value less than dust threshold
|
|
427
|
+
*/
|
|
428
|
+
readonly dustBalance: Money;
|
|
429
|
+
/**
|
|
430
|
+
* Balance of the union set of protected and dust UTXOs
|
|
431
|
+
*/
|
|
432
|
+
readonly unspendableBalance: Money;
|
|
433
|
+
}
|
|
434
|
+
interface StxBalance extends BaseCryptoAssetBalance {
|
|
435
|
+
/**
|
|
436
|
+
* availableBalance minus lockedBalance
|
|
437
|
+
*/
|
|
438
|
+
readonly availableUnlockedBalance: Money;
|
|
439
|
+
/**
|
|
440
|
+
* total amount locked by contracts
|
|
441
|
+
*/
|
|
442
|
+
readonly lockedBalance: Money;
|
|
443
|
+
/**
|
|
444
|
+
* totalBalance minus lockedBalance
|
|
445
|
+
*/
|
|
446
|
+
readonly unlockedBalance: Money;
|
|
447
|
+
}
|
|
448
|
+
type CryptoAssetBalance = BaseCryptoAssetBalance | BtcBalance | StxBalance;
|
|
449
|
+
|
|
450
|
+
type BitcoinAddress = string & {
|
|
451
|
+
readonly __brand: unique symbol;
|
|
452
|
+
};
|
|
453
|
+
declare const bitcoinUnitSchema: z.ZodEnum<{
|
|
454
|
+
bitcoin: "bitcoin";
|
|
455
|
+
satoshi: "satoshi";
|
|
456
|
+
}>;
|
|
457
|
+
type BitcoinUnit = z.infer<typeof bitcoinUnitSchema>;
|
|
458
|
+
type BitcoinUnitSymbol = 'BTC' | 'sat';
|
|
459
|
+
interface BitcoinUnitInfo {
|
|
460
|
+
name: BitcoinUnit;
|
|
461
|
+
symbol: BitcoinUnitSymbol;
|
|
462
|
+
decimal: string;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
declare const bnsContractAddress: {
|
|
466
|
+
mainnet: string;
|
|
467
|
+
testnet: string;
|
|
468
|
+
};
|
|
469
|
+
declare const bnsContractName = "BNS-V2";
|
|
470
|
+
interface BnsName {
|
|
471
|
+
owner: string;
|
|
472
|
+
name: string;
|
|
473
|
+
namespace: string;
|
|
474
|
+
fullName: string;
|
|
475
|
+
renewalHeight: number;
|
|
476
|
+
registeredAtBlockNumber: number;
|
|
477
|
+
}
|
|
478
|
+
interface BnsProfile {
|
|
479
|
+
bnsName: BnsName;
|
|
480
|
+
profileData: BnsProfileData;
|
|
481
|
+
}
|
|
482
|
+
interface BnsProfileData {
|
|
483
|
+
name?: string;
|
|
484
|
+
bio?: string;
|
|
485
|
+
website?: string;
|
|
486
|
+
pfpUrl?: string;
|
|
487
|
+
location?: string;
|
|
488
|
+
addresses?: BnsProfileDataAddresses;
|
|
489
|
+
}
|
|
490
|
+
interface BnsProfileDataAddresses {
|
|
491
|
+
bitcoinPayment?: string;
|
|
492
|
+
bitcoinOrdinal?: string;
|
|
493
|
+
solana?: string;
|
|
494
|
+
ethereum?: string;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
interface AverageBitcoinFeeRates {
|
|
498
|
+
fastestFee: BigNumber;
|
|
499
|
+
halfHourFee: BigNumber;
|
|
500
|
+
hourFee: BigNumber;
|
|
501
|
+
}
|
|
502
|
+
declare const btcTxTimeMap: Record<keyof AverageBitcoinFeeRates, string>;
|
|
503
|
+
declare enum BtcFeeType {
|
|
504
|
+
High = "High",
|
|
505
|
+
Standard = "Standard",
|
|
506
|
+
Low = "Low"
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
type Blockchain = LiteralUnion<'bitcoin' | 'stacks', string>;
|
|
510
|
+
|
|
316
511
|
interface StacksFeeEstimate {
|
|
317
512
|
fee: Money;
|
|
318
513
|
feeRate: number;
|
|
@@ -338,6 +533,43 @@ interface Fees {
|
|
|
338
533
|
calculation: FeeCalculationTypes;
|
|
339
534
|
}
|
|
340
535
|
|
|
536
|
+
declare const transactionFeeTiers: readonly ["low", "standard", "high"];
|
|
537
|
+
type TransactionFeeTier = (typeof transactionFeeTiers)[number];
|
|
538
|
+
interface TransactionFees {
|
|
539
|
+
readonly chain: Blockchain;
|
|
540
|
+
readonly options: Record<TransactionFeeTier, TransactionFeeQuote>;
|
|
541
|
+
}
|
|
542
|
+
declare const transactionFeeQuoteType: readonly ["flat", "bitcoinFeeRate", "stacksFeeRate", "evm1559"];
|
|
543
|
+
type TransactionFeeQuoteType = (typeof transactionFeeQuoteType)[number];
|
|
544
|
+
interface BaseTransactionFeeQuote {
|
|
545
|
+
readonly type: TransactionFeeQuoteType;
|
|
546
|
+
readonly value: Money;
|
|
547
|
+
}
|
|
548
|
+
interface FlatTransactionFeeQuote extends BaseTransactionFeeQuote {
|
|
549
|
+
readonly type: 'flat';
|
|
550
|
+
}
|
|
551
|
+
interface BitcoinTransactionFeeQuote extends BaseTransactionFeeQuote {
|
|
552
|
+
readonly type: 'bitcoinFeeRate';
|
|
553
|
+
readonly rate: number;
|
|
554
|
+
readonly rateUnit: 'sats/vB';
|
|
555
|
+
readonly estimatedTxSize: number;
|
|
556
|
+
readonly sizeUnit: 'vB';
|
|
557
|
+
}
|
|
558
|
+
interface StacksTransactionFeeQuote extends BaseTransactionFeeQuote {
|
|
559
|
+
readonly type: 'stacksFeeRate';
|
|
560
|
+
readonly rate: number;
|
|
561
|
+
readonly rateUnit: 'µSTX/byte';
|
|
562
|
+
readonly estimatedTxSize: number;
|
|
563
|
+
readonly sizeUnit: 'byte';
|
|
564
|
+
}
|
|
565
|
+
interface EvmTransactionFeeQuote extends BaseTransactionFeeQuote {
|
|
566
|
+
readonly type: 'evm1559';
|
|
567
|
+
readonly baseFeePerGas: Money;
|
|
568
|
+
readonly priorityFeePerGas: Money;
|
|
569
|
+
readonly gasLimit: number;
|
|
570
|
+
}
|
|
571
|
+
type TransactionFeeQuote = FlatTransactionFeeQuote | BitcoinTransactionFeeQuote | StacksTransactionFeeQuote | EvmTransactionFeeQuote;
|
|
572
|
+
|
|
341
573
|
interface MarketPair {
|
|
342
574
|
readonly base: Currency;
|
|
343
575
|
readonly quote: QuoteCurrency;
|
|
@@ -349,6 +581,17 @@ interface MarketData {
|
|
|
349
581
|
readonly price: Money;
|
|
350
582
|
}
|
|
351
583
|
declare function createMarketData(pair: MarketPair, price: Money): MarketData;
|
|
584
|
+
declare const historicalPeriods: readonly ["1d", "1w", "1m", "3m", "6m", "1y"];
|
|
585
|
+
type HistoricalPeriod = (typeof historicalPeriods)[number];
|
|
586
|
+
interface MarketPriceSnapshot {
|
|
587
|
+
price: Money;
|
|
588
|
+
timestamp: number;
|
|
589
|
+
}
|
|
590
|
+
interface MarketPriceHistory {
|
|
591
|
+
period: HistoricalPeriod;
|
|
592
|
+
changePercentage: number;
|
|
593
|
+
prices: MarketPriceSnapshot[];
|
|
594
|
+
}
|
|
352
595
|
|
|
353
596
|
declare const bitcoinNetworkModesSchema: z.ZodEnum<{
|
|
354
597
|
mainnet: "mainnet";
|
|
@@ -419,7 +662,16 @@ declare enum WalletDefaultNetworkConfigurationIds {
|
|
|
419
662
|
sbtcDevenv = "sbtcDevenv",
|
|
420
663
|
devnet = "devnet"
|
|
421
664
|
}
|
|
422
|
-
|
|
665
|
+
declare const defaultNetworkConfigurationsSchema: z.ZodEnum<{
|
|
666
|
+
mainnet: "mainnet";
|
|
667
|
+
testnet: "testnet";
|
|
668
|
+
signet: "signet";
|
|
669
|
+
testnet4: "testnet4";
|
|
670
|
+
sbtcTestnet: "sbtcTestnet";
|
|
671
|
+
sbtcDevenv: "sbtcDevenv";
|
|
672
|
+
devnet: "devnet";
|
|
673
|
+
}>;
|
|
674
|
+
type DefaultNetworkConfigurations = z.infer<typeof defaultNetworkConfigurationsSchema>;
|
|
423
675
|
declare const supportedBlockchains: readonly ["stacks", "bitcoin"];
|
|
424
676
|
type SupportedBlockchains = (typeof supportedBlockchains)[number];
|
|
425
677
|
declare const networkModes: readonly ["mainnet", "testnet"];
|
|
@@ -451,16 +703,100 @@ type NetworkConfiguration = z.infer<typeof networkConfigurationSchema>;
|
|
|
451
703
|
declare const defaultCurrentNetwork: NetworkConfiguration;
|
|
452
704
|
declare const defaultNetworksKeyedById: Record<WalletDefaultNetworkConfigurationIds, NetworkConfiguration>;
|
|
453
705
|
|
|
454
|
-
|
|
706
|
+
declare const accountDisplayPreferenceSchema: z.ZodEnum<{
|
|
707
|
+
stacks: "stacks";
|
|
708
|
+
"native-segwit": "native-segwit";
|
|
709
|
+
taproot: "taproot";
|
|
710
|
+
bns: "bns";
|
|
711
|
+
}>;
|
|
712
|
+
type AccountDisplayPreference = z.infer<typeof accountDisplayPreferenceSchema>;
|
|
455
713
|
interface AccountDisplayPreferenceInfo {
|
|
456
714
|
type: AccountDisplayPreference;
|
|
457
715
|
blockchain: Blockchain;
|
|
458
716
|
name: string;
|
|
459
717
|
}
|
|
460
|
-
|
|
718
|
+
declare const analyticsPreferenceSchema: z.ZodEnum<{
|
|
719
|
+
"consent-given": "consent-given";
|
|
720
|
+
"rejects-tracking": "rejects-tracking";
|
|
721
|
+
}>;
|
|
722
|
+
type AnalyticsPreference = z.infer<typeof analyticsPreferenceSchema>;
|
|
461
723
|
declare const emailAddressSchema: z.ZodEmail;
|
|
462
724
|
type EmailAddress = z.infer<typeof emailAddressSchema>;
|
|
463
725
|
|
|
726
|
+
type SwappableFungibleCryptoAsset = NativeCryptoAsset | Sip10Asset;
|
|
727
|
+
interface SwapAsset {
|
|
728
|
+
asset: SwappableFungibleCryptoAsset;
|
|
729
|
+
providerAssets: SwapProviderAsset[];
|
|
730
|
+
}
|
|
731
|
+
declare const swapProviderIds: readonly ["bitflow-sdk", "sbtc-bridge", "alex-sdk", "velar-sdk"];
|
|
732
|
+
type SwapProviderId = (typeof swapProviderIds)[number];
|
|
733
|
+
interface SwapProvider {
|
|
734
|
+
id: SwapProviderId;
|
|
735
|
+
isAggregator: boolean;
|
|
736
|
+
}
|
|
737
|
+
interface SwapProviderAsset {
|
|
738
|
+
providerId: SwapProviderId;
|
|
739
|
+
providerAssetId: string;
|
|
740
|
+
assetId: CryptoAssetId;
|
|
741
|
+
}
|
|
742
|
+
interface SwapQuote {
|
|
743
|
+
executionType: SwapExecutionType;
|
|
744
|
+
providerId: SwapProviderId;
|
|
745
|
+
providerQuoteData: unknown;
|
|
746
|
+
baseAmount: number;
|
|
747
|
+
targetAmount: number;
|
|
748
|
+
quote: Money;
|
|
749
|
+
dexPath: SwapDex[];
|
|
750
|
+
assetPath: (NativeCryptoAsset | Sip10Asset)[];
|
|
751
|
+
}
|
|
752
|
+
interface SwapDex {
|
|
753
|
+
name: string;
|
|
754
|
+
url: string;
|
|
755
|
+
logo: string;
|
|
756
|
+
description: string;
|
|
757
|
+
}
|
|
758
|
+
declare const swapExecutionTypes: readonly ["stacks-contract-call", "sbtc-bridge-transfer"];
|
|
759
|
+
type SwapExecutionType = (typeof swapExecutionTypes)[number];
|
|
760
|
+
interface BaseSwapExecutionData {
|
|
761
|
+
executionType: SwapExecutionType;
|
|
762
|
+
providerId: SwapProviderId;
|
|
763
|
+
}
|
|
764
|
+
interface StacksContractCallSwapExecutionData extends BaseSwapExecutionData {
|
|
765
|
+
executionType: 'stacks-contract-call';
|
|
766
|
+
contractAddress: string;
|
|
767
|
+
contractName: string;
|
|
768
|
+
functionName: string;
|
|
769
|
+
functionArgs: unknown[];
|
|
770
|
+
postConditions: unknown[];
|
|
771
|
+
postConditionMode?: unknown;
|
|
772
|
+
}
|
|
773
|
+
interface SbtcBridgeTransferSwapExecutionData extends BaseSwapExecutionData {
|
|
774
|
+
executionType: 'sbtc-bridge-transfer';
|
|
775
|
+
}
|
|
776
|
+
type SwapExecutionData = StacksContractCallSwapExecutionData | SbtcBridgeTransferSwapExecutionData;
|
|
777
|
+
|
|
778
|
+
interface BitcoinTransaction {
|
|
779
|
+
readonly txid: string;
|
|
780
|
+
readonly height?: number;
|
|
781
|
+
readonly time?: number;
|
|
782
|
+
readonly vin: BitcoinTransactionVin[];
|
|
783
|
+
readonly vout: BitcoinTransactionVout[];
|
|
784
|
+
}
|
|
785
|
+
interface BitcoinTransactionVin {
|
|
786
|
+
readonly n: number;
|
|
787
|
+
readonly txid?: string;
|
|
788
|
+
readonly owned?: boolean;
|
|
789
|
+
readonly address?: string;
|
|
790
|
+
readonly path?: string;
|
|
791
|
+
readonly value: string;
|
|
792
|
+
}
|
|
793
|
+
interface BitcoinTransactionVout {
|
|
794
|
+
readonly n: number;
|
|
795
|
+
readonly owned?: boolean;
|
|
796
|
+
readonly address?: string;
|
|
797
|
+
readonly path?: string;
|
|
798
|
+
readonly value: string;
|
|
799
|
+
}
|
|
464
800
|
interface BitcoinTransactionIssuance {
|
|
465
801
|
asset_id: string;
|
|
466
802
|
is_reissuance: boolean;
|
|
@@ -539,265 +875,210 @@ interface FtTransfer {
|
|
|
539
875
|
type TransactionErrorKey = 'InvalidAddress' | 'InsufficientFunds' | 'InvalidAmount' | 'InvalidNetworkAddress' | 'InvalidPrecision' | 'InvalidTransaction' | 'NonCompliantAddress';
|
|
540
876
|
|
|
541
877
|
interface UtxoId {
|
|
542
|
-
txid: string;
|
|
543
|
-
vout: number;
|
|
878
|
+
readonly txid: string;
|
|
879
|
+
readonly vout: number;
|
|
544
880
|
}
|
|
545
881
|
interface Utxo extends UtxoId {
|
|
546
|
-
height?: number;
|
|
547
|
-
value: number;
|
|
882
|
+
readonly height?: number;
|
|
883
|
+
readonly value: number;
|
|
548
884
|
}
|
|
549
885
|
interface OwnedUtxo extends Utxo {
|
|
550
|
-
address: string;
|
|
551
|
-
path: string;
|
|
552
|
-
keyOrigin: string;
|
|
886
|
+
readonly address: string;
|
|
887
|
+
readonly path: string;
|
|
888
|
+
readonly keyOrigin: string;
|
|
553
889
|
}
|
|
554
890
|
|
|
555
|
-
declare const
|
|
556
|
-
readonly
|
|
557
|
-
readonly
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
declare const OnChainActivityStatuses: {
|
|
562
|
-
readonly pending: "pending";
|
|
563
|
-
readonly success: "success";
|
|
564
|
-
readonly failed: "failed";
|
|
891
|
+
declare const YieldProviderKeys: {
|
|
892
|
+
readonly bitflow: "bitflow";
|
|
893
|
+
readonly zest: "zest";
|
|
894
|
+
readonly granite: "granite";
|
|
895
|
+
readonly stackingDao: "stackingdao";
|
|
565
896
|
};
|
|
566
|
-
type
|
|
897
|
+
type YieldProviderKey = (typeof YieldProviderKeys)[keyof typeof YieldProviderKeys];
|
|
898
|
+
interface YieldProvider {
|
|
899
|
+
readonly key: YieldProviderKey;
|
|
900
|
+
readonly name: string;
|
|
901
|
+
readonly logo: string;
|
|
902
|
+
readonly url: string;
|
|
903
|
+
}
|
|
567
904
|
|
|
568
|
-
declare const
|
|
569
|
-
readonly
|
|
570
|
-
readonly
|
|
571
|
-
readonly
|
|
572
|
-
readonly
|
|
573
|
-
readonly
|
|
574
|
-
readonly swapAssets: "swapAssets";
|
|
905
|
+
declare const YieldProductKeys: {
|
|
906
|
+
readonly bitflowAmmLp: "bitflow-amm-lp";
|
|
907
|
+
readonly zestBorrow: "zest-borrow";
|
|
908
|
+
readonly graniteV1: "granite-v1";
|
|
909
|
+
readonly stackingDaoLst: "stackingdao-lst";
|
|
910
|
+
readonly stackingDaoPooledStacking: "stackingdao-pooled-stacking";
|
|
575
911
|
};
|
|
576
|
-
type
|
|
577
|
-
declare const
|
|
578
|
-
readonly
|
|
579
|
-
readonly
|
|
912
|
+
type YieldProductKey = (typeof YieldProductKeys)[keyof typeof YieldProductKeys];
|
|
913
|
+
declare const YieldProductCategories: {
|
|
914
|
+
readonly AMM: "amm";
|
|
915
|
+
readonly LENDING: "lending";
|
|
916
|
+
readonly LST: "lst";
|
|
917
|
+
readonly CDP: "cdp";
|
|
918
|
+
readonly POOLED_STACKING: "pooled-stacking";
|
|
919
|
+
readonly PERPS: "perps";
|
|
580
920
|
};
|
|
581
|
-
type
|
|
582
|
-
declare const
|
|
583
|
-
readonly
|
|
584
|
-
readonly
|
|
585
|
-
readonly
|
|
921
|
+
type YieldProductCategory = (typeof YieldProductCategories)[keyof typeof YieldProductCategories];
|
|
922
|
+
declare const YieldProductToProtocolMap: {
|
|
923
|
+
readonly "bitflow-amm-lp": "bitflow";
|
|
924
|
+
readonly "zest-borrow": "zest";
|
|
925
|
+
readonly "granite-v1": "granite";
|
|
926
|
+
readonly "stackingdao-lst": "stackingdao";
|
|
927
|
+
readonly "stackingdao-pooled-stacking": "stackingdao";
|
|
586
928
|
};
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
fingerprint: z.ZodString;
|
|
595
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
596
|
-
accountIndex: z.ZodNumber;
|
|
597
|
-
}, z.core.$strip>>;
|
|
598
|
-
declare const bitcoinAddressInfoSchema: z.ZodObject<{
|
|
599
|
-
taprootDescriptor: z.ZodString;
|
|
600
|
-
nativeSegwitDescriptor: z.ZodString;
|
|
601
|
-
zeroIndexTaprootPayerAddress: z.ZodOptional<z.ZodString>;
|
|
602
|
-
zeroIndexNativeSegwitPayerAddress: z.ZodOptional<z.ZodString>;
|
|
603
|
-
}, z.core.$strip>;
|
|
604
|
-
declare const stacksAddressInfoSchema: z.ZodObject<{
|
|
605
|
-
stxAddress: z.ZodString;
|
|
606
|
-
}, z.core.$strip>;
|
|
607
|
-
declare const accountAddressesSchema: z.ZodObject<{
|
|
608
|
-
id: z.ZodIntersection<z.ZodObject<{
|
|
609
|
-
fingerprint: z.ZodString;
|
|
610
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
611
|
-
accountIndex: z.ZodNumber;
|
|
612
|
-
}, z.core.$strip>>;
|
|
613
|
-
bitcoin: z.ZodOptional<z.ZodObject<{
|
|
614
|
-
taprootDescriptor: z.ZodString;
|
|
615
|
-
nativeSegwitDescriptor: z.ZodString;
|
|
616
|
-
zeroIndexTaprootPayerAddress: z.ZodOptional<z.ZodString>;
|
|
617
|
-
zeroIndexNativeSegwitPayerAddress: z.ZodOptional<z.ZodString>;
|
|
618
|
-
}, z.core.$strip>>;
|
|
619
|
-
stacks: z.ZodOptional<z.ZodObject<{
|
|
620
|
-
stxAddress: z.ZodString;
|
|
621
|
-
}, z.core.$strip>>;
|
|
622
|
-
}, z.core.$strip>;
|
|
623
|
-
type WalletId = z.infer<typeof walletIdSchema>;
|
|
624
|
-
type AccountId = z.infer<typeof accountIdSchema>;
|
|
625
|
-
type BitcoinAddressInfo = z.infer<typeof bitcoinAddressInfoSchema>;
|
|
626
|
-
type StacksAddressInfo = z.infer<typeof stacksAddressInfoSchema>;
|
|
627
|
-
type AccountAddresses = z.infer<typeof accountAddressesSchema>;
|
|
628
|
-
|
|
629
|
-
interface BaseActivity {
|
|
630
|
-
readonly level: ActivityLevel;
|
|
631
|
-
readonly type: ActivityType;
|
|
632
|
-
readonly timestamp: number;
|
|
633
|
-
}
|
|
634
|
-
interface AccountLevelActivity extends BaseActivity {
|
|
635
|
-
readonly level: 'account';
|
|
636
|
-
readonly account: AccountId;
|
|
637
|
-
}
|
|
638
|
-
interface AppLevelActivity extends BaseActivity {
|
|
639
|
-
readonly level: 'app';
|
|
640
|
-
}
|
|
641
|
-
interface BaseOnChainActivity extends AccountLevelActivity {
|
|
642
|
-
readonly type: OnChainActivityType;
|
|
643
|
-
readonly txid: string;
|
|
644
|
-
readonly status: OnChainActivityStatus;
|
|
645
|
-
}
|
|
646
|
-
interface DeploySmartContractActivity extends BaseOnChainActivity {
|
|
647
|
-
readonly type: 'deploySmartContract';
|
|
648
|
-
readonly contractId: string;
|
|
929
|
+
interface YieldProduct {
|
|
930
|
+
readonly key: YieldProductKey;
|
|
931
|
+
readonly provider: YieldProviderKey;
|
|
932
|
+
readonly name: string;
|
|
933
|
+
readonly url: string;
|
|
934
|
+
readonly category: YieldProductCategory;
|
|
935
|
+
readonly tvl?: Money;
|
|
649
936
|
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
readonly
|
|
653
|
-
readonly
|
|
937
|
+
|
|
938
|
+
interface BaseYieldPosition {
|
|
939
|
+
readonly provider: YieldProviderKey;
|
|
940
|
+
readonly product: YieldProductKey;
|
|
941
|
+
readonly totalBalance: Money;
|
|
942
|
+
readonly netApy?: number;
|
|
943
|
+
readonly updatedAtBlockHeight: number;
|
|
944
|
+
readonly updatedAt: Date;
|
|
654
945
|
}
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
946
|
+
|
|
947
|
+
interface BitflowAmmLpPosition extends BaseYieldPosition {
|
|
948
|
+
provider: typeof YieldProviderKeys.bitflow;
|
|
949
|
+
product: typeof YieldProductKeys.bitflowAmmLp;
|
|
950
|
+
pools: BitflowAmmLpPool[];
|
|
951
|
+
}
|
|
952
|
+
interface BitflowAmmLpPool {
|
|
953
|
+
apy: number;
|
|
954
|
+
poolSharePercentage: number;
|
|
955
|
+
lpToken: {
|
|
956
|
+
asset: FungibleCryptoAsset;
|
|
957
|
+
balance: Money;
|
|
958
|
+
balanceQuote: Money;
|
|
662
959
|
};
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
readonly receivers: string[];
|
|
668
|
-
readonly amount: BigNumber$1;
|
|
669
|
-
readonly value?: {
|
|
670
|
-
crypto: Money;
|
|
671
|
-
quote: Money;
|
|
960
|
+
tokenX: {
|
|
961
|
+
asset: FungibleCryptoAsset;
|
|
962
|
+
balance: Money;
|
|
963
|
+
balanceQuote: Money;
|
|
672
964
|
};
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
readonly senders: string[];
|
|
678
|
-
readonly amount: BigNumber$1;
|
|
679
|
-
readonly value?: {
|
|
680
|
-
crypto: Money;
|
|
681
|
-
quote: Money;
|
|
965
|
+
tokenY: {
|
|
966
|
+
asset: FungibleCryptoAsset;
|
|
967
|
+
balance: Money;
|
|
968
|
+
balanceQuote: Money;
|
|
682
969
|
};
|
|
683
970
|
}
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
971
|
+
|
|
972
|
+
interface GraniteV1Position extends BaseYieldPosition {
|
|
973
|
+
provider: typeof YieldProviderKeys.granite;
|
|
974
|
+
product: typeof YieldProductKeys.graniteV1;
|
|
975
|
+
collateralBalance: Money;
|
|
976
|
+
aeusdcMarket: {
|
|
977
|
+
asset: FungibleCryptoAsset;
|
|
978
|
+
earnApy: number;
|
|
979
|
+
borrowApy: number;
|
|
691
980
|
};
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
crypto: Money;
|
|
696
|
-
quote: Money;
|
|
981
|
+
earn?: {
|
|
982
|
+
balance: Money;
|
|
983
|
+
balanceQuote: Money;
|
|
697
984
|
};
|
|
985
|
+
borrow?: {
|
|
986
|
+
balance: Money;
|
|
987
|
+
balanceQuote: Money;
|
|
988
|
+
};
|
|
989
|
+
collateral: GraniteV1CollateralAsset[];
|
|
698
990
|
}
|
|
699
|
-
interface
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
readonly type: 'connectApp';
|
|
704
|
-
readonly appName: string;
|
|
705
|
-
readonly appUrl: string;
|
|
706
|
-
}
|
|
707
|
-
interface SignMessageActivity extends BaseWalletActivity {
|
|
708
|
-
readonly type: 'signMessage';
|
|
709
|
-
readonly appName: string;
|
|
710
|
-
readonly appUrl: string;
|
|
711
|
-
}
|
|
712
|
-
interface GeneralActivity extends AppLevelActivity {
|
|
713
|
-
readonly type: GeneralActivityType;
|
|
714
|
-
readonly title: string;
|
|
715
|
-
readonly message: string;
|
|
991
|
+
interface GraniteV1CollateralAsset {
|
|
992
|
+
asset: FungibleCryptoAsset;
|
|
993
|
+
balance: Money;
|
|
994
|
+
balanceQuote: Money;
|
|
716
995
|
}
|
|
717
|
-
type OnChainActivity = DeploySmartContractActivity | ExecuteSmartContractActivity | LockAssetActivity | SendAssetActivity | ReceiveAssetActivity | SwapAssetsActivity;
|
|
718
|
-
type WalletActivity = ConnectAppActivity | SignMessageActivity;
|
|
719
|
-
type Activity = OnChainActivity | WalletActivity | GeneralActivity;
|
|
720
996
|
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
}
|
|
744
|
-
interface
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
997
|
+
interface StackingDaoLstPosition extends BaseYieldPosition {
|
|
998
|
+
provider: typeof YieldProviderKeys.stackingDao;
|
|
999
|
+
product: typeof YieldProductKeys.stackingDaoLst;
|
|
1000
|
+
totalBalance: Money;
|
|
1001
|
+
withdrawalsBalance: Money;
|
|
1002
|
+
ststx?: StackingDaoLstHolding;
|
|
1003
|
+
ststxbtc?: StackingDaoLstHolding;
|
|
1004
|
+
sbtcReward?: StackingDaoReward;
|
|
1005
|
+
withdrawals: StackingDaoLstWithdrawal[];
|
|
1006
|
+
}
|
|
1007
|
+
interface StackingDaoLstHolding {
|
|
1008
|
+
asset: FungibleCryptoAsset;
|
|
1009
|
+
balance: Money;
|
|
1010
|
+
balanceStx: Money;
|
|
1011
|
+
balanceQuote: Money;
|
|
1012
|
+
stxConversionRate: number;
|
|
1013
|
+
apy: number;
|
|
1014
|
+
}
|
|
1015
|
+
interface StackingDaoReward {
|
|
1016
|
+
asset: FungibleCryptoAsset;
|
|
1017
|
+
balance: Money;
|
|
1018
|
+
balanceQuote: Money;
|
|
1019
|
+
}
|
|
1020
|
+
interface StackingDaoLstWithdrawal {
|
|
1021
|
+
asset: FungibleCryptoAsset;
|
|
1022
|
+
balance: Money;
|
|
1023
|
+
balanceStx: Money;
|
|
1024
|
+
balanceQuote: Money;
|
|
1025
|
+
burnBlocksUntilUnlock: number;
|
|
1026
|
+
unlockBurnHeight: number;
|
|
1027
|
+
}
|
|
1028
|
+
interface StackingDaoPooledStackingPosition extends BaseYieldPosition {
|
|
1029
|
+
provider: typeof YieldProviderKeys.stackingDao;
|
|
1030
|
+
product: typeof YieldProductKeys.stackingDaoPooledStacking;
|
|
749
1031
|
}
|
|
750
1032
|
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
assetId: CryptoAssetId;
|
|
766
|
-
}
|
|
767
|
-
interface SwapQuote {
|
|
768
|
-
executionType: SwapExecutionType;
|
|
769
|
-
providerId: SwapProviderId;
|
|
770
|
-
providerQuoteData: unknown;
|
|
771
|
-
baseAmount: number;
|
|
772
|
-
targetAmount: number;
|
|
773
|
-
quote: Money;
|
|
774
|
-
dexPath: SwapDex[];
|
|
775
|
-
assetPath: (NativeCryptoAsset | Sip10Asset)[];
|
|
776
|
-
}
|
|
777
|
-
interface SwapDex {
|
|
778
|
-
name: string;
|
|
779
|
-
url: string;
|
|
780
|
-
logo: string;
|
|
781
|
-
description: string;
|
|
782
|
-
}
|
|
783
|
-
declare const swapExecutionTypes: readonly ["stacks-contract-call", "sbtc-bridge-transfer"];
|
|
784
|
-
type SwapExecutionType = (typeof swapExecutionTypes)[number];
|
|
785
|
-
interface BaseSwapExecutionData {
|
|
786
|
-
executionType: SwapExecutionType;
|
|
787
|
-
providerId: SwapProviderId;
|
|
788
|
-
}
|
|
789
|
-
interface StacksContractCallSwapExecutionData extends BaseSwapExecutionData {
|
|
790
|
-
executionType: 'stacks-contract-call';
|
|
791
|
-
contractAddress: string;
|
|
792
|
-
contractName: string;
|
|
793
|
-
functionName: string;
|
|
794
|
-
functionArgs: unknown[];
|
|
795
|
-
postConditions: unknown[];
|
|
796
|
-
postConditionMode?: unknown;
|
|
797
|
-
}
|
|
798
|
-
interface SbtcBridgeTransferSwapExecutionData extends BaseSwapExecutionData {
|
|
799
|
-
executionType: 'sbtc-bridge-transfer';
|
|
1033
|
+
interface ZestBorrowPosition extends BaseYieldPosition {
|
|
1034
|
+
provider: typeof YieldProviderKeys.zest;
|
|
1035
|
+
product: typeof YieldProductKeys.zestBorrow;
|
|
1036
|
+
supplyBalance: Money;
|
|
1037
|
+
borrowBalance: Money;
|
|
1038
|
+
ltvPercentage: number;
|
|
1039
|
+
borrowAssets: ZestBorrowAsset[];
|
|
1040
|
+
supplyAssets: ZestBorrowAsset[];
|
|
1041
|
+
}
|
|
1042
|
+
interface ZestBorrowAsset {
|
|
1043
|
+
asset: FungibleCryptoAsset;
|
|
1044
|
+
apy: number;
|
|
1045
|
+
balance: Money;
|
|
1046
|
+
balanceQuote: Money;
|
|
800
1047
|
}
|
|
801
|
-
type SwapExecutionData = StacksContractCallSwapExecutionData | SbtcBridgeTransferSwapExecutionData;
|
|
802
1048
|
|
|
803
|
-
|
|
1049
|
+
type YieldPosition = BitflowAmmLpPosition | ZestBorrowPosition | GraniteV1Position | StackingDaoLstPosition | StackingDaoPooledStackingPosition;
|
|
1050
|
+
|
|
1051
|
+
declare function isBitflowPosition(pos: YieldPosition): pos is BitflowAmmLpPosition;
|
|
1052
|
+
declare function isZestPosition(pos: YieldPosition): pos is ZestBorrowPosition;
|
|
1053
|
+
declare function isGranitePosition(pos: YieldPosition): pos is GraniteV1Position;
|
|
1054
|
+
declare function isStackingDaoLstPosition(pos: YieldPosition): pos is StackingDaoLstPosition;
|
|
1055
|
+
declare function isStackingDaoPooledPosition(pos: YieldPosition): pos is StackingDaoPooledStackingPosition;
|
|
1056
|
+
declare function filterPositionsByProtocol(positions: YieldPosition[], protocol: YieldProviderKey): YieldPosition[];
|
|
1057
|
+
declare function filterPositionsByProduct(positions: YieldPosition[], product: YieldProductKey): YieldPosition[];
|
|
1058
|
+
declare function filterPositionsByCategory(positions: YieldPosition[], products: YieldProduct[], category: YieldProductCategory): YieldPosition[];
|
|
1059
|
+
declare function sortPositionsByBalance(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1060
|
+
declare function sortPositionsByApy(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1061
|
+
declare function sortPositionsByUpdateTime(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1062
|
+
declare function getProtocolForProduct(product: YieldProductKey): YieldProviderKey;
|
|
1063
|
+
declare function getCategoryForProduct(product: YieldProduct): YieldProductCategory;
|
|
1064
|
+
declare function isProductInProtocol(product: YieldProductKey, protocol: YieldProviderKey): boolean;
|
|
1065
|
+
declare function getProductsForProtocol(protocol: YieldProviderKey): YieldProductKey[];
|
|
1066
|
+
declare function getProductsInCategory(products: YieldProduct[], category: YieldProductCategory): YieldProduct[];
|
|
1067
|
+
declare function groupPositionsByProtocol(positions: YieldPosition[]): Record<YieldProviderKey, YieldPosition[]>;
|
|
1068
|
+
declare function groupPositionsByCategory(positions: YieldPosition[], products: YieldProduct[]): Record<string, YieldPosition[]>;
|
|
1069
|
+
declare function getPositionsInCategories(positions: YieldPosition[], products: YieldProduct[], categories: YieldProductCategory[]): YieldPosition[];
|
|
1070
|
+
declare function hasPositionsInProtocol(positions: YieldPosition[], protocol: YieldProviderKey): boolean;
|
|
1071
|
+
declare function hasPositionsInCategory(positions: YieldPosition[], products: YieldProduct[], category: YieldProductCategory): boolean;
|
|
1072
|
+
declare function enrichPositionWithProtocol<T extends YieldPosition>(position: T, protocol: YieldProvider): T & {
|
|
1073
|
+
protocolData: YieldProvider;
|
|
1074
|
+
};
|
|
1075
|
+
declare function enrichPositionWithProduct<T extends YieldPosition>(position: T, product: YieldProduct): T & {
|
|
1076
|
+
productData: YieldProduct;
|
|
1077
|
+
};
|
|
1078
|
+
declare function enrichPositionWithMetadata<T extends YieldPosition>(position: T, protocol: YieldProvider, product: YieldProduct): T & {
|
|
1079
|
+
protocolData: YieldProvider;
|
|
1080
|
+
productData: YieldProduct;
|
|
1081
|
+
};
|
|
1082
|
+
declare function getCategoryDisplayName(category: YieldProductCategory): string;
|
|
1083
|
+
|
|
1084
|
+
export { type AccountAddresses, type AccountDisplayPreference, type AccountDisplayPreferenceInfo, type AccountId, type AccountLevelActivity, type Activity, type ActivityLevel, ActivityLevels, type ActivityType, type AllowAdditionalProperties, type AnalyticsPreference, type AppLevelActivity, type AverageBitcoinFeeRates, BESTINSLOT_API_BASE_URL_MAINNET, BESTINSLOT_API_BASE_URL_TESTNET, BITCOIN_API_BASE_URL_MAINNET, BITCOIN_API_BASE_URL_SIGNET, BITCOIN_API_BASE_URL_TESTNET3, BITCOIN_API_BASE_URL_TESTNET4, BNS_V2_API_BASE_URL, type BaseActivity, type BaseCryptoAsset, type BaseCryptoAssetBalance, type BaseNonFungibleCryptoAsset, type BaseOnChainActivity, type BaseSwapExecutionData, type BaseTransactionFeeQuote, type BaseWalletActivity, type BaseYieldPosition, type BitcoinAddress, type BitcoinAddressInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinTransaction, type BitcoinTransactionFeeQuote, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTransactionVin, type BitcoinTransactionVout, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, type BitflowAmmLpPool, type BitflowAmmLpPosition, type Blockchain, type BnsName, type BnsProfile, type BnsProfileData, type BnsProfileDataAddresses, type Brc20Asset, type BtcAsset, type BtcBalance, BtcFeeType, ChainId, type ConnectAppActivity, type CryptoAsset, type CryptoAssetBalance, CryptoAssetCategories, type CryptoAssetCategory, type CryptoAssetChain, CryptoAssetChains, type CryptoAssetId, type CryptoAssetProtocol, CryptoAssetProtocols, type CryptoCurrency, type Currency, type DefaultNetworkConfigurations, type DeploySmartContractActivity, type EmailAddress, type Entries, type EvmTransactionFeeQuote, type ExecuteSmartContractActivity, FeeCalculationTypes, FeeTypes, type Fees, type FlatTransactionFeeQuote, type FtTransfer, type FungibleAssetId, type FungibleCryptoAsset, type FungibleCryptoAssetProtocol, FungibleCryptoAssetProtocols, type GeneralActivity, type GeneralActivityType, GeneralActivityTypes, type GraniteV1CollateralAsset, type GraniteV1Position, HIRO_API_BASE_URL_MAINNET, HIRO_API_BASE_URL_MAINNET_EXTENDED, HIRO_API_BASE_URL_NAKAMOTO_TESTNET, HIRO_API_BASE_URL_TESTNET, HIRO_API_BASE_URL_TESTNET_EXTENDED, type HistoricalPeriod, type InscriptionAsset, type InscriptionMimeType, type LiteralUnion, type LockAssetActivity, type MarketData, type MarketPriceHistory, type MarketPriceSnapshot, type Money, type NativeCryptoAsset, type NetworkConfiguration, type NetworkModes, type NonFungibleCryptoAsset, type NonFungibleCryptoAssetProtocol, NonFungibleCryptoAssetProtocols, type NumType, type OnChainActivity, type OnChainActivityStatus, OnChainActivityStatuses, type OnChainActivityType, OnChainActivityTypes, type OwnedUtxo, type Prettify, type QuoteCurrency, type ReceiveAssetActivity, type ReplaceTypes, type RuneAsset, STX20_API_BASE_URL_MAINNET, type SbtcBridgeTransferSwapExecutionData, type SendAssetActivity, type SignMessageActivity, type Sip10Asset, type Sip9Asset, type Sip9AssetContent, type Sip9Attribute, type Sip9Collection, type Sip9ContentType, type Src20Asset, type StackingDaoLstHolding, type StackingDaoLstPosition, type StackingDaoLstWithdrawal, type StackingDaoPooledStackingPosition, type StackingDaoReward, type StacksAddressInfo, type StacksChainConfig, type StacksContractCallSwapExecutionData, type StacksFeeEstimate, type StacksTransactionFeeQuote, type StacksTx, type StacksTxStatus, type StampAsset, type Stx20Asset, type StxAsset, type StxBalance, type StxTransfer, type SupportedBlockchains, type SwapAsset, type SwapAssetsActivity, type SwapDex, type SwapExecutionData, type SwapExecutionType, type SwapProvider, type SwapProviderAsset, type SwapProviderId, type SwapQuote, type SwappableFungibleCryptoAsset, type TransactionErrorKey, type TransactionFeeQuote, type TransactionFeeQuoteType, type TransactionFeeTier, type TransactionFees, type Utxo, type UtxoId, type ValueOf, type WalletActivity, type WalletActivityType, WalletActivityTypes, WalletDefaultNetworkConfigurationIds, type WalletId, type YieldPosition, type YieldProduct, YieldProductCategories, type YieldProductCategory, type YieldProductKey, YieldProductKeys, YieldProductToProtocolMap, type YieldProvider, type YieldProviderKey, YieldProviderKeys, type ZestBorrowAsset, type ZestBorrowPosition, accountAddressesSchema, accountDisplayPreferenceSchema, accountIdSchema, analyticsPreferenceSchema, bitcoinAddressInfoSchema, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, bitcoinUnitSchema, bnsContractAddress, bnsContractName, btcTxTimeMap, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworkConfigurationsSchema, defaultNetworksKeyedById, emailAddressSchema, enrichPositionWithMetadata, enrichPositionWithProduct, enrichPositionWithProtocol, filterPositionsByCategory, filterPositionsByProduct, filterPositionsByProtocol, formatMarketPair, getCategoryDisplayName, getCategoryForProduct, getPositionsInCategories, getProductsForProtocol, getProductsInCategory, getProtocolForProduct, groupPositionsByCategory, groupPositionsByProtocol, hasPositionsInCategory, hasPositionsInProtocol, historicalPeriods, inscriptionMimeTypes, isBitflowPosition, isBrc20Asset, isBtcAsset, isFungibleAsset, isGranitePosition, isInscriptionAsset, isNativeAsset, isNonFungibleAsset, isProductInProtocol, isRuneAsset, isSip10Asset, isSip9Asset, isSrc20Asset, isStackingDaoLstPosition, isStackingDaoPooledPosition, isStampAsset, isStx20Asset, isStxAsset, isSwappableAsset, isZestPosition, networkConfigurationSchema, networkModes, sip9ContentTypes, sortPositionsByApy, sortPositionsByBalance, sortPositionsByUpdateTime, stacksAddressInfoSchema, supportedBlockchains, swapExecutionTypes, swapProviderIds, testnetModes, transactionFeeQuoteType, transactionFeeTiers, walletIdSchema };
|