@leather.io/models 0.47.0 → 0.49.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 +48 -0
- package/dist/index.d.ts +229 -65
- package/dist/index.js +154 -61
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/activity/activity.utils.ts +89 -0
- package/src/assets/asset-id.model.ts +0 -1
- package/src/assets/asset.model.ts +3 -0
- package/src/assets/sip9-asset.model.ts +2 -2
- package/src/index.ts +17 -4
- package/src/swap/swap.model.ts +35 -1
- package/src/yield/helpers/yield.helpers.ts +66 -45
- package/src/yield/providers/{bitflow.model.ts → bitflow-position.model.ts} +17 -9
- package/src/yield/providers/fast-pool-position.model.ts +6 -0
- package/src/yield/providers/granite-position.model.ts +27 -0
- package/src/yield/providers/hermetica-position.model.ts +19 -0
- package/src/yield/providers/lisa-position.model.ts +22 -0
- package/src/yield/providers/{stacking-dao.model.ts → stacking-dao-position.model.ts} +16 -13
- package/src/yield/providers/velar-position.model.ts +39 -0
- package/src/yield/providers/xverse-position.model.ts +6 -0
- package/src/yield/providers/{zest.model.ts → zest-position.model.ts} +3 -5
- package/src/yield/yield-position.base.model.ts +6 -3
- package/src/yield/yield-position.model.ts +31 -9
- package/src/yield/yield-product.model.ts +41 -17
- package/src/yield/yield-provider.model.ts +5 -2
- package/src/yield/providers/granite.model.ts +0 -31
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @leather.io/models@0.
|
|
2
|
+
> @leather.io/models@0.49.0 build /home/runner/work/mono/mono/packages/models
|
|
3
3
|
> tsup
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
[34mCLI[39m Using tsup config: /home/runner/work/mono/mono/packages/models/tsup.config.ts
|
|
9
9
|
[34mCLI[39m Target: es2022
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[32mESM[39m [1mdist/index.js [22m[
|
|
12
|
-
[32mESM[39m [1mdist/index.js.map [22m[
|
|
13
|
-
[32mESM[39m ⚡️ Build success in
|
|
11
|
+
[32mESM[39m [1mdist/index.js [22m[32m23.49 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m53.96 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 58ms
|
|
14
14
|
[34mDTS[39m Build start
|
|
15
|
-
[32mDTS[39m ⚡️ Build success in
|
|
16
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 3295ms
|
|
16
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m48.67 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -36,6 +36,54 @@
|
|
|
36
36
|
* devDependencies
|
|
37
37
|
* @leather.io/prettier-config bumped to 0.9.0
|
|
38
38
|
|
|
39
|
+
## [0.49.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.48.0...@leather.io/models-v0.49.0) (2025-11-19)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Features
|
|
43
|
+
|
|
44
|
+
* add alex swap provider ([152fd3a](https://github.com/leather-io/mono/commit/152fd3a6d015aace7bd682819a7d3d6112a64730))
|
|
45
|
+
* add descriptors to get addresses rpc ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
46
|
+
* add portfolio table ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
47
|
+
* portfolio activity ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
48
|
+
* portfolio ui hover, borders, token count ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
49
|
+
* **web:** add empty state ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
50
|
+
* **web:** add hover events ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
51
|
+
* **web:** add portfolio modal ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
52
|
+
* **web:** add stacked bar chart ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
53
|
+
* **web:** add stacks to portfolio list ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
54
|
+
* **web:** add tooltip ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
55
|
+
* **web:** adjust hover events ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
56
|
+
* **web:** bitcoin balance for portfolio ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
57
|
+
* **web:** breakdown by allocation ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
58
|
+
* **web:** scaffold portfolio page ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
59
|
+
* **web:** sip10 avatar icons web ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
60
|
+
* **web:** sip10 balances and assets ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
61
|
+
* **web:** stacks portfolio balance ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
### Bug Fixes
|
|
65
|
+
|
|
66
|
+
* **mobile:** ensure translations updated ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
67
|
+
* **mobile:** name is now defined for all models used ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
68
|
+
* resolve type issues by using activity model util ([2a9cf6a](https://github.com/leather-io/mono/commit/2a9cf6a2f6909b0bf01729e0c7124f53025df305))
|
|
69
|
+
* responsive portfolio ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
70
|
+
* **web:** a few style fixes ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
71
|
+
* **web:** add loading spinner to asset list ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
72
|
+
* **web:** add loading state to bar ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
73
|
+
* **web:** ensure stacks renders in list ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
74
|
+
* **web:** improve hover events and styles ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
75
|
+
* **web:** invisible hover overlay ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
76
|
+
* **web:** layout as per designs ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
77
|
+
* **web:** remove unused ui ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
78
|
+
* **web:** remove unused var ([0e664a7](https://github.com/leather-io/mono/commit/0e664a7066a31776ac7e5ec60fa5a0ad893b96ff))
|
|
79
|
+
|
|
80
|
+
## [0.48.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.47.0...@leather.io/models-v0.48.0) (2025-11-17)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
* enhances yield model ([4833500](https://github.com/leather-io/mono/commit/48335001f0eae0eb79e1563d91ed568fff877d3a))
|
|
86
|
+
|
|
39
87
|
## [0.47.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.46.0...@leather.io/models-v0.47.0) (2025-11-14)
|
|
40
88
|
|
|
41
89
|
|
package/dist/index.d.ts
CHANGED
|
@@ -120,6 +120,8 @@ interface Sip9Collection {
|
|
|
120
120
|
name: string;
|
|
121
121
|
collectionExplorerUrl: string;
|
|
122
122
|
totalItems?: number;
|
|
123
|
+
floorPrice?: Money;
|
|
124
|
+
latestSale?: Money;
|
|
123
125
|
}
|
|
124
126
|
interface Sip9AssetContent {
|
|
125
127
|
contentUrl: string;
|
|
@@ -142,8 +144,6 @@ interface Sip9Asset extends BaseNonFungibleCryptoAsset {
|
|
|
142
144
|
readonly attributes?: Sip9Attribute[];
|
|
143
145
|
readonly collection?: Sip9Collection;
|
|
144
146
|
readonly creator?: string;
|
|
145
|
-
readonly floorPrice?: Money;
|
|
146
|
-
readonly latestSale?: Money;
|
|
147
147
|
readonly rarityRank?: number;
|
|
148
148
|
}
|
|
149
149
|
|
|
@@ -201,11 +201,13 @@ interface BaseFungibleCryptoAsset extends BaseCryptoAsset {
|
|
|
201
201
|
interface BtcAsset extends BaseFungibleCryptoAsset {
|
|
202
202
|
readonly chain: 'bitcoin';
|
|
203
203
|
readonly protocol: 'nativeBtc';
|
|
204
|
+
readonly name: 'Bitcoin';
|
|
204
205
|
readonly symbol: 'BTC';
|
|
205
206
|
}
|
|
206
207
|
interface StxAsset extends BaseFungibleCryptoAsset {
|
|
207
208
|
readonly chain: 'stacks';
|
|
208
209
|
readonly protocol: 'nativeStx';
|
|
210
|
+
readonly name: 'Stacks';
|
|
209
211
|
readonly symbol: 'STX';
|
|
210
212
|
}
|
|
211
213
|
interface Brc20Asset extends BaseFungibleCryptoAsset {
|
|
@@ -262,6 +264,7 @@ interface InscriptionAsset extends BaseNonFungibleCryptoAsset {
|
|
|
262
264
|
readonly offset: string;
|
|
263
265
|
readonly preview: string;
|
|
264
266
|
readonly src: string;
|
|
267
|
+
readonly thumbnailSrc?: string;
|
|
265
268
|
readonly value: string;
|
|
266
269
|
readonly genesisBlockHash: string;
|
|
267
270
|
readonly genesisTimestamp: number;
|
|
@@ -377,7 +380,6 @@ type Activity = OnChainActivity | WalletActivity | GeneralActivity;
|
|
|
377
380
|
interface CryptoAssetId {
|
|
378
381
|
protocol: CryptoAssetProtocol;
|
|
379
382
|
id: string;
|
|
380
|
-
tokenId?: number;
|
|
381
383
|
}
|
|
382
384
|
|
|
383
385
|
declare function isFungibleAsset(asset: CryptoAsset): asset is FungibleCryptoAsset;
|
|
@@ -739,7 +741,8 @@ interface SwapProviderAsset {
|
|
|
739
741
|
providerAssetId: string;
|
|
740
742
|
assetId: CryptoAssetId;
|
|
741
743
|
}
|
|
742
|
-
|
|
744
|
+
type SwapQuote = AlexSdkSwapQuote | VelarSdkSwapQuote | BitflowSdkSwapQuote | SbtcBridgeSwapQuote;
|
|
745
|
+
interface BaseSwapQuote {
|
|
743
746
|
executionType: SwapExecutionType;
|
|
744
747
|
providerId: SwapProviderId;
|
|
745
748
|
providerQuoteData: unknown;
|
|
@@ -749,6 +752,30 @@ interface SwapQuote {
|
|
|
749
752
|
dexPath: SwapDex[];
|
|
750
753
|
assetPath: (NativeCryptoAsset | Sip10Asset)[];
|
|
751
754
|
}
|
|
755
|
+
interface AlexSdkSwapQuote extends BaseSwapQuote {
|
|
756
|
+
providerId: 'alex-sdk';
|
|
757
|
+
providerQuoteData: {
|
|
758
|
+
baseProviderAssetId: string;
|
|
759
|
+
targetProviderAssetId: string;
|
|
760
|
+
alexSdkAmmRoute: unknown;
|
|
761
|
+
};
|
|
762
|
+
}
|
|
763
|
+
interface VelarSdkSwapQuote extends BaseSwapQuote {
|
|
764
|
+
providerId: 'velar-sdk';
|
|
765
|
+
providerQuoteData: {
|
|
766
|
+
baseProviderAssetId: string;
|
|
767
|
+
targetProviderAssetId: string;
|
|
768
|
+
};
|
|
769
|
+
}
|
|
770
|
+
interface BitflowSdkSwapQuote extends BaseSwapQuote {
|
|
771
|
+
providerId: 'bitflow-sdk';
|
|
772
|
+
providerQuoteData: {
|
|
773
|
+
bitflowSdkSelectedSwapRoute: unknown;
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
interface SbtcBridgeSwapQuote extends BaseSwapQuote {
|
|
777
|
+
providerId: 'sbtc-bridge';
|
|
778
|
+
}
|
|
752
779
|
interface SwapDex {
|
|
753
780
|
name: string;
|
|
754
781
|
url: string;
|
|
@@ -893,6 +920,11 @@ declare const YieldProviderKeys: {
|
|
|
893
920
|
readonly zest: "zest";
|
|
894
921
|
readonly granite: "granite";
|
|
895
922
|
readonly stackingDao: "stackingdao";
|
|
923
|
+
readonly lisa: "lisa";
|
|
924
|
+
readonly hermetica: "hermetica";
|
|
925
|
+
readonly fastPool: "fast-pool";
|
|
926
|
+
readonly xverse: "xverse";
|
|
927
|
+
readonly velar: "velar";
|
|
896
928
|
};
|
|
897
929
|
type YieldProviderKey = (typeof YieldProviderKeys)[keyof typeof YieldProviderKeys];
|
|
898
930
|
interface YieldProvider {
|
|
@@ -904,53 +936,77 @@ interface YieldProvider {
|
|
|
904
936
|
|
|
905
937
|
declare const YieldProductKeys: {
|
|
906
938
|
readonly bitflowAmmLp: "bitflow-amm-lp";
|
|
907
|
-
readonly
|
|
908
|
-
readonly
|
|
909
|
-
readonly
|
|
939
|
+
readonly bitflowAmmStaking: "bitflow-amm-staking";
|
|
940
|
+
readonly zestBorrowMarket: "zest-borrow-market";
|
|
941
|
+
readonly graniteV1Earn: "granite-v1-earn";
|
|
942
|
+
readonly graniteV1Borrow: "granite-v1-borrow";
|
|
943
|
+
readonly stackingDaoStstx: "stackingdao-ststx";
|
|
944
|
+
readonly stackingDaoStstxbtc: "stackingdao-ststxbtc";
|
|
910
945
|
readonly stackingDaoPooledStacking: "stackingdao-pooled-stacking";
|
|
946
|
+
readonly lisaListx: "lisa-listx";
|
|
947
|
+
readonly lisaLiquidStaking: "lisa-liquid-staking";
|
|
948
|
+
readonly hermeticaUsdhStaking: "hermetica-usdh-staking";
|
|
949
|
+
readonly velarAmmLp: "velar-amm-lp";
|
|
950
|
+
readonly velarPerps: "velar-perps";
|
|
951
|
+
readonly velarAmmLpFarming: "velar-amm-lp-farming";
|
|
952
|
+
readonly fastPoolPooledStacking: "fast-pool-pooled-stacking";
|
|
953
|
+
readonly xversePooledStacking: "xverse-pooled-stacking";
|
|
911
954
|
};
|
|
912
955
|
type YieldProductKey = (typeof YieldProductKeys)[keyof typeof YieldProductKeys];
|
|
913
956
|
declare const YieldProductCategories: {
|
|
914
957
|
readonly AMM: "amm";
|
|
915
958
|
readonly LENDING: "lending";
|
|
916
|
-
readonly
|
|
917
|
-
readonly CDP: "cdp";
|
|
959
|
+
readonly LIQUID_STACKING: "liquid-stacking";
|
|
918
960
|
readonly POOLED_STACKING: "pooled-stacking";
|
|
961
|
+
readonly STAKING: "staking";
|
|
919
962
|
readonly PERPS: "perps";
|
|
920
963
|
};
|
|
921
964
|
type YieldProductCategory = (typeof YieldProductCategories)[keyof typeof YieldProductCategories];
|
|
922
|
-
declare const
|
|
965
|
+
declare const YieldProductToProviderMap: {
|
|
923
966
|
readonly "bitflow-amm-lp": "bitflow";
|
|
924
|
-
readonly "
|
|
925
|
-
readonly "
|
|
926
|
-
readonly "
|
|
967
|
+
readonly "bitflow-amm-staking": "bitflow";
|
|
968
|
+
readonly "zest-borrow-market": "zest";
|
|
969
|
+
readonly "granite-v1-earn": "granite";
|
|
970
|
+
readonly "granite-v1-borrow": "granite";
|
|
971
|
+
readonly "stackingdao-ststx": "stackingdao";
|
|
972
|
+
readonly "stackingdao-ststxbtc": "stackingdao";
|
|
927
973
|
readonly "stackingdao-pooled-stacking": "stackingdao";
|
|
974
|
+
readonly "lisa-listx": "lisa";
|
|
975
|
+
readonly "lisa-liquid-staking": "lisa";
|
|
976
|
+
readonly "hermetica-usdh-staking": "hermetica";
|
|
977
|
+
readonly "velar-amm-lp": "velar";
|
|
978
|
+
readonly "velar-perps": "velar";
|
|
979
|
+
readonly "velar-amm-lp-farming": "velar";
|
|
980
|
+
readonly "fast-pool-pooled-stacking": "fast-pool";
|
|
981
|
+
readonly "xverse-pooled-stacking": "xverse";
|
|
928
982
|
};
|
|
929
|
-
|
|
983
|
+
type YieldProduct = BaseYieldProduct | PooledStackingYieldProduct;
|
|
984
|
+
interface BaseYieldProduct {
|
|
930
985
|
readonly key: YieldProductKey;
|
|
931
986
|
readonly provider: YieldProviderKey;
|
|
987
|
+
readonly category: YieldProductCategory;
|
|
932
988
|
readonly name: string;
|
|
933
989
|
readonly url: string;
|
|
934
|
-
|
|
935
|
-
|
|
990
|
+
}
|
|
991
|
+
interface PooledStackingYieldProduct extends BaseYieldProduct {
|
|
992
|
+
readonly category: 'pooled-stacking';
|
|
993
|
+
readonly stackerCount: number;
|
|
936
994
|
}
|
|
937
995
|
|
|
938
996
|
interface BaseYieldPosition {
|
|
997
|
+
readonly id: string;
|
|
939
998
|
readonly provider: YieldProviderKey;
|
|
940
999
|
readonly product: YieldProductKey;
|
|
941
1000
|
readonly totalBalance: Money;
|
|
942
|
-
readonly
|
|
943
|
-
|
|
944
|
-
|
|
1001
|
+
readonly apy: number;
|
|
1002
|
+
}
|
|
1003
|
+
interface BasePooledStackingPosition extends BaseYieldPosition {
|
|
1004
|
+
readonly stackedBalanceStx: Money;
|
|
945
1005
|
}
|
|
946
1006
|
|
|
947
1007
|
interface BitflowAmmLpPosition extends BaseYieldPosition {
|
|
948
|
-
provider:
|
|
949
|
-
product:
|
|
950
|
-
pools: BitflowAmmLpPool[];
|
|
951
|
-
}
|
|
952
|
-
interface BitflowAmmLpPool {
|
|
953
|
-
apy: number;
|
|
1008
|
+
provider: 'bitflow';
|
|
1009
|
+
product: 'bitflow-amm-lp';
|
|
954
1010
|
poolSharePercentage: number;
|
|
955
1011
|
lpToken: {
|
|
956
1012
|
asset: FungibleCryptoAsset;
|
|
@@ -968,24 +1024,35 @@ interface BitflowAmmLpPool {
|
|
|
968
1024
|
balanceQuote: Money;
|
|
969
1025
|
};
|
|
970
1026
|
}
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
collateralBalance: Money;
|
|
976
|
-
aeusdcMarket: {
|
|
1027
|
+
interface BitflowAmmStakingPosition extends BaseYieldPosition {
|
|
1028
|
+
provider: 'bitflow';
|
|
1029
|
+
product: 'bitflow-amm-staking';
|
|
1030
|
+
stakedLpToken: {
|
|
977
1031
|
asset: FungibleCryptoAsset;
|
|
978
|
-
earnApy: number;
|
|
979
|
-
borrowApy: number;
|
|
980
|
-
};
|
|
981
|
-
earn?: {
|
|
982
1032
|
balance: Money;
|
|
983
1033
|
balanceQuote: Money;
|
|
984
1034
|
};
|
|
985
|
-
|
|
1035
|
+
rewardToken?: {
|
|
1036
|
+
asset: FungibleCryptoAsset;
|
|
986
1037
|
balance: Money;
|
|
987
1038
|
balanceQuote: Money;
|
|
988
1039
|
};
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
interface GraniteV1EarnPosition extends BaseYieldPosition {
|
|
1043
|
+
provider: 'granite';
|
|
1044
|
+
product: 'granite-v1-earn';
|
|
1045
|
+
marketAsset: FungibleCryptoAsset;
|
|
1046
|
+
marketAssetSupplyBalance: Money;
|
|
1047
|
+
marketAssetSupplyBalanceQuote: Money;
|
|
1048
|
+
}
|
|
1049
|
+
interface GraniteV1BorrowPosition extends BaseYieldPosition {
|
|
1050
|
+
provider: 'granite';
|
|
1051
|
+
product: 'granite-v1-borrow';
|
|
1052
|
+
marketAsset: FungibleCryptoAsset;
|
|
1053
|
+
marketAssetBorrowBalance: Money;
|
|
1054
|
+
marketAssetBorrowBalanceQuote: Money;
|
|
1055
|
+
collateralBalanceQuote: Money;
|
|
989
1056
|
collateral: GraniteV1CollateralAsset[];
|
|
990
1057
|
}
|
|
991
1058
|
interface GraniteV1CollateralAsset {
|
|
@@ -994,16 +1061,19 @@ interface GraniteV1CollateralAsset {
|
|
|
994
1061
|
balanceQuote: Money;
|
|
995
1062
|
}
|
|
996
1063
|
|
|
997
|
-
interface
|
|
998
|
-
provider:
|
|
999
|
-
product: typeof YieldProductKeys.stackingDaoLst;
|
|
1000
|
-
totalBalance: Money;
|
|
1064
|
+
interface BaseStackingDaoLstPosition extends BaseYieldPosition {
|
|
1065
|
+
provider: 'stackingdao';
|
|
1001
1066
|
withdrawalsBalance: Money;
|
|
1002
|
-
|
|
1003
|
-
ststxbtc?: StackingDaoLstHolding;
|
|
1004
|
-
sbtcReward?: StackingDaoReward;
|
|
1067
|
+
lstHolding?: StackingDaoLstHolding;
|
|
1005
1068
|
withdrawals: StackingDaoLstWithdrawal[];
|
|
1006
1069
|
}
|
|
1070
|
+
interface StackingDaoStStxPosition extends BaseStackingDaoLstPosition {
|
|
1071
|
+
product: 'stackingdao-ststx';
|
|
1072
|
+
}
|
|
1073
|
+
interface StackingDaoStStxBtcPosition extends BaseStackingDaoLstPosition {
|
|
1074
|
+
product: 'stackingdao-ststxbtc';
|
|
1075
|
+
sbtcReward?: StackingDaoReward;
|
|
1076
|
+
}
|
|
1007
1077
|
interface StackingDaoLstHolding {
|
|
1008
1078
|
asset: FungibleCryptoAsset;
|
|
1009
1079
|
balance: Money;
|
|
@@ -1025,14 +1095,14 @@ interface StackingDaoLstWithdrawal {
|
|
|
1025
1095
|
burnBlocksUntilUnlock: number;
|
|
1026
1096
|
unlockBurnHeight: number;
|
|
1027
1097
|
}
|
|
1028
|
-
interface StackingDaoPooledStackingPosition extends
|
|
1029
|
-
provider:
|
|
1030
|
-
product:
|
|
1098
|
+
interface StackingDaoPooledStackingPosition extends BasePooledStackingPosition {
|
|
1099
|
+
provider: 'stackingdao';
|
|
1100
|
+
product: 'stackingdao-pooled-stacking';
|
|
1031
1101
|
}
|
|
1032
1102
|
|
|
1033
|
-
interface
|
|
1034
|
-
provider:
|
|
1035
|
-
product:
|
|
1103
|
+
interface ZestBorrowMarketPosition extends BaseYieldPosition {
|
|
1104
|
+
provider: 'zest';
|
|
1105
|
+
product: 'zest-borrow-market';
|
|
1036
1106
|
supplyBalance: Money;
|
|
1037
1107
|
borrowBalance: Money;
|
|
1038
1108
|
ltvPercentage: number;
|
|
@@ -1046,39 +1116,133 @@ interface ZestBorrowAsset {
|
|
|
1046
1116
|
balanceQuote: Money;
|
|
1047
1117
|
}
|
|
1048
1118
|
|
|
1049
|
-
|
|
1119
|
+
interface FastPoolPooledStackingPosition extends BasePooledStackingPosition {
|
|
1120
|
+
provider: 'fast-pool';
|
|
1121
|
+
product: 'fast-pool-pooled-stacking';
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
interface HermeticaUsdhStakingPosition extends BaseYieldPosition {
|
|
1125
|
+
provider: 'hermetica';
|
|
1126
|
+
product: 'hermetica-usdh-staking';
|
|
1127
|
+
staking: HermeticaStaking;
|
|
1128
|
+
}
|
|
1129
|
+
interface HermeticaStaking {
|
|
1130
|
+
asset: FungibleCryptoAsset;
|
|
1131
|
+
balance: Money;
|
|
1132
|
+
balanceQuote: Money;
|
|
1133
|
+
apy: number;
|
|
1134
|
+
rewardAsset?: FungibleCryptoAsset;
|
|
1135
|
+
rewardBalance?: Money;
|
|
1136
|
+
rewardBalanceQuote?: Money;
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
interface LisaLiStxPosition extends BaseYieldPosition {
|
|
1140
|
+
provider: 'lisa';
|
|
1141
|
+
product: 'lisa-listx';
|
|
1142
|
+
holding: LisaLstHolding;
|
|
1143
|
+
}
|
|
1144
|
+
interface LisaLiquidStakingPosition extends BaseYieldPosition {
|
|
1145
|
+
provider: 'lisa';
|
|
1146
|
+
product: 'lisa-liquid-staking';
|
|
1147
|
+
holding: LisaLstHolding;
|
|
1148
|
+
}
|
|
1149
|
+
interface LisaLstHolding {
|
|
1150
|
+
asset: FungibleCryptoAsset;
|
|
1151
|
+
balance: Money;
|
|
1152
|
+
balanceQuote: Money;
|
|
1153
|
+
apy: number;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
interface VelarAmmLpPosition extends BaseYieldPosition {
|
|
1157
|
+
provider: 'velar';
|
|
1158
|
+
product: 'velar-amm-lp';
|
|
1159
|
+
poolSharePercentage: number;
|
|
1160
|
+
lpToken: {
|
|
1161
|
+
asset: FungibleCryptoAsset;
|
|
1162
|
+
balance: Money;
|
|
1163
|
+
balanceQuote: Money;
|
|
1164
|
+
};
|
|
1165
|
+
tokenX: {
|
|
1166
|
+
asset: FungibleCryptoAsset;
|
|
1167
|
+
balance: Money;
|
|
1168
|
+
balanceQuote: Money;
|
|
1169
|
+
};
|
|
1170
|
+
tokenY: {
|
|
1171
|
+
asset: FungibleCryptoAsset;
|
|
1172
|
+
balance: Money;
|
|
1173
|
+
balanceQuote: Money;
|
|
1174
|
+
};
|
|
1175
|
+
}
|
|
1176
|
+
interface VelarFarmPosition extends BaseYieldPosition {
|
|
1177
|
+
provider: 'velar';
|
|
1178
|
+
product: 'velar-amm-lp-farming';
|
|
1179
|
+
stakedLpToken: {
|
|
1180
|
+
asset: FungibleCryptoAsset;
|
|
1181
|
+
balance: Money;
|
|
1182
|
+
balanceQuote: Money;
|
|
1183
|
+
};
|
|
1184
|
+
rewardToken?: {
|
|
1185
|
+
asset: FungibleCryptoAsset;
|
|
1186
|
+
balance: Money;
|
|
1187
|
+
balanceQuote: Money;
|
|
1188
|
+
};
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
interface XversePooledStackingPosition extends BasePooledStackingPosition {
|
|
1192
|
+
provider: 'xverse';
|
|
1193
|
+
product: 'xverse-pooled-stacking';
|
|
1194
|
+
}
|
|
1050
1195
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
declare function
|
|
1054
|
-
declare function
|
|
1196
|
+
type YieldPosition = BitflowAmmLpPosition | BitflowAmmStakingPosition | ZestBorrowMarketPosition | GraniteV1EarnPosition | GraniteV1BorrowPosition | StackingDaoStStxPosition | StackingDaoStStxBtcPosition | StackingDaoPooledStackingPosition | VelarAmmLpPosition | VelarFarmPosition | LisaLiStxPosition | LisaLiquidStakingPosition | HermeticaUsdhStakingPosition | FastPoolPooledStackingPosition | XversePooledStackingPosition;
|
|
1197
|
+
|
|
1198
|
+
declare function isBitflowAmmLpPosition(pos: YieldPosition): pos is BitflowAmmLpPosition;
|
|
1199
|
+
declare function isBitflowAmmStakingPosition(pos: YieldPosition): pos is BitflowAmmStakingPosition;
|
|
1200
|
+
declare function isZestPosition(pos: YieldPosition): pos is ZestBorrowMarketPosition;
|
|
1201
|
+
declare function isGraniteEarnPosition(pos: YieldPosition): pos is GraniteV1EarnPosition;
|
|
1202
|
+
declare function isGraniteBorrowPosition(pos: YieldPosition): pos is GraniteV1BorrowPosition;
|
|
1203
|
+
declare function isStackingDaoStStxPosition(pos: YieldPosition): pos is StackingDaoStStxPosition;
|
|
1204
|
+
declare function isStackingDaoStStxBtcPosition(pos: YieldPosition): pos is StackingDaoStStxBtcPosition;
|
|
1055
1205
|
declare function isStackingDaoPooledPosition(pos: YieldPosition): pos is StackingDaoPooledStackingPosition;
|
|
1056
|
-
declare function
|
|
1206
|
+
declare function filterPositionsByProvider(positions: YieldPosition[], provider: YieldProviderKey): YieldPosition[];
|
|
1057
1207
|
declare function filterPositionsByProduct(positions: YieldPosition[], product: YieldProductKey): YieldPosition[];
|
|
1058
1208
|
declare function filterPositionsByCategory(positions: YieldPosition[], products: YieldProduct[], category: YieldProductCategory): YieldPosition[];
|
|
1059
1209
|
declare function sortPositionsByBalance(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1060
1210
|
declare function sortPositionsByApy(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1061
1211
|
declare function sortPositionsByUpdateTime(positions: YieldPosition[], ascending?: boolean): YieldPosition[];
|
|
1062
|
-
declare function
|
|
1212
|
+
declare function getProviderForProduct(product: YieldProductKey): YieldProviderKey;
|
|
1063
1213
|
declare function getCategoryForProduct(product: YieldProduct): YieldProductCategory;
|
|
1064
|
-
declare function
|
|
1065
|
-
declare function
|
|
1214
|
+
declare function isProductInProvider(product: YieldProductKey, provider: YieldProviderKey): boolean;
|
|
1215
|
+
declare function getProductsForProvider(provider: YieldProviderKey): YieldProductKey[];
|
|
1066
1216
|
declare function getProductsInCategory(products: YieldProduct[], category: YieldProductCategory): YieldProduct[];
|
|
1067
|
-
declare function
|
|
1217
|
+
declare function groupPositionsByProvider(positions: YieldPosition[]): Record<YieldProviderKey, YieldPosition[]>;
|
|
1068
1218
|
declare function groupPositionsByCategory(positions: YieldPosition[], products: YieldProduct[]): Record<string, YieldPosition[]>;
|
|
1069
1219
|
declare function getPositionsInCategories(positions: YieldPosition[], products: YieldProduct[], categories: YieldProductCategory[]): YieldPosition[];
|
|
1070
|
-
declare function
|
|
1220
|
+
declare function hasPositionsInProvider(positions: YieldPosition[], provider: YieldProviderKey): boolean;
|
|
1071
1221
|
declare function hasPositionsInCategory(positions: YieldPosition[], products: YieldProduct[], category: YieldProductCategory): boolean;
|
|
1072
|
-
declare function
|
|
1073
|
-
|
|
1222
|
+
declare function enrichPositionWithProvider<T extends YieldPosition>(position: T, provider: YieldProvider): T & {
|
|
1223
|
+
providerData: YieldProvider;
|
|
1074
1224
|
};
|
|
1075
1225
|
declare function enrichPositionWithProduct<T extends YieldPosition>(position: T, product: YieldProduct): T & {
|
|
1076
1226
|
productData: YieldProduct;
|
|
1077
1227
|
};
|
|
1078
|
-
declare function enrichPositionWithMetadata<T extends YieldPosition>(position: T,
|
|
1079
|
-
|
|
1228
|
+
declare function enrichPositionWithMetadata<T extends YieldPosition>(position: T, provider: YieldProvider, product: YieldProduct): T & {
|
|
1229
|
+
providerData: YieldProvider;
|
|
1080
1230
|
productData: YieldProduct;
|
|
1081
1231
|
};
|
|
1082
1232
|
declare function getCategoryDisplayName(category: YieldProductCategory): string;
|
|
1083
1233
|
|
|
1084
|
-
|
|
1234
|
+
type BitcoinNetworkPreference = 'mainnet' | 'testnet4' | 'signet';
|
|
1235
|
+
interface MakeActivityArgs {
|
|
1236
|
+
txid: string;
|
|
1237
|
+
networkPreference: NetworkConfiguration;
|
|
1238
|
+
asset?: CryptoAsset;
|
|
1239
|
+
}
|
|
1240
|
+
declare function makeActivityLink({ txid, networkPreference, asset }: MakeActivityArgs): string | null;
|
|
1241
|
+
interface GetMempoolExplorerLinkArgs {
|
|
1242
|
+
id: string;
|
|
1243
|
+
type: 'txid' | 'block';
|
|
1244
|
+
networkPreference: BitcoinNetworkPreference;
|
|
1245
|
+
}
|
|
1246
|
+
declare function getMempoolExplorerLink({ id, type, networkPreference, }: GetMempoolExplorerLinkArgs): string | null;
|
|
1247
|
+
|
|
1248
|
+
export { type AccountAddresses, type AccountDisplayPreference, type AccountDisplayPreferenceInfo, type AccountId, type AccountLevelActivity, type Activity, type ActivityLevel, ActivityLevels, type ActivityType, type AlexSdkSwapQuote, 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 BasePooledStackingPosition, type BaseSwapExecutionData, type BaseSwapQuote, type BaseTransactionFeeQuote, type BaseWalletActivity, type BaseYieldPosition, type BaseYieldProduct, type BitcoinAddress, type BitcoinAddressInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinNetworkPreference, type BitcoinTransaction, type BitcoinTransactionFeeQuote, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTransactionVin, type BitcoinTransactionVout, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, type BitflowAmmLpPosition, type BitflowAmmStakingPosition, type BitflowSdkSwapQuote, 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, type FastPoolPooledStackingPosition, FeeCalculationTypes, FeeTypes, type Fees, type FlatTransactionFeeQuote, type FtTransfer, type FungibleAssetId, type FungibleCryptoAsset, type FungibleCryptoAssetProtocol, FungibleCryptoAssetProtocols, type GeneralActivity, type GeneralActivityType, GeneralActivityTypes, type GetMempoolExplorerLinkArgs, type GraniteV1BorrowPosition, type GraniteV1CollateralAsset, type GraniteV1EarnPosition, 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 HermeticaStaking, type HermeticaUsdhStakingPosition, type HistoricalPeriod, type InscriptionAsset, type InscriptionMimeType, type LisaLiStxPosition, type LisaLiquidStakingPosition, type LisaLstHolding, type LiteralUnion, type LockAssetActivity, type MakeActivityArgs, 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 PooledStackingYieldProduct, type Prettify, type QuoteCurrency, type ReceiveAssetActivity, type ReplaceTypes, type RuneAsset, STX20_API_BASE_URL_MAINNET, type SbtcBridgeSwapQuote, type SbtcBridgeTransferSwapExecutionData, type SendAssetActivity, type SignMessageActivity, type Sip10Asset, type Sip9Asset, type Sip9AssetContent, type Sip9Attribute, type Sip9Collection, type Sip9ContentType, type Src20Asset, type StackingDaoLstHolding, type StackingDaoLstWithdrawal, type StackingDaoPooledStackingPosition, type StackingDaoReward, type StackingDaoStStxBtcPosition, type StackingDaoStStxPosition, 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 VelarAmmLpPosition, type VelarFarmPosition, type VelarSdkSwapQuote, type WalletActivity, type WalletActivityType, WalletActivityTypes, WalletDefaultNetworkConfigurationIds, type WalletId, type XversePooledStackingPosition, type YieldPosition, type YieldProduct, YieldProductCategories, type YieldProductCategory, type YieldProductKey, YieldProductKeys, YieldProductToProviderMap, type YieldProvider, type YieldProviderKey, YieldProviderKeys, type ZestBorrowAsset, type ZestBorrowMarketPosition, accountAddressesSchema, accountDisplayPreferenceSchema, accountIdSchema, analyticsPreferenceSchema, bitcoinAddressInfoSchema, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, bitcoinUnitSchema, bnsContractAddress, bnsContractName, btcTxTimeMap, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworkConfigurationsSchema, defaultNetworksKeyedById, emailAddressSchema, enrichPositionWithMetadata, enrichPositionWithProduct, enrichPositionWithProvider, filterPositionsByCategory, filterPositionsByProduct, filterPositionsByProvider, formatMarketPair, getCategoryDisplayName, getCategoryForProduct, getMempoolExplorerLink, getPositionsInCategories, getProductsForProvider, getProductsInCategory, getProviderForProduct, groupPositionsByCategory, groupPositionsByProvider, hasPositionsInCategory, hasPositionsInProvider, historicalPeriods, inscriptionMimeTypes, isBitflowAmmLpPosition, isBitflowAmmStakingPosition, isBrc20Asset, isBtcAsset, isFungibleAsset, isGraniteBorrowPosition, isGraniteEarnPosition, isInscriptionAsset, isNativeAsset, isNonFungibleAsset, isProductInProvider, isRuneAsset, isSip10Asset, isSip9Asset, isSrc20Asset, isStackingDaoPooledPosition, isStackingDaoStStxBtcPosition, isStackingDaoStStxPosition, isStampAsset, isStx20Asset, isStxAsset, isSwappableAsset, isZestPosition, makeActivityLink, networkConfigurationSchema, networkModes, sip9ContentTypes, sortPositionsByApy, sortPositionsByBalance, sortPositionsByUpdateTime, stacksAddressInfoSchema, supportedBlockchains, swapExecutionTypes, swapProviderIds, testnetModes, transactionFeeQuoteType, transactionFeeTiers, walletIdSchema };
|