@leather.io/models 0.43.0 → 0.44.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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @leather.io/models@0.43.0 build /home/runner/work/mono/mono/packages/models
2
+ > @leather.io/models@0.44.1 build /home/runner/work/mono/mono/packages/models
3
3
  > tsup
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,9 +8,9 @@
8
8
  CLI Using tsup config: /home/runner/work/mono/mono/packages/models/tsup.config.ts
9
9
  CLI Target: es2022
10
10
  ESM Build start
11
- ESM dist/index.js 12.43 KB
12
- ESM dist/index.js.map 30.53 KB
13
- ESM ⚡️ Build success in 42ms
11
+ ESM dist/index.js 13.24 KB
12
+ ESM dist/index.js.map 30.85 KB
13
+ ESM ⚡️ Build success in 37ms
14
14
  DTS Build start
15
- DTS ⚡️ Build success in 2944ms
16
- DTS dist/index.d.ts 29.97 KB
15
+ DTS ⚡️ Build success in 2749ms
16
+ DTS dist/index.d.ts 29.99 KB
package/CHANGELOG.md CHANGED
@@ -30,6 +30,26 @@
30
30
  * devDependencies
31
31
  * @leather.io/tsconfig-config bumped to 0.8.0
32
32
 
33
+ ### Dependencies
34
+
35
+ * The following workspace dependencies were updated
36
+ * devDependencies
37
+ * @leather.io/prettier-config bumped to 0.9.0
38
+
39
+ ## [0.44.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.43.0...@leather.io/models-v0.44.0) (2025-10-10)
40
+
41
+
42
+ ### Features
43
+
44
+ * **mobile:** filter out floor price ([dc88f69](https://github.com/leather-io/mono/commit/dc88f692410cac46e938564530accd15c8ad50fd))
45
+ * **mobile:** make ActionButtons dynamic, add isSwappableAsset type guard ([c4b32ed](https://github.com/leather-io/mono/commit/c4b32ede97cba32acd484982198fb442a092ec84))
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * **mobile:** encapsulate SIP9 provider data to keep the interface cleaner ([f7957c9](https://github.com/leather-io/mono/commit/f7957c9367e373c39c3cae3eccf00f224cf3f9bc))
51
+ * **mobile:** fix duplicate key error message ([c8404d8](https://github.com/leather-io/mono/commit/c8404d8c6265d8aa713d62bafd95d16b35ab7f43))
52
+
33
53
  ## [0.43.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.42.0...@leather.io/models-v0.43.0) (2025-09-30)
34
54
 
35
55
 
package/dist/index.d.ts CHANGED
@@ -116,6 +116,35 @@ interface Inscription extends InscriptionAsset {
116
116
  value: string;
117
117
  }
118
118
 
119
+ 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
+ type Sip9ContentType = (typeof sip9ContentTypes)[number];
121
+ interface Sip9Collection {
122
+ name: string;
123
+ collectionExplorerUrl: string;
124
+ totalItems?: number;
125
+ }
126
+ interface Sip9AssetContent {
127
+ contentUrl: string;
128
+ contentType: Sip9ContentType;
129
+ }
130
+ interface Sip9Attribute {
131
+ traitType: string;
132
+ value: any;
133
+ rarityPercent?: number;
134
+ }
135
+ interface Sip9Asset extends BaseNonFungibleCryptoAsset {
136
+ readonly chain: 'stacks';
137
+ readonly protocol: 'sip9';
138
+ readonly assetId: string;
139
+ readonly contractId: string;
140
+ readonly tokenId: number;
141
+ readonly name: string;
142
+ readonly description: string;
143
+ readonly content: Sip9AssetContent;
144
+ readonly attributes?: Sip9Attribute[];
145
+ readonly collection?: Sip9Collection;
146
+ }
147
+
119
148
  declare const CryptoAssetChains: {
120
149
  readonly bitcoin: "bitcoin";
121
150
  readonly stacks: "stacks";
@@ -242,31 +271,6 @@ interface StampAsset extends BaseNonFungibleCryptoAsset {
242
271
  readonly stamp: number;
243
272
  readonly stampUrl: string;
244
273
  }
245
- type Sip9ContentType = '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';
246
- type SupportedSip9ContentType = Extract<Sip9ContentType, 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp' | 'image/svg+xml' | 'image/bmp' | 'image/tiff' | 'image/avif' | 'video/mp4' | 'audio/mpeg' | 'audio/mp3' | 'audio/wav' | 'audio/ogg' | 'audio/aac' | 'audio/flac' | 'audio/webm' | 'text/plain' | 'application/octet-stream' | 'model/gltf+json' | 'model/gltf-binary'> | '';
247
- interface Sip9Asset extends BaseNonFungibleCryptoAsset {
248
- readonly chain: 'stacks';
249
- readonly protocol: 'sip9';
250
- readonly assetId: string;
251
- readonly contractId: string;
252
- readonly tokenId: number;
253
- readonly name: string;
254
- readonly description: string;
255
- readonly cachedImage: string;
256
- readonly cachedImageThumbnail: string;
257
- readonly contentType: SupportedSip9ContentType;
258
- readonly collection: {
259
- id: string;
260
- name: string;
261
- isVerified: boolean;
262
- locationUrl: string;
263
- totalItems: number;
264
- floorPriceAmount: {
265
- amount: number;
266
- unit: string;
267
- };
268
- };
269
- }
270
274
  type NonFungibleCryptoAsset = InscriptionAsset | StampAsset | Sip9Asset;
271
275
  type CryptoAsset = FungibleCryptoAsset | NonFungibleCryptoAsset;
272
276
  interface FungibleAssetId {
@@ -285,6 +289,7 @@ declare function isBtcAsset(asset: CryptoAsset): asset is BtcAsset;
285
289
  declare function isStxAsset(asset: CryptoAsset): asset is StxAsset;
286
290
  declare function isNativeAsset(asset: CryptoAsset): asset is NativeCryptoAsset;
287
291
  declare function isSip10Asset(asset: CryptoAsset): asset is Sip10Asset;
292
+ declare function isSwappableAsset(asset: CryptoAsset): asset is NativeCryptoAsset | Sip10Asset;
288
293
  declare function isBrc20Asset(asset: CryptoAsset): asset is Brc20Asset;
289
294
  declare function isSrc20Asset(asset: CryptoAsset): asset is Src20Asset;
290
295
  declare function isStx20Asset(asset: CryptoAsset): asset is Stx20Asset;
@@ -738,8 +743,9 @@ interface BnsProfileDataAddresses {
738
743
  ethereum?: string;
739
744
  }
740
745
 
746
+ type SwappableFungibleCryptoAsset = NativeCryptoAsset | Sip10Asset;
741
747
  interface SwapAsset {
742
- asset: FungibleCryptoAsset;
748
+ asset: SwappableFungibleCryptoAsset;
743
749
  providerAssets: SwapProviderAsset[];
744
750
  }
745
751
  declare const swapProviderIds: readonly ["bitflow-sdk", "sbtc-bridge", "alex-sdk", "velar-sdk"];
@@ -761,7 +767,7 @@ interface SwapQuote {
761
767
  targetAmount: number;
762
768
  quote: Money;
763
769
  dexPath: SwapDex[];
764
- assetPath: FungibleCryptoAsset[];
770
+ assetPath: (NativeCryptoAsset | Sip10Asset)[];
765
771
  }
766
772
  interface SwapDex {
767
773
  name: string;
@@ -789,4 +795,4 @@ interface SbtcBridgeTransferSwapExecutionData extends BaseSwapExecutionData {
789
795
  }
790
796
  type SwapExecutionData = StacksContractCallSwapExecutionData | SbtcBridgeTransferSwapExecutionData;
791
797
 
792
- 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 BaseOnChainActivity, type BaseSwapExecutionData, type BaseWalletActivity, type BitcoinAddress, type BitcoinAddressInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, 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 ExecuteSmartContractActivity, FeeCalculationTypes, FeeTypes, type Fees, type FtTransfer, type FungibleAssetId, type FungibleCryptoAsset, type FungibleCryptoAssetProtocol, FungibleCryptoAssetProtocols, type GeneralActivity, type GeneralActivityType, GeneralActivityTypes, 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 Inscription, type InscriptionAsset, type InscriptionMimeType, type LiteralUnion, type LockAssetActivity, type MarketData, 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 Sip9ContentType, type Src20Asset, type StacksAddressInfo, type StacksChainConfig, type StacksContractCallSwapExecutionData, type StacksFeeEstimate, type StacksTx, type StacksTxStatus, type StampAsset, type Stx20Asset, type StxAsset, type StxBalance, type StxTransfer, type SupportedBlockchains, type SupportedSip9ContentType, type SwapAsset, type SwapAssetsActivity, type SwapDex, type SwapExecutionData, type SwapExecutionType, type SwapProvider, type SwapProviderAsset, type SwapProviderId, type SwapQuote, type TransactionErrorKey, type Utxo, type UtxoId, type ValueOf, type WalletActivity, type WalletActivityType, WalletActivityTypes, WalletDefaultNetworkConfigurationIds, type WalletId, accountAddressesSchema, accountIdSchema, bitcoinAddressInfoSchema, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, bnsContractAddress, bnsContractName, btcTxTimeMap, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworksKeyedById, emailAddressSchema, formatMarketPair, inscriptionMimeTypes, isBrc20Asset, isBtcAsset, isFungibleAsset, isInscriptionAsset, isNativeAsset, isNonFungibleAsset, isRuneAsset, isSip10Asset, isSip9Asset, isSrc20Asset, isStampAsset, isStx20Asset, isStxAsset, networkConfigurationSchema, networkModes, stacksAddressInfoSchema, supportedBlockchains, swapExecutionTypes, swapProviderIds, testnetModes, walletIdSchema };
798
+ 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 BaseWalletActivity, type BitcoinAddress, type BitcoinAddressInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, 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 ExecuteSmartContractActivity, FeeCalculationTypes, FeeTypes, type Fees, type FtTransfer, type FungibleAssetId, type FungibleCryptoAsset, type FungibleCryptoAssetProtocol, FungibleCryptoAssetProtocols, type GeneralActivity, type GeneralActivityType, GeneralActivityTypes, 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 Inscription, type InscriptionAsset, type InscriptionMimeType, type LiteralUnion, type LockAssetActivity, type MarketData, 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 StacksAddressInfo, type StacksChainConfig, type StacksContractCallSwapExecutionData, type StacksFeeEstimate, 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 Utxo, type UtxoId, type ValueOf, type WalletActivity, type WalletActivityType, WalletActivityTypes, WalletDefaultNetworkConfigurationIds, type WalletId, accountAddressesSchema, accountIdSchema, bitcoinAddressInfoSchema, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, bnsContractAddress, bnsContractName, btcTxTimeMap, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworksKeyedById, emailAddressSchema, formatMarketPair, inscriptionMimeTypes, isBrc20Asset, isBtcAsset, isFungibleAsset, isInscriptionAsset, isNativeAsset, isNonFungibleAsset, isRuneAsset, isSip10Asset, isSip9Asset, isSrc20Asset, isStampAsset, isStx20Asset, isStxAsset, isSwappableAsset, networkConfigurationSchema, networkModes, sip9ContentTypes, stacksAddressInfoSchema, supportedBlockchains, swapExecutionTypes, swapProviderIds, testnetModes, walletIdSchema };
package/dist/index.js CHANGED
@@ -45,6 +45,9 @@ function isNativeAsset(asset) {
45
45
  function isSip10Asset(asset) {
46
46
  return asset.protocol === "sip10";
47
47
  }
48
+ function isSwappableAsset(asset) {
49
+ return isNativeAsset(asset) || isSip10Asset(asset);
50
+ }
48
51
  function isBrc20Asset(asset) {
49
52
  return asset.protocol === "brc20";
50
53
  }
@@ -67,6 +70,47 @@ function isSip9Asset(asset) {
67
70
  return asset.protocol === "sip9";
68
71
  }
69
72
 
73
+ // src/assets/sip9-asset.model.ts
74
+ var sip9ContentTypes = [
75
+ "image/jpeg",
76
+ "image/jpg",
77
+ "image/png",
78
+ "image/gif",
79
+ "image/webp",
80
+ "image/svg+xml",
81
+ "image/bmp",
82
+ "image/tiff",
83
+ "image/avif",
84
+ "video/mp4",
85
+ "video/webm",
86
+ "video/mov",
87
+ "video/quicktime",
88
+ "video/avi",
89
+ "video/x-msvideo",
90
+ "video/ogg",
91
+ "audio/mpeg",
92
+ "audio/mp3",
93
+ "audio/wav",
94
+ "audio/x-wav",
95
+ "audio/ogg",
96
+ "audio/aac",
97
+ "audio/flac",
98
+ "audio/webm",
99
+ "model/gltf+json",
100
+ "model/gltf-binary",
101
+ "application/octet-stream",
102
+ "text/plain",
103
+ "text/html",
104
+ "text/markdown",
105
+ "application/pdf",
106
+ "application/json",
107
+ "text/javascript",
108
+ "application/javascript",
109
+ "application/zip",
110
+ "unknown",
111
+ ""
112
+ ];
113
+
70
114
  // src/inscription-mime-type.model.ts
71
115
  var inscriptionMimeTypes = [
72
116
  "audio",
@@ -449,8 +493,10 @@ export {
449
493
  isStampAsset,
450
494
  isStx20Asset,
451
495
  isStxAsset,
496
+ isSwappableAsset,
452
497
  networkConfigurationSchema,
453
498
  networkModes,
499
+ sip9ContentTypes,
454
500
  stacksAddressInfoSchema,
455
501
  supportedBlockchains,
456
502
  swapExecutionTypes,
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/assets/asset.model.ts","../src/assets/asset-type-guards.ts","../src/inscription-mime-type.model.ts","../src/fees/bitcoin-fees.model.ts","../src/fees/fees.model.ts","../src/market.model.ts","../src/network/network.model.ts","../src/network/network.schema.ts","../src/settings.model.ts","../src/activity/activity-level.model.ts","../src/activity/activity-status.model.ts","../src/activity/activity-type.model.ts","../src/account.model.ts","../src/bns.model.ts","../src/swap/swap.model.ts"],"sourcesContent":["import { InscriptionMimeType } from '../inscription-mime-type.model';\n\nexport const CryptoAssetChains = {\n bitcoin: 'bitcoin',\n stacks: 'stacks',\n} as const;\nexport const CryptoAssetCategories = {\n fungible: 'fungible',\n nft: 'nft',\n} as const;\nexport const FungibleCryptoAssetProtocols = {\n nativeBtc: 'nativeBtc',\n nativeStx: 'nativeStx',\n sip10: 'sip10',\n brc20: 'brc20',\n src20: 'src20',\n stx20: 'stx20',\n rune: 'rune',\n} as const;\nexport const NonFungibleCryptoAssetProtocols = {\n stamp: 'stamp',\n sip9: 'sip9',\n inscription: 'inscription',\n} as const;\nexport const CryptoAssetProtocols = {\n ...FungibleCryptoAssetProtocols,\n ...NonFungibleCryptoAssetProtocols,\n} as const;\n\nexport type CryptoAssetChain = keyof typeof CryptoAssetChains;\nexport type CryptoAssetCategory = keyof typeof CryptoAssetCategories;\nexport type FungibleCryptoAssetProtocol = keyof typeof FungibleCryptoAssetProtocols;\nexport type NonFungibleCryptoAssetProtocol = keyof typeof NonFungibleCryptoAssetProtocols;\nexport type CryptoAssetProtocol = FungibleCryptoAssetProtocol | NonFungibleCryptoAssetProtocol;\n\nexport interface BaseCryptoAsset {\n readonly chain: CryptoAssetChain;\n readonly category: CryptoAssetCategory;\n readonly protocol: CryptoAssetProtocol;\n}\n\n// Fungible asset types\ninterface BaseFungibleCryptoAsset extends BaseCryptoAsset {\n readonly category: 'fungible';\n readonly protocol: FungibleCryptoAssetProtocol;\n readonly symbol: string;\n readonly decimals: number;\n readonly hasMemo: boolean;\n}\nexport interface BtcAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'nativeBtc';\n readonly symbol: 'BTC';\n}\nexport interface StxAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'nativeStx';\n readonly symbol: 'STX';\n}\nexport interface Brc20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'brc20';\n readonly symbol: string;\n}\nexport interface Src20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'src20';\n readonly id: string;\n readonly symbol: string;\n readonly deploy_tx: string;\n readonly deploy_img: string;\n}\nexport interface RuneAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'rune';\n readonly spacedRuneName: string;\n readonly runeName: string;\n readonly symbol: string;\n}\nexport interface Sip10Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'sip10';\n readonly name: string;\n readonly canTransfer: boolean;\n readonly assetId: string;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n readonly symbol: string;\n}\nexport interface Stx20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'stx20';\n readonly symbol: string;\n}\nexport type NativeCryptoAsset = BtcAsset | StxAsset;\nexport type FungibleCryptoAsset =\n | NativeCryptoAsset\n | Sip10Asset\n | Brc20Asset\n | Src20Asset\n | Stx20Asset\n | RuneAsset;\n\n// NFT asset types\ninterface BaseNonFungibleCryptoAsset extends BaseCryptoAsset {\n readonly category: 'nft';\n readonly protocol: NonFungibleCryptoAssetProtocol;\n}\nexport interface InscriptionAsset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'inscription';\n readonly id: string;\n readonly mimeType: InscriptionMimeType;\n readonly number: number;\n readonly address: string;\n readonly title: string;\n readonly txid: string;\n readonly output: string;\n readonly offset: string;\n readonly preview: string;\n readonly src: string;\n readonly value: string;\n readonly genesisBlockHash: string;\n readonly genesisTimestamp: number;\n readonly genesisBlockHeight: number;\n}\nexport interface StampAsset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'stamp';\n readonly stamp: number;\n readonly stampUrl: string;\n}\n\nexport type Sip9ContentType =\n // Images\n | 'image/jpeg'\n | 'image/jpg'\n | 'image/png'\n | 'image/gif'\n | 'image/webp'\n | 'image/svg+xml'\n | 'image/bmp'\n | 'image/tiff'\n | 'image/avif'\n\n // Videos\n | 'video/mp4'\n | 'video/webm'\n | 'video/mov'\n | 'video/quicktime'\n | 'video/avi'\n | 'video/x-msvideo'\n | 'video/ogg'\n\n // Audio\n | 'audio/mpeg'\n | 'audio/mp3'\n | 'audio/wav'\n | 'audio/x-wav'\n | 'audio/ogg'\n | 'audio/aac'\n | 'audio/flac'\n | 'audio/webm'\n\n // 3D Models\n | 'model/gltf+json'\n | 'model/gltf-binary'\n | 'application/octet-stream' // GLB files sometimes use this\n\n // Documents/Text\n | 'text/plain'\n | 'text/html'\n | 'text/markdown'\n | 'application/pdf'\n | 'application/json'\n\n // Interactive/Web\n | 'text/javascript'\n | 'application/javascript'\n\n // Archives\n | 'application/zip'\n\n // Unknown/Fallback\n | 'unknown';\n\nexport type SupportedSip9ContentType =\n | Extract<\n Sip9ContentType,\n | 'image/jpeg'\n | 'image/png'\n | 'image/gif'\n | 'image/webp'\n | 'image/svg+xml'\n | 'image/bmp'\n | 'image/tiff'\n | 'image/avif'\n | 'video/mp4'\n | 'audio/mpeg'\n | 'audio/mp3'\n | 'audio/wav'\n | 'audio/ogg'\n | 'audio/aac'\n | 'audio/flac'\n | 'audio/webm'\n | 'text/plain'\n | 'application/octet-stream'\n | 'model/gltf+json'\n | 'model/gltf-binary'\n >\n | '';\nexport interface Sip9Asset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'sip9';\n readonly assetId: string;\n readonly contractId: string;\n readonly tokenId: number;\n readonly name: string;\n readonly description: string;\n readonly cachedImage: string;\n readonly cachedImageThumbnail: string;\n readonly contentType: SupportedSip9ContentType;\n readonly collection: {\n id: string;\n name: string;\n isVerified: boolean;\n locationUrl: string;\n totalItems: number;\n floorPriceAmount: {\n amount: number;\n unit: string;\n };\n };\n}\nexport type NonFungibleCryptoAsset = InscriptionAsset | StampAsset | Sip9Asset;\n\nexport type CryptoAsset = FungibleCryptoAsset | NonFungibleCryptoAsset;\n\nexport interface FungibleAssetId {\n protocol: FungibleCryptoAssetProtocol;\n id: string;\n}\n","import {\n Brc20Asset,\n BtcAsset,\n CryptoAsset,\n FungibleCryptoAsset,\n InscriptionAsset,\n NativeCryptoAsset,\n NonFungibleCryptoAsset,\n RuneAsset,\n Sip9Asset,\n Sip10Asset,\n Src20Asset,\n StampAsset,\n Stx20Asset,\n StxAsset,\n} from './asset.model';\n\nexport function isFungibleAsset(asset: CryptoAsset): asset is FungibleCryptoAsset {\n return asset.category === 'fungible';\n}\n\nexport function isNonFungibleAsset(asset: CryptoAsset): asset is NonFungibleCryptoAsset {\n return asset.category === 'nft';\n}\n\nexport function isBtcAsset(asset: CryptoAsset): asset is BtcAsset {\n return asset.protocol === 'nativeBtc';\n}\n\nexport function isStxAsset(asset: CryptoAsset): asset is StxAsset {\n return asset.protocol === 'nativeStx';\n}\n\nexport function isNativeAsset(asset: CryptoAsset): asset is NativeCryptoAsset {\n return isBtcAsset(asset) || isStxAsset(asset);\n}\n\nexport function isSip10Asset(asset: CryptoAsset): asset is Sip10Asset {\n return asset.protocol === 'sip10';\n}\n\nexport function isBrc20Asset(asset: CryptoAsset): asset is Brc20Asset {\n return asset.protocol === 'brc20';\n}\n\nexport function isSrc20Asset(asset: CryptoAsset): asset is Src20Asset {\n return asset.protocol === 'src20';\n}\n\nexport function isStx20Asset(asset: CryptoAsset): asset is Stx20Asset {\n return asset.protocol === 'stx20';\n}\n\nexport function isRuneAsset(asset: CryptoAsset): asset is RuneAsset {\n return asset.protocol === 'rune';\n}\n\nexport function isInscriptionAsset(asset: CryptoAsset): asset is InscriptionAsset {\n return asset.protocol === 'inscription';\n}\n\nexport function isStampAsset(asset: CryptoAsset): asset is StampAsset {\n return asset.protocol === 'stamp';\n}\n\nexport function isSip9Asset(asset: CryptoAsset): asset is Sip9Asset {\n return asset.protocol === 'sip9';\n}\n","import { InscriptionAsset } from './assets/asset.model';\n\n/**\n * Inscriptions contain arbitrary data. When retrieving an inscription, it should be\n * classified into one of the types below, indicating that the app can handle it\n * appropriately and securely. Inscriptions of types not ready to be handled by the\n * app should be classified as \"other\".\n */\nexport const inscriptionMimeTypes = [\n 'audio',\n 'gltf',\n 'html',\n 'image',\n 'svg',\n 'text',\n 'video',\n 'other',\n] as const;\n\nexport type InscriptionMimeType = (typeof inscriptionMimeTypes)[number];\n\n/* Deprecated: Made obsolete by InscriptionAsset; Will be removed */\nexport interface Inscription extends InscriptionAsset {\n preview: string;\n src: string;\n title: string;\n output: string;\n txid: string;\n offset: string;\n address: string;\n genesisBlockHash: string;\n genesisTimestamp: number;\n genesisBlockHeight: number;\n value: string;\n}\n","import type BigNumber from 'bignumber.js';\n\nexport interface AverageBitcoinFeeRates {\n fastestFee: BigNumber;\n halfHourFee: BigNumber;\n hourFee: BigNumber;\n}\n\nexport const btcTxTimeMap: Record<keyof AverageBitcoinFeeRates, string> = {\n fastestFee: '~10 – 20min',\n halfHourFee: '~30 min',\n hourFee: '~1 hour+',\n};\n\nexport enum BtcFeeType {\n High = 'High',\n Standard = 'Standard',\n Low = 'Low',\n}\n","import { Blockchain } from '../types';\nimport { StacksFeeEstimate } from './stacks-fees.model';\n\nexport enum FeeTypes {\n Low,\n Middle,\n High,\n Custom,\n Unknown,\n}\n\nexport enum FeeCalculationTypes {\n Api = 'api',\n Default = 'default',\n DefaultSimulated = 'default-simulated',\n FeesCapped = 'fees-capped',\n TokenTransferSpecific = 'token-transfer-specific',\n}\n\nexport interface Fees {\n blockchain: Blockchain;\n estimates: StacksFeeEstimate[];\n calculation: FeeCalculationTypes;\n}\n","import type { Currency, QuoteCurrency } from './currencies.model';\nimport type { Money } from './money.model';\n\ninterface MarketPair {\n readonly base: Currency;\n readonly quote: QuoteCurrency;\n}\n\nexport function createMarketPair(base: Currency, quote: QuoteCurrency): MarketPair {\n return Object.freeze({ base, quote });\n}\n\nexport function formatMarketPair({ base, quote }: MarketPair) {\n return `${base}/${quote}`;\n}\n\nexport interface MarketData {\n readonly pair: MarketPair;\n readonly price: Money;\n}\n\nexport function createMarketData(pair: MarketPair, price: Money): MarketData {\n if (pair.quote !== price.symbol)\n throw new Error('Cannot create market data when price does not match quote');\n return Object.freeze({ pair, price });\n}\n","import { z } from 'zod';\n\nimport { Blockchain } from '../types';\nimport { networkConfigurationSchema } from './network.schema';\n\nexport const HIRO_API_BASE_URL_MAINNET = 'https://api.hiro.so';\nexport const HIRO_API_BASE_URL_TESTNET = 'https://api.testnet.hiro.so';\nexport const HIRO_API_BASE_URL_NAKAMOTO_TESTNET = 'https://api.nakamoto.testnet.hiro.so';\n\nexport const HIRO_API_BASE_URL_MAINNET_EXTENDED = 'https://api.hiro.so/extended/v1';\nexport const HIRO_API_BASE_URL_TESTNET_EXTENDED = 'https://api.testnet.hiro.so/extended';\n\nexport const BITCOIN_API_BASE_URL_MAINNET = 'https://leather.mempool.space/api';\nexport const BITCOIN_API_BASE_URL_TESTNET3 = 'https://leather.mempool.space/testnet/api';\nexport const BITCOIN_API_BASE_URL_TESTNET4 = 'https://leather.mempool.space/testnet4/api';\nexport const BITCOIN_API_BASE_URL_SIGNET = 'https://mempool.space/signet/api';\n\nexport const BESTINSLOT_API_BASE_URL_MAINNET = 'https://leatherapi.bestinslot.xyz/v3';\nexport const BESTINSLOT_API_BASE_URL_TESTNET = 'https://leatherapi_testnet.bestinslot.xyz/v3';\n\nexport const STX20_API_BASE_URL_MAINNET = 'https://api.stx20.com/api/v1';\n\nexport const BNS_V2_API_BASE_URL = 'https://api.bnsv2.com';\n\n// Copied from @stacks/transactions to avoid dependencies\nexport enum ChainId {\n Testnet = 2147483648,\n Mainnet = 1,\n}\n\nexport enum WalletDefaultNetworkConfigurationIds {\n mainnet = 'mainnet',\n testnet = 'testnet',\n testnet4 = 'testnet4',\n signet = 'signet',\n sbtcTestnet = 'sbtcTestnet',\n sbtcDevenv = 'sbtcDevenv',\n devnet = 'devnet',\n}\n\nexport type DefaultNetworkConfigurations = keyof typeof WalletDefaultNetworkConfigurationIds;\n\nexport const supportedBlockchains = ['stacks', 'bitcoin'] as const;\n\nexport type SupportedBlockchains = (typeof supportedBlockchains)[number];\n\nexport const networkModes = ['mainnet', 'testnet'] as const;\nexport const testnetModes = ['testnet', 'regtest', 'signet'] as const;\n\nexport const bitcoinNetworks = ['mainnet', 'testnet3', 'testnet4', 'regtest', 'signet'] as const;\nexport type BitcoinNetwork = (typeof bitcoinNetworks)[number];\n\nexport type NetworkModes = (typeof networkModes)[number];\ntype BitcoinTestnetModes = (typeof testnetModes)[number];\n\nexport function bitcoinNetworkToNetworkMode(network: BitcoinNetwork): BitcoinNetworkModes {\n switch (network) {\n case 'mainnet':\n return 'mainnet';\n case 'testnet3':\n return 'testnet';\n case 'testnet4':\n return 'testnet';\n case 'regtest':\n return 'regtest';\n case 'signet':\n return 'signet';\n default:\n // TODO: Needs exhaustive check. Cannot import 'assertUnreachable' since 'utils' package depends on 'models'.\n // Ideally this function should live in utils, but it's currently widely used in the extension.\n throw new Error(`Unhandled case: ${network}`);\n }\n}\n\nexport type BitcoinNetworkModes = NetworkModes | BitcoinTestnetModes;\n\ninterface BaseChainConfig {\n blockchain: Blockchain;\n}\n\nexport interface BitcoinChainConfig extends BaseChainConfig {\n blockchain: 'bitcoin';\n bitcoinUrl: string;\n bitcoinNetwork: BitcoinNetwork;\n mode: BitcoinNetworkModes;\n}\n\nexport interface StacksChainConfig extends BaseChainConfig {\n blockchain: 'stacks';\n url: string;\n /** The chainId of the network (or parent network if this is a subnet) */\n chainId: ChainId;\n /** An additional chainId for subnets. Indicated a subnet if defined and is mainly used for signing. */\n subnetChainId?: ChainId;\n}\n\nexport type NetworkConfiguration = z.infer<typeof networkConfigurationSchema>;\n\nconst networkMainnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.mainnet,\n name: 'Mainnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Mainnet,\n url: HIRO_API_BASE_URL_MAINNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'mainnet',\n mode: 'mainnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_MAINNET,\n },\n },\n};\n\nconst networkTestnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.testnet,\n name: 'Testnet3',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'testnet3',\n mode: 'testnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_TESTNET3,\n },\n },\n};\n\nconst networkTestnet4: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.testnet4,\n name: 'Testnet4',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'testnet4',\n mode: 'testnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_TESTNET4,\n },\n },\n};\n\nconst networkSignet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.signet,\n name: 'Signet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'signet',\n mode: 'signet',\n bitcoinUrl: BITCOIN_API_BASE_URL_SIGNET,\n },\n },\n};\n\nconst networkSbtcTestnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.sbtcTestnet,\n name: 'sBTC Testnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'https://beta.sbtc-mempool.tech/api/proxy',\n },\n },\n};\n\nconst networkSbtcDevenv: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.sbtcDevenv,\n name: 'sBTC Devenv',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: 'http://localhost:3999',\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'http://localhost:3000/api/proxy',\n },\n },\n};\n\nconst networkDevnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.devnet,\n name: 'Devnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: 'http://localhost:3999',\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'http://localhost:18443',\n },\n },\n};\n\nexport const defaultCurrentNetwork: NetworkConfiguration = networkMainnet;\n\nexport const defaultNetworksKeyedById: Record<\n WalletDefaultNetworkConfigurationIds,\n NetworkConfiguration\n> = {\n [WalletDefaultNetworkConfigurationIds.mainnet]: networkMainnet,\n [WalletDefaultNetworkConfigurationIds.testnet4]: networkTestnet4,\n [WalletDefaultNetworkConfigurationIds.testnet]: networkTestnet,\n [WalletDefaultNetworkConfigurationIds.signet]: networkSignet,\n [WalletDefaultNetworkConfigurationIds.sbtcTestnet]: networkSbtcTestnet,\n [WalletDefaultNetworkConfigurationIds.sbtcDevenv]: networkSbtcDevenv,\n [WalletDefaultNetworkConfigurationIds.devnet]: networkDevnet,\n};\n","import { z } from 'zod';\n\nimport { bitcoinNetworks, networkModes, testnetModes } from './network.model';\n\nexport const bitcoinNetworkModesSchema = z.enum([...networkModes, ...testnetModes]);\n\nexport const bitcoinNetworkSchema = z.enum([...bitcoinNetworks]);\n\nexport const networkConfigurationSchema = z.object({\n name: z.string(),\n id: z.string(),\n chain: z.object({\n bitcoin: z.object({\n blockchain: z.literal('bitcoin'),\n bitcoinUrl: z.string(),\n bitcoinNetwork: bitcoinNetworkSchema,\n mode: bitcoinNetworkModesSchema,\n }),\n stacks: z.object({\n blockchain: z.literal('stacks'),\n url: z.string(),\n chainId: z.number(),\n subnetChainId: z.number().optional(),\n }),\n }),\n});\n","import { z } from 'zod';\n\nimport { Blockchain } from './types';\n\nexport type AccountDisplayPreference = 'native-segwit' | 'taproot' | 'bns' | 'stacks';\nexport interface AccountDisplayPreferenceInfo {\n type: AccountDisplayPreference;\n blockchain: Blockchain;\n name: string;\n}\n\nexport type AnalyticsPreference = 'consent-given' | 'rejects-tracking';\n\nexport const emailAddressSchema = z.email({ error: 'Invalid email address' });\nexport type EmailAddress = z.infer<typeof emailAddressSchema>;\n","export const ActivityLevels = {\n account: 'account',\n app: 'app',\n} as const;\nexport type ActivityLevel = keyof typeof ActivityLevels;\n","export const OnChainActivityStatuses = {\n pending: 'pending',\n success: 'success',\n failed: 'failed',\n} as const;\nexport type OnChainActivityStatus = keyof typeof OnChainActivityStatuses;\n","export const OnChainActivityTypes = {\n deploySmartContract: 'deploySmartContract',\n executeSmartContract: 'executeSmartContract',\n lockAsset: 'lockAsset',\n sendAsset: 'sendAsset',\n receiveAsset: 'receiveAsset',\n swapAssets: 'swapAssets',\n} as const;\nexport type OnChainActivityType = keyof typeof OnChainActivityTypes;\n\nexport const WalletActivityTypes = {\n connectApp: 'connectApp',\n signMessage: 'signMessage',\n} as const;\nexport type WalletActivityType = keyof typeof WalletActivityTypes;\n\nexport const GeneralActivityTypes = {\n walletAdded: 'walletAdded',\n receiveAnnouncement: 'receiveAnnouncement',\n featureWaitlistNotification: 'featureWaitlistNotification',\n} as const;\nexport type GeneralActivityType = keyof typeof GeneralActivityTypes;\n\nexport type ActivityType = OnChainActivityType | WalletActivityType | GeneralActivityType;\n","import { z } from 'zod';\n\nexport const walletIdSchema = z.object({\n fingerprint: z.string(),\n});\n\nexport const accountIdSchema = walletIdSchema.and(z.object({ accountIndex: z.number() }));\n\nexport const bitcoinAddressInfoSchema = z.object({\n taprootDescriptor: z.string(),\n nativeSegwitDescriptor: z.string(),\n});\n\nexport const stacksAddressInfoSchema = z.object({\n stxAddress: z.string(),\n});\n\nexport const accountAddressesSchema = z.object({\n id: accountIdSchema,\n bitcoin: bitcoinAddressInfoSchema.optional(),\n stacks: stacksAddressInfoSchema.optional(),\n});\n\nexport type WalletId = z.infer<typeof walletIdSchema>;\nexport type AccountId = z.infer<typeof accountIdSchema>;\nexport type BitcoinAddressInfo = z.infer<typeof bitcoinAddressInfoSchema>;\nexport type StacksAddressInfo = z.infer<typeof stacksAddressInfoSchema>;\nexport type AccountAddresses = z.infer<typeof accountAddressesSchema>;\n","export const bnsContractAddress = {\n mainnet: 'SP2QEZ06AGJ3RKJPBV14SY1V5BBFNAW33D96YPGZF',\n testnet: 'ST2QEZ06AGJ3RKJPBV14SY1V5BBFNAW33D9SZJQ0M',\n};\n\nexport const bnsContractName = 'BNS-V2';\n\nexport interface BnsName {\n owner: string;\n name: string;\n namespace: string;\n fullName: string;\n}\n\nexport interface BnsProfile {\n bnsName: BnsName;\n profileData: BnsProfileData;\n}\n\nexport interface BnsProfileData {\n name?: string;\n bio?: string;\n website?: string;\n pfpUrl?: string;\n location?: string;\n addresses?: BnsProfileDataAddresses;\n}\n\nexport interface BnsProfileDataAddresses {\n bitcoinPayment?: string;\n bitcoinOrdinal?: string;\n solana?: string;\n ethereum?: string;\n}\n","import { CryptoAssetId } from '../assets/asset-id.model';\nimport { FungibleCryptoAsset } from '../assets/asset.model';\nimport { Money } from '../money.model';\n\nexport interface SwapAsset {\n asset: FungibleCryptoAsset;\n providerAssets: SwapProviderAsset[];\n}\n\nexport const swapProviderIds = ['bitflow-sdk', 'sbtc-bridge', 'alex-sdk', 'velar-sdk'] as const;\nexport type SwapProviderId = (typeof swapProviderIds)[number];\n\nexport interface SwapProvider {\n id: SwapProviderId;\n isAggregator: boolean;\n}\n\nexport interface SwapProviderAsset {\n providerId: SwapProviderId;\n providerAssetId: string;\n assetId: CryptoAssetId;\n}\n\nexport interface SwapQuote {\n executionType: SwapExecutionType;\n providerId: SwapProviderId;\n providerQuoteData: unknown;\n baseAmount: number;\n targetAmount: number;\n quote: Money;\n dexPath: SwapDex[];\n assetPath: FungibleCryptoAsset[];\n}\n\nexport interface SwapDex {\n name: string;\n url: string;\n logo: string;\n description: string;\n}\n\nexport const swapExecutionTypes = ['stacks-contract-call', 'sbtc-bridge-transfer'] as const;\nexport type SwapExecutionType = (typeof swapExecutionTypes)[number];\n\nexport interface BaseSwapExecutionData {\n executionType: SwapExecutionType;\n providerId: SwapProviderId;\n}\nexport interface StacksContractCallSwapExecutionData extends BaseSwapExecutionData {\n executionType: 'stacks-contract-call';\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: unknown[];\n postConditions: unknown[];\n postConditionMode?: unknown;\n}\nexport interface SbtcBridgeTransferSwapExecutionData extends BaseSwapExecutionData {\n executionType: 'sbtc-bridge-transfer';\n}\nexport type SwapExecutionData =\n | StacksContractCallSwapExecutionData\n | SbtcBridgeTransferSwapExecutionData;\n"],"mappings":";AAEO,IAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,QAAQ;AACV;AACO,IAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,EACV,KAAK;AACP;AACO,IAAM,+BAA+B;AAAA,EAC1C,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AACO,IAAM,kCAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AACf;AACO,IAAM,uBAAuB;AAAA,EAClC,GAAG;AAAA,EACH,GAAG;AACL;;;ACVO,SAAS,gBAAgB,OAAkD;AAChF,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,mBAAmB,OAAqD;AACtF,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,WAAW,OAAuC;AAChE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,WAAW,OAAuC;AAChE,S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EjF,IAAM,2BAA2BA,GAAE,OAAO;AAAA,EAC/C,mBAAmBA,GAAE,OAAO;AAAA,EAC5B,wBAAwBA,GAAE,OAAO;AACnC,CAAC;AAEM,IAAM,0BAA0BA,GAAE,OAAO;AAAA,EAC9C,YAAYA,GAAE,OAAO;AACvB,CAAC;AAEM,IAAM,yBAAyBA,GAAE,OAAO;AAAA,EAC7C,IAAI;AAAA,EACJ,SAAS,yBAAyB,SAAS;AAAA,EAC3C,QAAQ,wBAAwB,SAAS;AAC3C,CAAC;;;ACrBM,IAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,SAAS;AACX;AAEO,IAAM,kBAAkB;;;ACIxB,IAAM,kBAAkB,CAAC,eAAe,eAAe,YAAY,WAAW;AAgC9E,IAAM,qBAAqB,CAAC,wBAAwB,sBAAsB;","names":["BtcFeeType","FeeTypes","FeeCalculationTypes","ChainId","WalletDefaultNetworkConfigurationIds","z","z"]}
1
+ {"version":3,"sources":["../src/assets/asset.model.ts","../src/assets/asset-type-guards.ts","../src/assets/sip9-asset.model.ts","../src/inscription-mime-type.model.ts","../src/fees/bitcoin-fees.model.ts","../src/fees/fees.model.ts","../src/market.model.ts","../src/network/network.model.ts","../src/network/network.schema.ts","../src/settings.model.ts","../src/activity/activity-level.model.ts","../src/activity/activity-status.model.ts","../src/activity/activity-type.model.ts","../src/account.model.ts","../src/bns.model.ts","../src/swap/swap.model.ts"],"sourcesContent":["import { InscriptionMimeType } from '../inscription-mime-type.model';\nimport { Sip9Asset } from './sip9-asset.model';\n\nexport const CryptoAssetChains = {\n bitcoin: 'bitcoin',\n stacks: 'stacks',\n} as const;\nexport const CryptoAssetCategories = {\n fungible: 'fungible',\n nft: 'nft',\n} as const;\nexport const FungibleCryptoAssetProtocols = {\n nativeBtc: 'nativeBtc',\n nativeStx: 'nativeStx',\n sip10: 'sip10',\n brc20: 'brc20',\n src20: 'src20',\n stx20: 'stx20',\n rune: 'rune',\n} as const;\nexport const NonFungibleCryptoAssetProtocols = {\n stamp: 'stamp',\n sip9: 'sip9',\n inscription: 'inscription',\n} as const;\nexport const CryptoAssetProtocols = {\n ...FungibleCryptoAssetProtocols,\n ...NonFungibleCryptoAssetProtocols,\n} as const;\n\nexport type CryptoAssetChain = keyof typeof CryptoAssetChains;\nexport type CryptoAssetCategory = keyof typeof CryptoAssetCategories;\nexport type FungibleCryptoAssetProtocol = keyof typeof FungibleCryptoAssetProtocols;\nexport type NonFungibleCryptoAssetProtocol = keyof typeof NonFungibleCryptoAssetProtocols;\nexport type CryptoAssetProtocol = FungibleCryptoAssetProtocol | NonFungibleCryptoAssetProtocol;\n\nexport interface BaseCryptoAsset {\n readonly chain: CryptoAssetChain;\n readonly category: CryptoAssetCategory;\n readonly protocol: CryptoAssetProtocol;\n}\n\n// Fungible asset types\ninterface BaseFungibleCryptoAsset extends BaseCryptoAsset {\n readonly category: 'fungible';\n readonly protocol: FungibleCryptoAssetProtocol;\n readonly symbol: string;\n readonly decimals: number;\n readonly hasMemo: boolean;\n}\nexport interface BtcAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'nativeBtc';\n readonly symbol: 'BTC';\n}\nexport interface StxAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'nativeStx';\n readonly symbol: 'STX';\n}\nexport interface Brc20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'brc20';\n readonly symbol: string;\n}\nexport interface Src20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'src20';\n readonly id: string;\n readonly symbol: string;\n readonly deploy_tx: string;\n readonly deploy_img: string;\n}\nexport interface RuneAsset extends BaseFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'rune';\n readonly spacedRuneName: string;\n readonly runeName: string;\n readonly symbol: string;\n}\nexport interface Sip10Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'sip10';\n readonly name: string;\n readonly canTransfer: boolean;\n readonly assetId: string;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n readonly symbol: string;\n}\nexport interface Stx20Asset extends BaseFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'stx20';\n readonly symbol: string;\n}\nexport type NativeCryptoAsset = BtcAsset | StxAsset;\nexport type FungibleCryptoAsset =\n | NativeCryptoAsset\n | Sip10Asset\n | Brc20Asset\n | Src20Asset\n | Stx20Asset\n | RuneAsset;\n\n// NFT asset types\nexport interface BaseNonFungibleCryptoAsset extends BaseCryptoAsset {\n readonly category: 'nft';\n readonly protocol: NonFungibleCryptoAssetProtocol;\n}\nexport interface InscriptionAsset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'inscription';\n readonly id: string;\n readonly mimeType: InscriptionMimeType;\n readonly number: number;\n readonly address: string;\n readonly title: string;\n readonly txid: string;\n readonly output: string;\n readonly offset: string;\n readonly preview: string;\n readonly src: string;\n readonly value: string;\n readonly genesisBlockHash: string;\n readonly genesisTimestamp: number;\n readonly genesisBlockHeight: number;\n}\nexport interface StampAsset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'bitcoin';\n readonly protocol: 'stamp';\n readonly stamp: number;\n readonly stampUrl: string;\n}\n\nexport type NonFungibleCryptoAsset = InscriptionAsset | StampAsset | Sip9Asset;\n\nexport type CryptoAsset = FungibleCryptoAsset | NonFungibleCryptoAsset;\n\nexport interface FungibleAssetId {\n protocol: FungibleCryptoAssetProtocol;\n id: string;\n}\n","import {\n Brc20Asset,\n BtcAsset,\n CryptoAsset,\n FungibleCryptoAsset,\n InscriptionAsset,\n NativeCryptoAsset,\n NonFungibleCryptoAsset,\n RuneAsset,\n Sip10Asset,\n Src20Asset,\n StampAsset,\n Stx20Asset,\n StxAsset,\n} from './asset.model';\nimport { Sip9Asset } from './sip9-asset.model';\n\nexport function isFungibleAsset(asset: CryptoAsset): asset is FungibleCryptoAsset {\n return asset.category === 'fungible';\n}\n\nexport function isNonFungibleAsset(asset: CryptoAsset): asset is NonFungibleCryptoAsset {\n return asset.category === 'nft';\n}\n\nexport function isBtcAsset(asset: CryptoAsset): asset is BtcAsset {\n return asset.protocol === 'nativeBtc';\n}\n\nexport function isStxAsset(asset: CryptoAsset): asset is StxAsset {\n return asset.protocol === 'nativeStx';\n}\n\nexport function isNativeAsset(asset: CryptoAsset): asset is NativeCryptoAsset {\n return isBtcAsset(asset) || isStxAsset(asset);\n}\n\nexport function isSip10Asset(asset: CryptoAsset): asset is Sip10Asset {\n return asset.protocol === 'sip10';\n}\n\nexport function isSwappableAsset(asset: CryptoAsset): asset is NativeCryptoAsset | Sip10Asset {\n return isNativeAsset(asset) || isSip10Asset(asset);\n}\n\nexport function isBrc20Asset(asset: CryptoAsset): asset is Brc20Asset {\n return asset.protocol === 'brc20';\n}\n\nexport function isSrc20Asset(asset: CryptoAsset): asset is Src20Asset {\n return asset.protocol === 'src20';\n}\n\nexport function isStx20Asset(asset: CryptoAsset): asset is Stx20Asset {\n return asset.protocol === 'stx20';\n}\n\nexport function isRuneAsset(asset: CryptoAsset): asset is RuneAsset {\n return asset.protocol === 'rune';\n}\n\nexport function isInscriptionAsset(asset: CryptoAsset): asset is InscriptionAsset {\n return asset.protocol === 'inscription';\n}\n\nexport function isStampAsset(asset: CryptoAsset): asset is StampAsset {\n return asset.protocol === 'stamp';\n}\n\nexport function isSip9Asset(asset: CryptoAsset): asset is Sip9Asset {\n return asset.protocol === 'sip9';\n}\n","import { BaseNonFungibleCryptoAsset } from './asset.model';\n\nexport const sip9ContentTypes = [\n 'image/jpeg',\n 'image/jpg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n 'image/svg+xml',\n 'image/bmp',\n 'image/tiff',\n 'image/avif',\n 'video/mp4',\n 'video/webm',\n 'video/mov',\n 'video/quicktime',\n 'video/avi',\n 'video/x-msvideo',\n 'video/ogg',\n 'audio/mpeg',\n 'audio/mp3',\n 'audio/wav',\n 'audio/x-wav',\n 'audio/ogg',\n 'audio/aac',\n 'audio/flac',\n 'audio/webm',\n 'model/gltf+json',\n 'model/gltf-binary',\n 'application/octet-stream',\n 'text/plain',\n 'text/html',\n 'text/markdown',\n 'application/pdf',\n 'application/json',\n 'text/javascript',\n 'application/javascript',\n 'application/zip',\n 'unknown',\n '',\n] as const;\n\nexport type Sip9ContentType = (typeof sip9ContentTypes)[number];\n\nexport interface Sip9Collection {\n name: string;\n collectionExplorerUrl: string;\n totalItems?: number;\n}\n\nexport interface Sip9AssetContent {\n contentUrl: string;\n contentType: Sip9ContentType;\n}\n\nexport interface Sip9Attribute {\n traitType: string;\n value: any;\n rarityPercent?: number;\n}\n\nexport interface Sip9Asset extends BaseNonFungibleCryptoAsset {\n readonly chain: 'stacks';\n readonly protocol: 'sip9';\n readonly assetId: string;\n readonly contractId: string;\n readonly tokenId: number;\n readonly name: string;\n readonly description: string;\n readonly content: Sip9AssetContent;\n readonly attributes?: Sip9Attribute[];\n readonly collection?: Sip9Collection;\n}\n","import { InscriptionAsset } from './assets/asset.model';\n\n/**\n * Inscriptions contain arbitrary data. When retrieving an inscription, it should be\n * classified into one of the types below, indicating that the app can handle it\n * appropriately and securely. Inscriptions of types not ready to be handled by the\n * app should be classified as \"other\".\n */\nexport const inscriptionMimeTypes = [\n 'audio',\n 'gltf',\n 'html',\n 'image',\n 'svg',\n 'text',\n 'video',\n 'other',\n] as const;\n\nexport type InscriptionMimeType = (typeof inscriptionMimeTypes)[number];\n\n/* Deprecated: Made obsolete by InscriptionAsset; Will be removed */\nexport interface Inscription extends InscriptionAsset {\n preview: string;\n src: string;\n title: string;\n output: string;\n txid: string;\n offset: string;\n address: string;\n genesisBlockHash: string;\n genesisTimestamp: number;\n genesisBlockHeight: number;\n value: string;\n}\n","import type BigNumber from 'bignumber.js';\n\nexport interface AverageBitcoinFeeRates {\n fastestFee: BigNumber;\n halfHourFee: BigNumber;\n hourFee: BigNumber;\n}\n\nexport const btcTxTimeMap: Record<keyof AverageBitcoinFeeRates, string> = {\n fastestFee: '~10 – 20min',\n halfHourFee: '~30 min',\n hourFee: '~1 hour+',\n};\n\nexport enum BtcFeeType {\n High = 'High',\n Standard = 'Standard',\n Low = 'Low',\n}\n","import { Blockchain } from '../types';\nimport { StacksFeeEstimate } from './stacks-fees.model';\n\nexport enum FeeTypes {\n Low,\n Middle,\n High,\n Custom,\n Unknown,\n}\n\nexport enum FeeCalculationTypes {\n Api = 'api',\n Default = 'default',\n DefaultSimulated = 'default-simulated',\n FeesCapped = 'fees-capped',\n TokenTransferSpecific = 'token-transfer-specific',\n}\n\nexport interface Fees {\n blockchain: Blockchain;\n estimates: StacksFeeEstimate[];\n calculation: FeeCalculationTypes;\n}\n","import type { Currency, QuoteCurrency } from './currencies.model';\nimport type { Money } from './money.model';\n\ninterface MarketPair {\n readonly base: Currency;\n readonly quote: QuoteCurrency;\n}\n\nexport function createMarketPair(base: Currency, quote: QuoteCurrency): MarketPair {\n return Object.freeze({ base, quote });\n}\n\nexport function formatMarketPair({ base, quote }: MarketPair) {\n return `${base}/${quote}`;\n}\n\nexport interface MarketData {\n readonly pair: MarketPair;\n readonly price: Money;\n}\n\nexport function createMarketData(pair: MarketPair, price: Money): MarketData {\n if (pair.quote !== price.symbol)\n throw new Error('Cannot create market data when price does not match quote');\n return Object.freeze({ pair, price });\n}\n","import { z } from 'zod';\n\nimport { Blockchain } from '../types';\nimport { networkConfigurationSchema } from './network.schema';\n\nexport const HIRO_API_BASE_URL_MAINNET = 'https://api.hiro.so';\nexport const HIRO_API_BASE_URL_TESTNET = 'https://api.testnet.hiro.so';\nexport const HIRO_API_BASE_URL_NAKAMOTO_TESTNET = 'https://api.nakamoto.testnet.hiro.so';\n\nexport const HIRO_API_BASE_URL_MAINNET_EXTENDED = 'https://api.hiro.so/extended/v1';\nexport const HIRO_API_BASE_URL_TESTNET_EXTENDED = 'https://api.testnet.hiro.so/extended';\n\nexport const BITCOIN_API_BASE_URL_MAINNET = 'https://leather.mempool.space/api';\nexport const BITCOIN_API_BASE_URL_TESTNET3 = 'https://leather.mempool.space/testnet/api';\nexport const BITCOIN_API_BASE_URL_TESTNET4 = 'https://leather.mempool.space/testnet4/api';\nexport const BITCOIN_API_BASE_URL_SIGNET = 'https://mempool.space/signet/api';\n\nexport const BESTINSLOT_API_BASE_URL_MAINNET = 'https://leatherapi.bestinslot.xyz/v3';\nexport const BESTINSLOT_API_BASE_URL_TESTNET = 'https://leatherapi_testnet.bestinslot.xyz/v3';\n\nexport const STX20_API_BASE_URL_MAINNET = 'https://api.stx20.com/api/v1';\n\nexport const BNS_V2_API_BASE_URL = 'https://api.bnsv2.com';\n\n// Copied from @stacks/transactions to avoid dependencies\nexport enum ChainId {\n Testnet = 2147483648,\n Mainnet = 1,\n}\n\nexport enum WalletDefaultNetworkConfigurationIds {\n mainnet = 'mainnet',\n testnet = 'testnet',\n testnet4 = 'testnet4',\n signet = 'signet',\n sbtcTestnet = 'sbtcTestnet',\n sbtcDevenv = 'sbtcDevenv',\n devnet = 'devnet',\n}\n\nexport type DefaultNetworkConfigurations = keyof typeof WalletDefaultNetworkConfigurationIds;\n\nexport const supportedBlockchains = ['stacks', 'bitcoin'] as const;\n\nexport type SupportedBlockchains = (typeof supportedBlockchains)[number];\n\nexport const networkModes = ['mainnet', 'testnet'] as const;\nexport const testnetModes = ['testnet', 'regtest', 'signet'] as const;\n\nexport const bitcoinNetworks = ['mainnet', 'testnet3', 'testnet4', 'regtest', 'signet'] as const;\nexport type BitcoinNetwork = (typeof bitcoinNetworks)[number];\n\nexport type NetworkModes = (typeof networkModes)[number];\ntype BitcoinTestnetModes = (typeof testnetModes)[number];\n\nexport function bitcoinNetworkToNetworkMode(network: BitcoinNetwork): BitcoinNetworkModes {\n switch (network) {\n case 'mainnet':\n return 'mainnet';\n case 'testnet3':\n return 'testnet';\n case 'testnet4':\n return 'testnet';\n case 'regtest':\n return 'regtest';\n case 'signet':\n return 'signet';\n default:\n // TODO: Needs exhaustive check. Cannot import 'assertUnreachable' since 'utils' package depends on 'models'.\n // Ideally this function should live in utils, but it's currently widely used in the extension.\n throw new Error(`Unhandled case: ${network}`);\n }\n}\n\nexport type BitcoinNetworkModes = NetworkModes | BitcoinTestnetModes;\n\ninterface BaseChainConfig {\n blockchain: Blockchain;\n}\n\nexport interface BitcoinChainConfig extends BaseChainConfig {\n blockchain: 'bitcoin';\n bitcoinUrl: string;\n bitcoinNetwork: BitcoinNetwork;\n mode: BitcoinNetworkModes;\n}\n\nexport interface StacksChainConfig extends BaseChainConfig {\n blockchain: 'stacks';\n url: string;\n /** The chainId of the network (or parent network if this is a subnet) */\n chainId: ChainId;\n /** An additional chainId for subnets. Indicated a subnet if defined and is mainly used for signing. */\n subnetChainId?: ChainId;\n}\n\nexport type NetworkConfiguration = z.infer<typeof networkConfigurationSchema>;\n\nconst networkMainnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.mainnet,\n name: 'Mainnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Mainnet,\n url: HIRO_API_BASE_URL_MAINNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'mainnet',\n mode: 'mainnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_MAINNET,\n },\n },\n};\n\nconst networkTestnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.testnet,\n name: 'Testnet3',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'testnet3',\n mode: 'testnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_TESTNET3,\n },\n },\n};\n\nconst networkTestnet4: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.testnet4,\n name: 'Testnet4',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'testnet4',\n mode: 'testnet',\n bitcoinUrl: BITCOIN_API_BASE_URL_TESTNET4,\n },\n },\n};\n\nconst networkSignet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.signet,\n name: 'Signet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'signet',\n mode: 'signet',\n bitcoinUrl: BITCOIN_API_BASE_URL_SIGNET,\n },\n },\n};\n\nconst networkSbtcTestnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.sbtcTestnet,\n name: 'sBTC Testnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: HIRO_API_BASE_URL_TESTNET,\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'https://beta.sbtc-mempool.tech/api/proxy',\n },\n },\n};\n\nconst networkSbtcDevenv: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.sbtcDevenv,\n name: 'sBTC Devenv',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: 'http://localhost:3999',\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'http://localhost:3000/api/proxy',\n },\n },\n};\n\nconst networkDevnet: NetworkConfiguration = {\n id: WalletDefaultNetworkConfigurationIds.devnet,\n name: 'Devnet',\n chain: {\n stacks: {\n blockchain: 'stacks',\n chainId: ChainId.Testnet,\n url: 'http://localhost:3999',\n },\n bitcoin: {\n blockchain: 'bitcoin',\n bitcoinNetwork: 'regtest',\n mode: 'regtest',\n bitcoinUrl: 'http://localhost:18443',\n },\n },\n};\n\nexport const defaultCurrentNetwork: NetworkConfiguration = networkMainnet;\n\nexport const defaultNetworksKeyedById: Record<\n WalletDefaultNetworkConfigurationIds,\n NetworkConfiguration\n> = {\n [WalletDefaultNetworkConfigurationIds.mainnet]: networkMainnet,\n [WalletDefaultNetworkConfigurationIds.testnet4]: networkTestnet4,\n [WalletDefaultNetworkConfigurationIds.testnet]: networkTestnet,\n [WalletDefaultNetworkConfigurationIds.signet]: networkSignet,\n [WalletDefaultNetworkConfigurationIds.sbtcTestnet]: networkSbtcTestnet,\n [WalletDefaultNetworkConfigurationIds.sbtcDevenv]: networkSbtcDevenv,\n [WalletDefaultNetworkConfigurationIds.devnet]: networkDevnet,\n};\n","import { z } from 'zod';\n\nimport { bitcoinNetworks, networkModes, testnetModes } from './network.model';\n\nexport const bitcoinNetworkModesSchema = z.enum([...networkModes, ...testnetModes]);\n\nexport const bitcoinNetworkSchema = z.enum([...bitcoinNetworks]);\n\nexport const networkConfigurationSchema = z.object({\n name: z.string(),\n id: z.string(),\n chain: z.object({\n bitcoin: z.object({\n blockchain: z.literal('bitcoin'),\n bitcoinUrl: z.string(),\n bitcoinNetwork: bitcoinNetworkSchema,\n mode: bitcoinNetworkModesSchema,\n }),\n stacks: z.object({\n blockchain: z.literal('stacks'),\n url: z.string(),\n chainId: z.number(),\n subnetChainId: z.number().optional(),\n }),\n }),\n});\n","import { z } from 'zod';\n\nimport { Blockchain } from './types';\n\nexport type AccountDisplayPreference = 'native-segwit' | 'taproot' | 'bns' | 'stacks';\nexport interface AccountDisplayPreferenceInfo {\n type: AccountDisplayPreference;\n blockchain: Blockchain;\n name: string;\n}\n\nexport type AnalyticsPreference = 'consent-given' | 'rejects-tracking';\n\nexport const emailAddressSchema = z.email({ error: 'Invalid email address' });\nexport type EmailAddress = z.infer<typeof emailAddressSchema>;\n","export const ActivityLevels = {\n account: 'account',\n app: 'app',\n} as const;\nexport type ActivityLevel = keyof typeof ActivityLevels;\n","export const OnChainActivityStatuses = {\n pending: 'pending',\n success: 'success',\n failed: 'failed',\n} as const;\nexport type OnChainActivityStatus = keyof typeof OnChainActivityStatuses;\n","export const OnChainActivityTypes = {\n deploySmartContract: 'deploySmartContract',\n executeSmartContract: 'executeSmartContract',\n lockAsset: 'lockAsset',\n sendAsset: 'sendAsset',\n receiveAsset: 'receiveAsset',\n swapAssets: 'swapAssets',\n} as const;\nexport type OnChainActivityType = keyof typeof OnChainActivityTypes;\n\nexport const WalletActivityTypes = {\n connectApp: 'connectApp',\n signMessage: 'signMessage',\n} as const;\nexport type WalletActivityType = keyof typeof WalletActivityTypes;\n\nexport const GeneralActivityTypes = {\n walletAdded: 'walletAdded',\n receiveAnnouncement: 'receiveAnnouncement',\n featureWaitlistNotification: 'featureWaitlistNotification',\n} as const;\nexport type GeneralActivityType = keyof typeof GeneralActivityTypes;\n\nexport type ActivityType = OnChainActivityType | WalletActivityType | GeneralActivityType;\n","import { z } from 'zod';\n\nexport const walletIdSchema = z.object({\n fingerprint: z.string(),\n});\n\nexport const accountIdSchema = walletIdSchema.and(z.object({ accountIndex: z.number() }));\n\nexport const bitcoinAddressInfoSchema = z.object({\n taprootDescriptor: z.string(),\n nativeSegwitDescriptor: z.string(),\n});\n\nexport const stacksAddressInfoSchema = z.object({\n stxAddress: z.string(),\n});\n\nexport const accountAddressesSchema = z.object({\n id: accountIdSchema,\n bitcoin: bitcoinAddressInfoSchema.optional(),\n stacks: stacksAddressInfoSchema.optional(),\n});\n\nexport type WalletId = z.infer<typeof walletIdSchema>;\nexport type AccountId = z.infer<typeof accountIdSchema>;\nexport type BitcoinAddressInfo = z.infer<typeof bitcoinAddressInfoSchema>;\nexport type StacksAddressInfo = z.infer<typeof stacksAddressInfoSchema>;\nexport type AccountAddresses = z.infer<typeof accountAddressesSchema>;\n","export const bnsContractAddress = {\n mainnet: 'SP2QEZ06AGJ3RKJPBV14SY1V5BBFNAW33D96YPGZF',\n testnet: 'ST2QEZ06AGJ3RKJPBV14SY1V5BBFNAW33D9SZJQ0M',\n};\n\nexport const bnsContractName = 'BNS-V2';\n\nexport interface BnsName {\n owner: string;\n name: string;\n namespace: string;\n fullName: string;\n}\n\nexport interface BnsProfile {\n bnsName: BnsName;\n profileData: BnsProfileData;\n}\n\nexport interface BnsProfileData {\n name?: string;\n bio?: string;\n website?: string;\n pfpUrl?: string;\n location?: string;\n addresses?: BnsProfileDataAddresses;\n}\n\nexport interface BnsProfileDataAddresses {\n bitcoinPayment?: string;\n bitcoinOrdinal?: string;\n solana?: string;\n ethereum?: string;\n}\n","import { CryptoAssetId } from '../assets/asset-id.model';\nimport { NativeCryptoAsset, Sip10Asset } from '../assets/asset.model';\nimport { Money } from '../money.model';\n\nexport type SwappableFungibleCryptoAsset = NativeCryptoAsset | Sip10Asset;\n\nexport interface SwapAsset {\n asset: SwappableFungibleCryptoAsset;\n providerAssets: SwapProviderAsset[];\n}\n\nexport const swapProviderIds = ['bitflow-sdk', 'sbtc-bridge', 'alex-sdk', 'velar-sdk'] as const;\nexport type SwapProviderId = (typeof swapProviderIds)[number];\n\nexport interface SwapProvider {\n id: SwapProviderId;\n isAggregator: boolean;\n}\n\nexport interface SwapProviderAsset {\n providerId: SwapProviderId;\n providerAssetId: string;\n assetId: CryptoAssetId;\n}\n\nexport interface SwapQuote {\n executionType: SwapExecutionType;\n providerId: SwapProviderId;\n providerQuoteData: unknown;\n baseAmount: number;\n targetAmount: number;\n quote: Money;\n dexPath: SwapDex[];\n assetPath: (NativeCryptoAsset | Sip10Asset)[];\n}\n\nexport interface SwapDex {\n name: string;\n url: string;\n logo: string;\n description: string;\n}\n\nexport const swapExecutionTypes = ['stacks-contract-call', 'sbtc-bridge-transfer'] as const;\nexport type SwapExecutionType = (typeof swapExecutionTypes)[number];\n\nexport interface BaseSwapExecutionData {\n executionType: SwapExecutionType;\n providerId: SwapProviderId;\n}\nexport interface StacksContractCallSwapExecutionData extends BaseSwapExecutionData {\n executionType: 'stacks-contract-call';\n contractAddress: string;\n contractName: string;\n functionName: string;\n functionArgs: unknown[];\n postConditions: unknown[];\n postConditionMode?: unknown;\n}\nexport interface SbtcBridgeTransferSwapExecutionData extends BaseSwapExecutionData {\n executionType: 'sbtc-bridge-transfer';\n}\nexport type SwapExecutionData =\n | StacksContractCallSwapExecutionData\n | SbtcBridgeTransferSwapExecutionData;\n"],"mappings":";AAGO,IAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,QAAQ;AACV;AACO,IAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,EACV,KAAK;AACP;AACO,IAAM,+BAA+B;AAAA,EAC1C,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AACR;AACO,IAAM,kCAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AACf;AACO,IAAM,uBAAuB;AAAA,EAClC,GAAG;AAAA,EACH,GAAG;AACL;;;ACXO,SAAS,gBAAgB,OAAkD;AAChF,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,mBAAmB,OAAqD;AACtF,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,WAAW,OAAuC;AAChE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,WAAW,OAAuC;AAChE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,cAAc,OAAgD;AAC5E,SAAO,WAAW,KAAK,KAAK,WAAW,KAAK;AAC9C;AAEO,SAAS,aAAa,OAAyC;AACpE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,iBAAiB,OAA6D;AAC5F,SAAO,cAAc,KAAK,KAAK,aAAa,KAAK;AACnD;AAEO,SAAS,aAAa,OAAyC;AACpE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,aAAa,OAAyC;AACpE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,aAAa,OAAyC;AACpE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,YAAY,OAAwC;AAClE,SAAO,MAAM,aAAa;AAC5B;AAEO,SAAS,mBAAmB,OAA+C;AAChF,S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AAC,CAAC;AAEjF,IAAM,2BAA2BA,GAAE,OAAO;AAAA,EAC/C,mBAAmBA,GAAE,OAAO;AAAA,EAC5B,wBAAwBA,GAAE,OAAO;AACnC,CAAC;AAEM,IAAM,0BAA0BA,GAAE,OAAO;AAAA,EAC9C,YAAYA,GAAE,OAAO;AACvB,CAAC;AAEM,IAAM,yBAAyBA,GAAE,OAAO;AAAA,EAC7C,IAAI;AAAA,EACJ,SAAS,yBAAyB,SAAS;AAAA,EAC3C,QAAQ,wBAAwB,SAAS;AAC3C,CAAC;;;ACrBM,IAAM,qBAAqB;AAAA,EAChC,SAAS;AAAA,EACT,SAAS;AACX;AAEO,IAAM,kBAAkB;;;ACMxB,IAAM,kBAAkB,CAAC,eAAe,eAAe,YAAY,WAAW;AAgC9E,IAAM,qBAAqB,CAAC,wBAAwB,sBAAsB;","names":["BtcFeeType","FeeTypes","FeeCalculationTypes","ChainId","WalletDefaultNetworkConfigurationIds","z","z"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@leather.io/models",
3
3
  "author": "Leather.io contact@leather.io",
4
4
  "description": "Leather models and types",
5
- "version": "0.43.0",
5
+ "version": "0.44.1",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/leather-io/mono/tree/dev/packages/models",
8
8
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "prettier": "3.5.1",
25
25
  "tsup": "8.4.0",
26
26
  "typescript": "5.8.3",
27
- "@leather.io/prettier-config": "0.8.1",
27
+ "@leather.io/prettier-config": "0.9.0",
28
28
  "@leather.io/tsconfig-config": "0.11.0"
29
29
  },
30
30
  "keywords": [
@@ -7,13 +7,13 @@ import {
7
7
  NativeCryptoAsset,
8
8
  NonFungibleCryptoAsset,
9
9
  RuneAsset,
10
- Sip9Asset,
11
10
  Sip10Asset,
12
11
  Src20Asset,
13
12
  StampAsset,
14
13
  Stx20Asset,
15
14
  StxAsset,
16
15
  } from './asset.model';
16
+ import { Sip9Asset } from './sip9-asset.model';
17
17
 
18
18
  export function isFungibleAsset(asset: CryptoAsset): asset is FungibleCryptoAsset {
19
19
  return asset.category === 'fungible';
@@ -39,6 +39,10 @@ export function isSip10Asset(asset: CryptoAsset): asset is Sip10Asset {
39
39
  return asset.protocol === 'sip10';
40
40
  }
41
41
 
42
+ export function isSwappableAsset(asset: CryptoAsset): asset is NativeCryptoAsset | Sip10Asset {
43
+ return isNativeAsset(asset) || isSip10Asset(asset);
44
+ }
45
+
42
46
  export function isBrc20Asset(asset: CryptoAsset): asset is Brc20Asset {
43
47
  return asset.protocol === 'brc20';
44
48
  }
@@ -1,4 +1,5 @@
1
1
  import { InscriptionMimeType } from '../inscription-mime-type.model';
2
+ import { Sip9Asset } from './sip9-asset.model';
2
3
 
3
4
  export const CryptoAssetChains = {
4
5
  bitcoin: 'bitcoin',
@@ -102,7 +103,7 @@ export type FungibleCryptoAsset =
102
103
  | RuneAsset;
103
104
 
104
105
  // NFT asset types
105
- interface BaseNonFungibleCryptoAsset extends BaseCryptoAsset {
106
+ export interface BaseNonFungibleCryptoAsset extends BaseCryptoAsset {
106
107
  readonly category: 'nft';
107
108
  readonly protocol: NonFungibleCryptoAssetProtocol;
108
109
  }
@@ -131,107 +132,6 @@ export interface StampAsset extends BaseNonFungibleCryptoAsset {
131
132
  readonly stampUrl: string;
132
133
  }
133
134
 
134
- export type Sip9ContentType =
135
- // Images
136
- | 'image/jpeg'
137
- | 'image/jpg'
138
- | 'image/png'
139
- | 'image/gif'
140
- | 'image/webp'
141
- | 'image/svg+xml'
142
- | 'image/bmp'
143
- | 'image/tiff'
144
- | 'image/avif'
145
-
146
- // Videos
147
- | 'video/mp4'
148
- | 'video/webm'
149
- | 'video/mov'
150
- | 'video/quicktime'
151
- | 'video/avi'
152
- | 'video/x-msvideo'
153
- | 'video/ogg'
154
-
155
- // Audio
156
- | 'audio/mpeg'
157
- | 'audio/mp3'
158
- | 'audio/wav'
159
- | 'audio/x-wav'
160
- | 'audio/ogg'
161
- | 'audio/aac'
162
- | 'audio/flac'
163
- | 'audio/webm'
164
-
165
- // 3D Models
166
- | 'model/gltf+json'
167
- | 'model/gltf-binary'
168
- | 'application/octet-stream' // GLB files sometimes use this
169
-
170
- // Documents/Text
171
- | 'text/plain'
172
- | 'text/html'
173
- | 'text/markdown'
174
- | 'application/pdf'
175
- | 'application/json'
176
-
177
- // Interactive/Web
178
- | 'text/javascript'
179
- | 'application/javascript'
180
-
181
- // Archives
182
- | 'application/zip'
183
-
184
- // Unknown/Fallback
185
- | 'unknown';
186
-
187
- export type SupportedSip9ContentType =
188
- | Extract<
189
- Sip9ContentType,
190
- | 'image/jpeg'
191
- | 'image/png'
192
- | 'image/gif'
193
- | 'image/webp'
194
- | 'image/svg+xml'
195
- | 'image/bmp'
196
- | 'image/tiff'
197
- | 'image/avif'
198
- | 'video/mp4'
199
- | 'audio/mpeg'
200
- | 'audio/mp3'
201
- | 'audio/wav'
202
- | 'audio/ogg'
203
- | 'audio/aac'
204
- | 'audio/flac'
205
- | 'audio/webm'
206
- | 'text/plain'
207
- | 'application/octet-stream'
208
- | 'model/gltf+json'
209
- | 'model/gltf-binary'
210
- >
211
- | '';
212
- export interface Sip9Asset extends BaseNonFungibleCryptoAsset {
213
- readonly chain: 'stacks';
214
- readonly protocol: 'sip9';
215
- readonly assetId: string;
216
- readonly contractId: string;
217
- readonly tokenId: number;
218
- readonly name: string;
219
- readonly description: string;
220
- readonly cachedImage: string;
221
- readonly cachedImageThumbnail: string;
222
- readonly contentType: SupportedSip9ContentType;
223
- readonly collection: {
224
- id: string;
225
- name: string;
226
- isVerified: boolean;
227
- locationUrl: string;
228
- totalItems: number;
229
- floorPriceAmount: {
230
- amount: number;
231
- unit: string;
232
- };
233
- };
234
- }
235
135
  export type NonFungibleCryptoAsset = InscriptionAsset | StampAsset | Sip9Asset;
236
136
 
237
137
  export type CryptoAsset = FungibleCryptoAsset | NonFungibleCryptoAsset;
@@ -0,0 +1,73 @@
1
+ import { BaseNonFungibleCryptoAsset } from './asset.model';
2
+
3
+ export const sip9ContentTypes = [
4
+ 'image/jpeg',
5
+ 'image/jpg',
6
+ 'image/png',
7
+ 'image/gif',
8
+ 'image/webp',
9
+ 'image/svg+xml',
10
+ 'image/bmp',
11
+ 'image/tiff',
12
+ 'image/avif',
13
+ 'video/mp4',
14
+ 'video/webm',
15
+ 'video/mov',
16
+ 'video/quicktime',
17
+ 'video/avi',
18
+ 'video/x-msvideo',
19
+ 'video/ogg',
20
+ 'audio/mpeg',
21
+ 'audio/mp3',
22
+ 'audio/wav',
23
+ 'audio/x-wav',
24
+ 'audio/ogg',
25
+ 'audio/aac',
26
+ 'audio/flac',
27
+ 'audio/webm',
28
+ 'model/gltf+json',
29
+ 'model/gltf-binary',
30
+ 'application/octet-stream',
31
+ 'text/plain',
32
+ 'text/html',
33
+ 'text/markdown',
34
+ 'application/pdf',
35
+ 'application/json',
36
+ 'text/javascript',
37
+ 'application/javascript',
38
+ 'application/zip',
39
+ 'unknown',
40
+ '',
41
+ ] as const;
42
+
43
+ export type Sip9ContentType = (typeof sip9ContentTypes)[number];
44
+
45
+ export interface Sip9Collection {
46
+ name: string;
47
+ collectionExplorerUrl: string;
48
+ totalItems?: number;
49
+ }
50
+
51
+ export interface Sip9AssetContent {
52
+ contentUrl: string;
53
+ contentType: Sip9ContentType;
54
+ }
55
+
56
+ export interface Sip9Attribute {
57
+ traitType: string;
58
+ value: any;
59
+ rarityPercent?: number;
60
+ }
61
+
62
+ export interface Sip9Asset extends BaseNonFungibleCryptoAsset {
63
+ readonly chain: 'stacks';
64
+ readonly protocol: 'sip9';
65
+ readonly assetId: string;
66
+ readonly contractId: string;
67
+ readonly tokenId: number;
68
+ readonly name: string;
69
+ readonly description: string;
70
+ readonly content: Sip9AssetContent;
71
+ readonly attributes?: Sip9Attribute[];
72
+ readonly collection?: Sip9Collection;
73
+ }
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ export * from './balance.model';
3
3
  export * from './assets/asset.model';
4
4
  export * from './assets/asset-id.model';
5
5
  export * from './assets/asset-type-guards';
6
+ export * from './assets/sip9-asset.model';
6
7
  export * from './inscription-mime-type.model';
7
8
  export * from './currencies.model';
8
9
  export * from './fees/bitcoin-fees.model';
@@ -1,9 +1,11 @@
1
1
  import { CryptoAssetId } from '../assets/asset-id.model';
2
- import { FungibleCryptoAsset } from '../assets/asset.model';
2
+ import { NativeCryptoAsset, Sip10Asset } from '../assets/asset.model';
3
3
  import { Money } from '../money.model';
4
4
 
5
+ export type SwappableFungibleCryptoAsset = NativeCryptoAsset | Sip10Asset;
6
+
5
7
  export interface SwapAsset {
6
- asset: FungibleCryptoAsset;
8
+ asset: SwappableFungibleCryptoAsset;
7
9
  providerAssets: SwapProviderAsset[];
8
10
  }
9
11
 
@@ -29,7 +31,7 @@ export interface SwapQuote {
29
31
  targetAmount: number;
30
32
  quote: Money;
31
33
  dexPath: SwapDex[];
32
- assetPath: FungibleCryptoAsset[];
34
+ assetPath: (NativeCryptoAsset | Sip10Asset)[];
33
35
  }
34
36
 
35
37
  export interface SwapDex {