@leather.io/models 0.23.0 → 0.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +14 -0
- package/dist/index.d.ts +18 -19
- package/dist/index.js +1 -7
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/crypto-assets/crypto-asset-balance.model.ts +17 -21
- package/src/network/network.model.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @leather.io/models@0.
|
|
2
|
+
> @leather.io/models@0.24.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 @@ CLI tsup v8.1.0
|
|
|
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 11.
|
|
12
|
-
ESM dist/index.js.map
|
|
13
|
-
ESM ⚡️ Build success in
|
|
11
|
+
ESM dist/index.js 11.60 KB
|
|
12
|
+
ESM dist/index.js.map 24.41 KB
|
|
13
|
+
ESM ⚡️ Build success in 24ms
|
|
14
14
|
DTS Build start
|
|
15
|
-
DTS ⚡️ Build success in
|
|
16
|
-
DTS dist/index.d.ts 19.
|
|
15
|
+
DTS ⚡️ Build success in 1748ms
|
|
16
|
+
DTS dist/index.d.ts 19.62 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -24,6 +24,20 @@
|
|
|
24
24
|
* devDependencies
|
|
25
25
|
* @leather.io/eslint-config bumped to 0.7.0
|
|
26
26
|
|
|
27
|
+
## [0.24.1](https://github.com/leather-io/mono/compare/@leather.io/models-v0.24.0...@leather.io/models-v0.24.1) (2024-12-13)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* testnet ordering ([c98c69f](https://github.com/leather-io/mono/commit/c98c69f0db00449232adcb2775ebb4a3d7c7fbc4))
|
|
33
|
+
|
|
34
|
+
## [0.24.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.23.0...@leather.io/models-v0.24.0) (2024-12-03)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* balances service ([85e13f0](https://github.com/leather-io/mono/commit/85e13f052142d9a26aed3a84c22c36207efa91de))
|
|
40
|
+
|
|
27
41
|
## [0.23.0](https://github.com/leather-io/mono/compare/@leather.io/models-v0.22.0...@leather.io/models-v0.23.0) (2024-11-29)
|
|
28
42
|
|
|
29
43
|
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,22 @@ interface Money {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
interface BaseCryptoAssetBalance {
|
|
40
|
+
/**
|
|
41
|
+
* Balance as confirmed on chain
|
|
42
|
+
*/
|
|
43
|
+
readonly totalBalance: Money;
|
|
44
|
+
/**
|
|
45
|
+
* Balance of pending receipt into account given pending transactions
|
|
46
|
+
*/
|
|
47
|
+
readonly inboundBalance: Money;
|
|
48
|
+
/**
|
|
49
|
+
* Balance of pending delivery from account given pending transactions
|
|
50
|
+
*/
|
|
51
|
+
readonly outboundBalance: Money;
|
|
52
|
+
/**
|
|
53
|
+
* totalBalance plus inboundBalance minus outboundBalance
|
|
54
|
+
*/
|
|
55
|
+
readonly pendingBalance: Money;
|
|
40
56
|
/**
|
|
41
57
|
* totalBalance after filtering out outboundBalance, protectedBalance, and uneconomicalBalance
|
|
42
58
|
*/
|
|
@@ -58,32 +74,15 @@ interface StxCryptoAssetBalance extends BaseCryptoAssetBalance {
|
|
|
58
74
|
*/
|
|
59
75
|
readonly availableUnlockedBalance: Money;
|
|
60
76
|
/**
|
|
61
|
-
*
|
|
62
|
-
*/
|
|
63
|
-
readonly inboundBalance: Money;
|
|
64
|
-
/**
|
|
65
|
-
* totalBalance minus total amount locked by contracts
|
|
77
|
+
* total amount locked by contracts
|
|
66
78
|
*/
|
|
67
79
|
readonly lockedBalance: Money;
|
|
68
|
-
/**
|
|
69
|
-
* Balance of pending delivery from account given pending transactions
|
|
70
|
-
*/
|
|
71
|
-
readonly outboundBalance: Money;
|
|
72
|
-
/**
|
|
73
|
-
* totalBalance plus inboundBalance minus outboundBalance
|
|
74
|
-
*/
|
|
75
|
-
readonly pendingBalance: Money;
|
|
76
|
-
/**
|
|
77
|
-
* Balance as confirmed on chain
|
|
78
|
-
*/
|
|
79
|
-
readonly totalBalance: Money;
|
|
80
80
|
/**
|
|
81
81
|
* totalBalance minus lockedBalance
|
|
82
82
|
*/
|
|
83
83
|
readonly unlockedBalance: Money;
|
|
84
84
|
}
|
|
85
85
|
type CryptoAssetBalance = BaseCryptoAssetBalance | BtcCryptoAssetBalance | StxCryptoAssetBalance;
|
|
86
|
-
declare function createCryptoAssetBalance(balance: Money): BaseCryptoAssetBalance;
|
|
87
86
|
|
|
88
87
|
/**
|
|
89
88
|
* Inscriptions contain arbitrary data. When retrieving an inscription, it should be
|
|
@@ -524,4 +523,4 @@ interface FtTransfer {
|
|
|
524
523
|
recipient?: string;
|
|
525
524
|
}
|
|
526
525
|
|
|
527
|
-
export { type AccountDisplayPreference, type AccountDisplayPreferenceInfo, type AllowAdditionalProperties, type AnalyticsPreference, 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 BaseCryptoAssetBalance, type BaseCryptoAssetInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, type Blockchain, type Brc20CryptoAssetInfo, type BtcCryptoAssetBalance, type BtcCryptoAssetInfo, BtcFeeType, ChainID, type CryptoAssetBalance, CryptoAssetCategories, type CryptoAssetCategory, type CryptoAssetChain, CryptoAssetChains, type CryptoAssetInfo, type CryptoAssetProtocol, CryptoAssetProtocols, type CryptoCurrency, type Currency, type DefaultNetworkConfigurations, type EmailAddress, type Entries, FeeCalculationTypes, FeeTypes, type Fees, type FiatCurrency, type FtTransfer, type FungibleCryptoAssetInfo, 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, HIRO_INSCRIPTIONS_API_URL, type Inscription, type InscriptionCryptoAssetInfo, type InscriptionMimeType, type LiteralUnion, type MarketData, type Money, type NativeCryptoAssetInfo, type NetworkConfiguration, type NetworkModes, type NonFungibleCryptoAssetInfo, type NumType, type ReplaceTypes, type RuneCryptoAssetInfo, STX20_API_BASE_URL_MAINNET, type Sip10CryptoAssetInfo, type Sip9CryptoAssetInfo, type Src20CryptoAssetInfo, type StacksChainConfig, type StacksFeeEstimate, type StacksTx, type StacksTxStatus, type StampCryptoAssetInfo, type Stx20CryptoAssetInfo, type StxCryptoAssetBalance, type StxCryptoAssetInfo, type StxTransfer, type SupportedBlockchains, type ValueOf, WalletDefaultNetworkConfigurationIds, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, btcTxTimeMap,
|
|
526
|
+
export { type AccountDisplayPreference, type AccountDisplayPreferenceInfo, type AllowAdditionalProperties, type AnalyticsPreference, 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 BaseCryptoAssetBalance, type BaseCryptoAssetInfo, type BitcoinChainConfig, type BitcoinNetwork, type BitcoinNetworkModes, type BitcoinTransactionVectorInput, type BitcoinTransactionVectorOutput, type BitcoinTx, type BitcoinUnit, type BitcoinUnitInfo, type BitcoinUnitSymbol, type Blockchain, type Brc20CryptoAssetInfo, type BtcCryptoAssetBalance, type BtcCryptoAssetInfo, BtcFeeType, ChainID, type CryptoAssetBalance, CryptoAssetCategories, type CryptoAssetCategory, type CryptoAssetChain, CryptoAssetChains, type CryptoAssetInfo, type CryptoAssetProtocol, CryptoAssetProtocols, type CryptoCurrency, type Currency, type DefaultNetworkConfigurations, type EmailAddress, type Entries, FeeCalculationTypes, FeeTypes, type Fees, type FiatCurrency, type FtTransfer, type FungibleCryptoAssetInfo, 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, HIRO_INSCRIPTIONS_API_URL, type Inscription, type InscriptionCryptoAssetInfo, type InscriptionMimeType, type LiteralUnion, type MarketData, type Money, type NativeCryptoAssetInfo, type NetworkConfiguration, type NetworkModes, type NonFungibleCryptoAssetInfo, type NumType, type ReplaceTypes, type RuneCryptoAssetInfo, STX20_API_BASE_URL_MAINNET, type Sip10CryptoAssetInfo, type Sip9CryptoAssetInfo, type Src20CryptoAssetInfo, type StacksChainConfig, type StacksFeeEstimate, type StacksTx, type StacksTxStatus, type StampCryptoAssetInfo, type Stx20CryptoAssetInfo, type StxCryptoAssetBalance, type StxCryptoAssetInfo, type StxTransfer, type SupportedBlockchains, type ValueOf, WalletDefaultNetworkConfigurationIds, bitcoinNetworkModesSchema, bitcoinNetworkSchema, bitcoinNetworkToNetworkMode, bitcoinNetworks, btcTxTimeMap, createInscription, createMarketData, createMarketPair, defaultCurrentNetwork, defaultNetworksKeyedById, emailAddressSchema, formatMarketPair, networkConfigurationSchema, networkModes, testnetModes, whenInscriptionMimeType };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
// src/crypto-assets/crypto-asset-balance.model.ts
|
|
2
|
-
function createCryptoAssetBalance(balance) {
|
|
3
|
-
return { availableBalance: balance };
|
|
4
|
-
}
|
|
5
|
-
|
|
6
1
|
// src/crypto-assets/crypto-asset-info.model.ts
|
|
7
2
|
var CryptoAssetChains = {
|
|
8
3
|
bitcoin: "bitcoin",
|
|
@@ -194,8 +189,8 @@ var networkDevnet = {
|
|
|
194
189
|
var defaultCurrentNetwork = networkMainnet;
|
|
195
190
|
var defaultNetworksKeyedById = {
|
|
196
191
|
["mainnet" /* mainnet */]: networkMainnet,
|
|
197
|
-
["testnet" /* testnet */]: networkTestnet,
|
|
198
192
|
["testnet4" /* testnet4 */]: networkTestnet4,
|
|
193
|
+
["testnet" /* testnet */]: networkTestnet,
|
|
199
194
|
["signet" /* signet */]: networkSignet,
|
|
200
195
|
["sbtcTestnet" /* sbtcTestnet */]: networkSbtcTestnet,
|
|
201
196
|
["sbtcDevenv" /* sbtcDevenv */]: networkSbtcDevenv,
|
|
@@ -400,7 +395,6 @@ export {
|
|
|
400
395
|
bitcoinNetworkToNetworkMode,
|
|
401
396
|
bitcoinNetworks,
|
|
402
397
|
btcTxTimeMap,
|
|
403
|
-
createCryptoAssetBalance,
|
|
404
398
|
createInscription,
|
|
405
399
|
createMarketData,
|
|
406
400
|
createMarketPair,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/crypto-assets/crypto-asset-balance.model.ts","../src/crypto-assets/crypto-asset-info.model.ts","../src/network/network.model.ts","../src/crypto-assets/bitcoin/inscription.model.ts","../src/fees/bitcoin-fees.model.ts","../src/fees/fees.model.ts","../src/market.model.ts","../src/network/network.schema.ts","../src/settings.model.ts"],"sourcesContent":["import { Money } from '../money.model';\n\nexport interface BaseCryptoAssetBalance {\n /**\n * totalBalance after filtering out outboundBalance, protectedBalance, and uneconomicalBalance\n */\n readonly availableBalance: Money;\n}\n\nexport interface BtcCryptoAssetBalance extends BaseCryptoAssetBalance {\n /**\n * Balance of UTXOs with collectibles\n */\n readonly protectedBalance: Money;\n /**\n * Balance across UTXOs with need for larger fee than principal by UTXO given standard rate\n */\n readonly uneconomicalBalance: Money;\n}\n\nexport interface StxCryptoAssetBalance extends BaseCryptoAssetBalance {\n /**\n * availableBalance minus lockedBalance\n */\n readonly availableUnlockedBalance: Money;\n /**\n * Balance of pending receipt into account given pending transactions\n */\n readonly inboundBalance: Money;\n /**\n * totalBalance minus total amount locked by contracts\n */\n readonly lockedBalance: Money;\n /**\n * Balance of pending delivery from account given pending transactions\n */\n readonly outboundBalance: Money;\n /**\n * totalBalance plus inboundBalance minus outboundBalance\n */\n readonly pendingBalance: Money;\n /**\n * Balance as confirmed on chain\n */\n readonly totalBalance: Money;\n /**\n * totalBalance minus lockedBalance\n */\n readonly unlockedBalance: Money;\n}\n\nexport type CryptoAssetBalance =\n | BaseCryptoAssetBalance\n | BtcCryptoAssetBalance\n | StxCryptoAssetBalance;\n\nexport function createCryptoAssetBalance(balance: Money): BaseCryptoAssetBalance {\n return { availableBalance: balance };\n}\n","import { InscriptionMimeType } from './bitcoin/inscription.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 CryptoAssetProtocols = {\n nativeBtc: 'nativeBtc',\n nativeStx: 'nativeStx',\n sip10: 'sip10',\n brc20: 'brc20',\n src20: 'src20',\n stx20: 'stx20',\n rune: 'rune',\n stamp: 'stamp',\n sip9: 'sip9',\n inscription: 'inscription',\n} as const;\n\nexport type CryptoAssetChain = keyof typeof CryptoAssetChains;\nexport type CryptoAssetCategory = keyof typeof CryptoAssetCategories;\nexport type CryptoAssetProtocol = keyof typeof CryptoAssetProtocols;\n\nexport interface BaseCryptoAssetInfo {\n readonly chain: CryptoAssetChain;\n readonly category: CryptoAssetCategory;\n readonly protocol: CryptoAssetProtocol;\n}\n\n// Fungible asset types\ninterface BaseFungibleCryptoAssetInfo extends BaseCryptoAssetInfo {\n readonly category: 'fungible';\n readonly symbol: string;\n readonly decimals: number;\n readonly hasMemo: boolean;\n}\nexport interface BtcCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'nativeBtc';\n readonly symbol: 'BTC';\n}\nexport interface StxCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'nativeStx';\n readonly symbol: 'STX';\n}\nexport interface Brc20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'brc20';\n readonly symbol: string;\n}\nexport interface Src20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'src20';\n readonly id: string;\n readonly symbol: string;\n}\nexport interface RuneCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'rune';\n readonly spacedRuneName: string;\n readonly runeName: string;\n readonly symbol: string;\n}\nexport interface Sip10CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'sip10';\n readonly name: string;\n readonly canTransfer: boolean;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n readonly symbol: string;\n}\nexport interface Stx20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'stx20';\n readonly symbol: string;\n}\nexport type NativeCryptoAssetInfo = BtcCryptoAssetInfo | StxCryptoAssetInfo;\nexport type FungibleCryptoAssetInfo =\n | NativeCryptoAssetInfo\n | Sip10CryptoAssetInfo\n | Brc20CryptoAssetInfo\n | Src20CryptoAssetInfo\n | Stx20CryptoAssetInfo\n | RuneCryptoAssetInfo;\n\n// NFT asset types\ninterface BaseNonFungibleCryptoAssetInfo extends BaseCryptoAssetInfo {\n readonly category: 'nft';\n}\nexport interface InscriptionCryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'inscription';\n readonly id: string;\n readonly mimeType: InscriptionMimeType;\n readonly number: number;\n}\n\nexport interface StampCryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'stamp';\n readonly stamp: number;\n readonly stampUrl: string;\n}\nexport interface Sip9CryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'sip9';\n readonly name: string;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n}\nexport type NonFungibleCryptoAssetInfo =\n | InscriptionCryptoAssetInfo\n | StampCryptoAssetInfo\n | Sip9CryptoAssetInfo;\n\nexport type CryptoAssetInfo = FungibleCryptoAssetInfo | NonFungibleCryptoAssetInfo;\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_INSCRIPTIONS_API_URL = 'https://api.hiro.so/ordinals/v1/inscriptions';\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\nconst 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 }\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.testnet]: networkTestnet,\n [WalletDefaultNetworkConfigurationIds.testnet4]: networkTestnet4,\n [WalletDefaultNetworkConfigurationIds.signet]: networkSignet,\n [WalletDefaultNetworkConfigurationIds.sbtcTestnet]: networkSbtcTestnet,\n [WalletDefaultNetworkConfigurationIds.sbtcDevenv]: networkSbtcDevenv,\n [WalletDefaultNetworkConfigurationIds.devnet]: networkDevnet,\n};\n","import { HIRO_INSCRIPTIONS_API_URL } from '../../network/network.model';\nimport {\n CryptoAssetCategories,\n CryptoAssetChains,\n CryptoAssetProtocols,\n InscriptionCryptoAssetInfo,\n} from '../crypto-asset-info.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 */\nconst 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\nexport function whenInscriptionMimeType<T>(\n mimeType: string,\n branches: { [k in InscriptionMimeType]?: () => T }\n) {\n if (mimeType.startsWith('audio/') && branches.audio) {\n return branches.audio();\n }\n\n if (mimeType.startsWith('text/html') && branches.html) {\n return branches.html();\n }\n\n if (mimeType.startsWith('image/svg') && branches.svg) {\n return branches.svg();\n }\n\n if (mimeType.startsWith('image/') && branches.image) {\n return branches.image();\n }\n\n if (mimeType.startsWith('text') && branches.text) {\n return branches.text();\n }\n\n if (mimeType.startsWith('video/') && branches.video) {\n return branches.video();\n }\n\n if (mimeType.startsWith('model/gltf') && branches.gltf) {\n return branches.gltf();\n }\n\n if (branches.other) return branches.other();\n\n throw new Error('Unhandled inscription type');\n}\nexport interface Inscription extends InscriptionCryptoAssetInfo {\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\ninterface RawInscription {\n id: string;\n number: number;\n output: string;\n contentType: string;\n txid: string;\n offset: string;\n address: string;\n genesisBlockHash: string;\n genesisTimestamp: number;\n genesisBlockHeight: number;\n value: string;\n}\n\nexport function createInscription(inscription: RawInscription): Inscription {\n const contentSrc = `${HIRO_INSCRIPTIONS_API_URL}/${inscription.id}/content`;\n const iframeSrc = `https://ordinals.com/preview/${inscription.id}`;\n const preview = `https://ordinals.hiro.so/inscription/${inscription.id}`;\n const title = `Inscription ${inscription.number}`;\n\n const sharedInfo = {\n chain: CryptoAssetChains.bitcoin,\n category: CryptoAssetCategories.nft,\n protocol: CryptoAssetProtocols.inscription,\n id: inscription.id,\n number: inscription.number,\n output: inscription.output,\n txid: inscription.txid,\n offset: inscription.offset,\n address: inscription.address,\n genesisBlockHash: inscription.genesisBlockHash,\n genesisTimestamp: inscription.genesisTimestamp,\n genesisBlockHeight: inscription.genesisBlockHeight,\n value: inscription.value,\n preview,\n title,\n };\n\n return whenInscriptionMimeType<Inscription>(inscription.contentType, {\n audio: () => ({\n ...sharedInfo,\n mimeType: 'audio',\n name: 'inscription',\n src: iframeSrc,\n }),\n gltf: () => ({\n ...sharedInfo,\n mimeType: 'gltf',\n name: 'inscription',\n src: iframeSrc,\n }),\n html: () => ({\n ...sharedInfo,\n mimeType: 'html',\n name: 'inscription',\n src: iframeSrc,\n }),\n image: () => ({\n ...sharedInfo,\n mimeType: 'image',\n name: 'inscription',\n src: contentSrc,\n }),\n svg: () => ({\n ...sharedInfo,\n mimeType: 'svg',\n name: 'inscription',\n src: iframeSrc,\n }),\n text: () => ({\n ...sharedInfo,\n mimeType: 'text',\n name: 'inscription',\n src: contentSrc,\n }),\n video: () => ({\n ...sharedInfo,\n mimeType: 'video',\n name: 'inscription',\n src: iframeSrc,\n }),\n other: () => ({\n ...sharedInfo,\n mimeType: 'other',\n name: 'inscription',\n src: '',\n }),\n });\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 { CryptoCurrency, FiatCurrency } from './currencies.model';\nimport type { Money } from './money.model';\n\ninterface MarketPair {\n readonly base: CryptoCurrency;\n readonly quote: FiatCurrency;\n}\n\nexport function createMarketPair(base: CryptoCurrency, quote: FiatCurrency): 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 { 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.string().email({ message: 'Invalid email address' });\nexport type EmailAddress = z.infer<typeof emailAddressSchema>;\n"],"mappings":";AAwDO,SAAS,yBAAyB,SAAwC;AAC/E,SAAO,EAAE,kBAAkB,QAAQ;AACrC;;;ACxDO,IAAM,oBAAoB;AAAA,EAC/B,SAAS;AAAA,EACT,QAAQ;AACV;AACO,IAAM,wBAAwB;AAAA,EACnC,UAAU;AAAA,EACV,KAAK;AACP;AACO,IAAM,uBAAuB;AAAA,EAClC,WAAW;AAAA,EACX,WAAW;AAAA,EACX,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAM;AAAA,EACN,aAAa;AACf;;;AChBO,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAClC,IAAM,4BAA4B;AAClC,IAAM,qCAAqC;AAE3C,IAAM,qCAAqC;AAC3C,IAAM,qCAAqC;AAE3C,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,gCAAgC;AACtC,IAAM,8BAA8B;AAEpC,IAAM,kCAAkC;AACxC,IAAM,kCAAkC;AAExC,IAAM,6BAA6B;AAEnC,IAAM,sBAAsB;AAG5B,IAAK,UAAL,kBAAKA,aAAL;AACL,EAAAA,kBAAA,aAAU,cAAV;AACA,EAAAA,kBAAA,aAAU,KAAV;AAFU,SAAAA;AAAA,GAAA;AAKL,IAAK,uCAAL,kBAAKC,0CAAL;AACL,EAAAA,sCAAA,aAAU;AACV,EAAAA,sCAAA,aAAU;AACV,EAAAA,sCAAA,cAAW;AACX,EAAAA,sCAAA,YAAS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A,MAC9B,KAAK,EAAE,OAAO;AAAA,MACd,SAAS,EAAE,OAAO;AAAA,MAClB,eAAe,EAAE,OAAO,EAAE,SAAS;AAAA,IACrC,CAAC;AAAA,EACH,CAAC;AACH,CAAC;;;ACzBD,SAAS,KAAAC,UAAS;AAaX,IAAM,qBAAqBA,GAAE,OAAO,EAAE,MAAM,EAAE,SAAS,wBAAwB,CAAC;","names":["ChainID","WalletDefaultNetworkConfigurationIds","BtcFeeType","FeeTypes","FeeCalculationTypes","z"]}
|
|
1
|
+
{"version":3,"sources":["../src/crypto-assets/crypto-asset-info.model.ts","../src/network/network.model.ts","../src/crypto-assets/bitcoin/inscription.model.ts","../src/fees/bitcoin-fees.model.ts","../src/fees/fees.model.ts","../src/market.model.ts","../src/network/network.schema.ts","../src/settings.model.ts"],"sourcesContent":["import { InscriptionMimeType } from './bitcoin/inscription.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 CryptoAssetProtocols = {\n nativeBtc: 'nativeBtc',\n nativeStx: 'nativeStx',\n sip10: 'sip10',\n brc20: 'brc20',\n src20: 'src20',\n stx20: 'stx20',\n rune: 'rune',\n stamp: 'stamp',\n sip9: 'sip9',\n inscription: 'inscription',\n} as const;\n\nexport type CryptoAssetChain = keyof typeof CryptoAssetChains;\nexport type CryptoAssetCategory = keyof typeof CryptoAssetCategories;\nexport type CryptoAssetProtocol = keyof typeof CryptoAssetProtocols;\n\nexport interface BaseCryptoAssetInfo {\n readonly chain: CryptoAssetChain;\n readonly category: CryptoAssetCategory;\n readonly protocol: CryptoAssetProtocol;\n}\n\n// Fungible asset types\ninterface BaseFungibleCryptoAssetInfo extends BaseCryptoAssetInfo {\n readonly category: 'fungible';\n readonly symbol: string;\n readonly decimals: number;\n readonly hasMemo: boolean;\n}\nexport interface BtcCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'nativeBtc';\n readonly symbol: 'BTC';\n}\nexport interface StxCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'nativeStx';\n readonly symbol: 'STX';\n}\nexport interface Brc20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'brc20';\n readonly symbol: string;\n}\nexport interface Src20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'src20';\n readonly id: string;\n readonly symbol: string;\n}\nexport interface RuneCryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'rune';\n readonly spacedRuneName: string;\n readonly runeName: string;\n readonly symbol: string;\n}\nexport interface Sip10CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'sip10';\n readonly name: string;\n readonly canTransfer: boolean;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n readonly symbol: string;\n}\nexport interface Stx20CryptoAssetInfo extends BaseFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'stx20';\n readonly symbol: string;\n}\nexport type NativeCryptoAssetInfo = BtcCryptoAssetInfo | StxCryptoAssetInfo;\nexport type FungibleCryptoAssetInfo =\n | NativeCryptoAssetInfo\n | Sip10CryptoAssetInfo\n | Brc20CryptoAssetInfo\n | Src20CryptoAssetInfo\n | Stx20CryptoAssetInfo\n | RuneCryptoAssetInfo;\n\n// NFT asset types\ninterface BaseNonFungibleCryptoAssetInfo extends BaseCryptoAssetInfo {\n readonly category: 'nft';\n}\nexport interface InscriptionCryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'inscription';\n readonly id: string;\n readonly mimeType: InscriptionMimeType;\n readonly number: number;\n}\n\nexport interface StampCryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'bitcoin';\n readonly protocol: 'stamp';\n readonly stamp: number;\n readonly stampUrl: string;\n}\nexport interface Sip9CryptoAssetInfo extends BaseNonFungibleCryptoAssetInfo {\n readonly chain: 'stacks';\n readonly protocol: 'sip9';\n readonly name: string;\n readonly contractId: string;\n readonly imageCanonicalUri: string;\n}\nexport type NonFungibleCryptoAssetInfo =\n | InscriptionCryptoAssetInfo\n | StampCryptoAssetInfo\n | Sip9CryptoAssetInfo;\n\nexport type CryptoAssetInfo = FungibleCryptoAssetInfo | NonFungibleCryptoAssetInfo;\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_INSCRIPTIONS_API_URL = 'https://api.hiro.so/ordinals/v1/inscriptions';\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\nconst 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 }\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 { HIRO_INSCRIPTIONS_API_URL } from '../../network/network.model';\nimport {\n CryptoAssetCategories,\n CryptoAssetChains,\n CryptoAssetProtocols,\n InscriptionCryptoAssetInfo,\n} from '../crypto-asset-info.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 */\nconst 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\nexport function whenInscriptionMimeType<T>(\n mimeType: string,\n branches: { [k in InscriptionMimeType]?: () => T }\n) {\n if (mimeType.startsWith('audio/') && branches.audio) {\n return branches.audio();\n }\n\n if (mimeType.startsWith('text/html') && branches.html) {\n return branches.html();\n }\n\n if (mimeType.startsWith('image/svg') && branches.svg) {\n return branches.svg();\n }\n\n if (mimeType.startsWith('image/') && branches.image) {\n return branches.image();\n }\n\n if (mimeType.startsWith('text') && branches.text) {\n return branches.text();\n }\n\n if (mimeType.startsWith('video/') && branches.video) {\n return branches.video();\n }\n\n if (mimeType.startsWith('model/gltf') && branches.gltf) {\n return branches.gltf();\n }\n\n if (branches.other) return branches.other();\n\n throw new Error('Unhandled inscription type');\n}\nexport interface Inscription extends InscriptionCryptoAssetInfo {\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\ninterface RawInscription {\n id: string;\n number: number;\n output: string;\n contentType: string;\n txid: string;\n offset: string;\n address: string;\n genesisBlockHash: string;\n genesisTimestamp: number;\n genesisBlockHeight: number;\n value: string;\n}\n\nexport function createInscription(inscription: RawInscription): Inscription {\n const contentSrc = `${HIRO_INSCRIPTIONS_API_URL}/${inscription.id}/content`;\n const iframeSrc = `https://ordinals.com/preview/${inscription.id}`;\n const preview = `https://ordinals.hiro.so/inscription/${inscription.id}`;\n const title = `Inscription ${inscription.number}`;\n\n const sharedInfo = {\n chain: CryptoAssetChains.bitcoin,\n category: CryptoAssetCategories.nft,\n protocol: CryptoAssetProtocols.inscription,\n id: inscription.id,\n number: inscription.number,\n output: inscription.output,\n txid: inscription.txid,\n offset: inscription.offset,\n address: inscription.address,\n genesisBlockHash: inscription.genesisBlockHash,\n genesisTimestamp: inscription.genesisTimestamp,\n genesisBlockHeight: inscription.genesisBlockHeight,\n value: inscription.value,\n preview,\n title,\n };\n\n return whenInscriptionMimeType<Inscription>(inscription.contentType, {\n audio: () => ({\n ...sharedInfo,\n mimeType: 'audio',\n name: 'inscription',\n src: iframeSrc,\n }),\n gltf: () => ({\n ...sharedInfo,\n mimeType: 'gltf',\n name: 'inscription',\n src: iframeSrc,\n }),\n html: () => ({\n ...sharedInfo,\n mimeType: 'html',\n name: 'inscription',\n src: iframeSrc,\n }),\n image: () => ({\n ...sharedInfo,\n mimeType: 'image',\n name: 'inscription',\n src: contentSrc,\n }),\n svg: () => ({\n ...sharedInfo,\n mimeType: 'svg',\n name: 'inscription',\n src: iframeSrc,\n }),\n text: () => ({\n ...sharedInfo,\n mimeType: 'text',\n name: 'inscription',\n src: contentSrc,\n }),\n video: () => ({\n ...sharedInfo,\n mimeType: 'video',\n name: 'inscription',\n src: iframeSrc,\n }),\n other: () => ({\n ...sharedInfo,\n mimeType: 'other',\n name: 'inscription',\n src: '',\n }),\n });\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 { CryptoCurrency, FiatCurrency } from './currencies.model';\nimport type { Money } from './money.model';\n\ninterface MarketPair {\n readonly base: CryptoCurrency;\n readonly quote: FiatCurrency;\n}\n\nexport function createMarketPair(base: CryptoCurrency, quote: FiatCurrency): 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 { 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.string().email({ message: 'Invalid email address' });\nexport type EmailAddress = z.infer<typeof emailAddressSchema>;\n"],"mappings":";A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|
"name": "@leather.io/models",
|
|
3
3
|
"author": "Leather.io contact@leather.io",
|
|
4
4
|
"description": "Leather models and types",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.24.1",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/leather-io/mono/tree/dev/packages/models",
|
|
8
8
|
"repository": {
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"tsup": "8.1.0",
|
|
27
27
|
"typescript": "5.5.4",
|
|
28
28
|
"@leather.io/eslint-config": "0.7.0",
|
|
29
|
-
"@leather.io/
|
|
30
|
-
"@leather.io/
|
|
29
|
+
"@leather.io/prettier-config": "0.6.0",
|
|
30
|
+
"@leather.io/tsconfig-config": "0.6.0"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"leather",
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { Money } from '../money.model';
|
|
2
2
|
|
|
3
3
|
export interface BaseCryptoAssetBalance {
|
|
4
|
+
/**
|
|
5
|
+
* Balance as confirmed on chain
|
|
6
|
+
*/
|
|
7
|
+
readonly totalBalance: Money;
|
|
8
|
+
/**
|
|
9
|
+
* Balance of pending receipt into account given pending transactions
|
|
10
|
+
*/
|
|
11
|
+
readonly inboundBalance: Money;
|
|
12
|
+
/**
|
|
13
|
+
* Balance of pending delivery from account given pending transactions
|
|
14
|
+
*/
|
|
15
|
+
readonly outboundBalance: Money;
|
|
16
|
+
/**
|
|
17
|
+
* totalBalance plus inboundBalance minus outboundBalance
|
|
18
|
+
*/
|
|
19
|
+
readonly pendingBalance: Money;
|
|
4
20
|
/**
|
|
5
21
|
* totalBalance after filtering out outboundBalance, protectedBalance, and uneconomicalBalance
|
|
6
22
|
*/
|
|
@@ -24,25 +40,9 @@ export interface StxCryptoAssetBalance extends BaseCryptoAssetBalance {
|
|
|
24
40
|
*/
|
|
25
41
|
readonly availableUnlockedBalance: Money;
|
|
26
42
|
/**
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
29
|
-
readonly inboundBalance: Money;
|
|
30
|
-
/**
|
|
31
|
-
* totalBalance minus total amount locked by contracts
|
|
43
|
+
* total amount locked by contracts
|
|
32
44
|
*/
|
|
33
45
|
readonly lockedBalance: Money;
|
|
34
|
-
/**
|
|
35
|
-
* Balance of pending delivery from account given pending transactions
|
|
36
|
-
*/
|
|
37
|
-
readonly outboundBalance: Money;
|
|
38
|
-
/**
|
|
39
|
-
* totalBalance plus inboundBalance minus outboundBalance
|
|
40
|
-
*/
|
|
41
|
-
readonly pendingBalance: Money;
|
|
42
|
-
/**
|
|
43
|
-
* Balance as confirmed on chain
|
|
44
|
-
*/
|
|
45
|
-
readonly totalBalance: Money;
|
|
46
46
|
/**
|
|
47
47
|
* totalBalance minus lockedBalance
|
|
48
48
|
*/
|
|
@@ -53,7 +53,3 @@ export type CryptoAssetBalance =
|
|
|
53
53
|
| BaseCryptoAssetBalance
|
|
54
54
|
| BtcCryptoAssetBalance
|
|
55
55
|
| StxCryptoAssetBalance;
|
|
56
|
-
|
|
57
|
-
export function createCryptoAssetBalance(balance: Money): BaseCryptoAssetBalance {
|
|
58
|
-
return { availableBalance: balance };
|
|
59
|
-
}
|
|
@@ -226,8 +226,8 @@ export const defaultNetworksKeyedById: Record<
|
|
|
226
226
|
NetworkConfiguration
|
|
227
227
|
> = {
|
|
228
228
|
[WalletDefaultNetworkConfigurationIds.mainnet]: networkMainnet,
|
|
229
|
-
[WalletDefaultNetworkConfigurationIds.testnet]: networkTestnet,
|
|
230
229
|
[WalletDefaultNetworkConfigurationIds.testnet4]: networkTestnet4,
|
|
230
|
+
[WalletDefaultNetworkConfigurationIds.testnet]: networkTestnet,
|
|
231
231
|
[WalletDefaultNetworkConfigurationIds.signet]: networkSignet,
|
|
232
232
|
[WalletDefaultNetworkConfigurationIds.sbtcTestnet]: networkSbtcTestnet,
|
|
233
233
|
[WalletDefaultNetworkConfigurationIds.sbtcDevenv]: networkSbtcDevenv,
|