@exodus/asset-types 0.5.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/package.json +2 -2
- package/src/asset.d.ts +27 -17
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.7.0](https://github.com/ExodusMovement/assets/compare/@exodus/asset-types@0.6.0...@exodus/asset-types@0.7.0) (2026-05-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat(ethereum-api): warn on risky recipients for native ETH sends (#8110)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [0.6.0](https://github.com/ExodusMovement/assets/compare/@exodus/asset-types@0.5.1...@exodus/asset-types@0.6.0) (2026-05-18)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: add Asset type (#8070)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
* fix(asset-types): correct stakeable balance field spelling (#8097)
|
|
29
|
+
|
|
30
|
+
* fix: declare phantom dependencies across workspaces (#7833)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [0.5.1](https://github.com/ExodusMovement/assets/compare/@exodus/asset-types@0.5.0...@exodus/asset-types@0.5.1) (2026-03-26)
|
|
7
35
|
|
|
8
36
|
**Note:** Version bump only for package @exodus/asset-types
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/asset-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Typings for Assets",
|
|
5
5
|
"author": "Exodus Movement, Inc.",
|
|
6
6
|
"repository": {
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"access": "public",
|
|
43
43
|
"provenance": false
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "73ff97a75479c3b25fccc11f31879ec634818d63"
|
|
46
46
|
}
|
package/src/asset.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import type NumberUnit from '@exodus/currency'
|
|
4
4
|
import type KeyIdentifier from '@exodus/key-identifier'
|
|
5
5
|
import type { AccountState, Tx, TxSet } from '@exodus/models'
|
|
6
|
-
import type BN from 'bn.js'
|
|
7
6
|
|
|
8
7
|
import type { AssetMeta } from './asset-meta.js'
|
|
9
8
|
import type { WalletAccountLike } from './common.js'
|
|
@@ -61,7 +60,7 @@ export type BalanceFieldName =
|
|
|
61
60
|
| 'networkReserve'
|
|
62
61
|
| 'staking'
|
|
63
62
|
| 'staked'
|
|
64
|
-
| '
|
|
63
|
+
| 'stakeable'
|
|
65
64
|
| 'unstaking'
|
|
66
65
|
| 'unstaked'
|
|
67
66
|
| 'rewards'
|
|
@@ -69,19 +68,12 @@ export type BalanceFieldName =
|
|
|
69
68
|
|
|
70
69
|
export type Balances = Record<BalanceFieldName, NumberUnit>
|
|
71
70
|
|
|
72
|
-
export type UnsignedTxPayload
|
|
73
|
-
txData: Extendable<
|
|
74
|
-
to: string
|
|
75
|
-
amount: NumberValue
|
|
76
|
-
fee: NumberValue
|
|
77
|
-
gasPrice: NumberValue
|
|
78
|
-
gasLimit: NumberValue
|
|
79
|
-
nonce: NumberValue
|
|
80
|
-
}>
|
|
71
|
+
export type UnsignedTxPayload = {
|
|
72
|
+
txData: Extendable<object>
|
|
81
73
|
txMeta: Extendable<{
|
|
82
74
|
assetName: string
|
|
83
75
|
}>
|
|
84
|
-
}
|
|
76
|
+
}
|
|
85
77
|
|
|
86
78
|
export type SignTransactionParams = Extendable<{
|
|
87
79
|
assetName: string
|
|
@@ -165,6 +157,20 @@ export type AssetAddress = {
|
|
|
165
157
|
|
|
166
158
|
export type SignMessageParams<M = string> = { message: M; signer: Signer }
|
|
167
159
|
|
|
160
|
+
export type CheckTxPayload = Extendable<{
|
|
161
|
+
chain: number | string
|
|
162
|
+
fromAddress: string
|
|
163
|
+
toAddress: string
|
|
164
|
+
value: string
|
|
165
|
+
input?: string
|
|
166
|
+
hash?: string
|
|
167
|
+
}>
|
|
168
|
+
|
|
169
|
+
export type CheckTxResult = {
|
|
170
|
+
action: 'WARN' | 'NONE'
|
|
171
|
+
reason?: string
|
|
172
|
+
}
|
|
173
|
+
|
|
168
174
|
export type AssetApi = CommonAssetApi & {
|
|
169
175
|
addressHasHistory?: (address: string) => Promise<boolean>
|
|
170
176
|
broadcastTx: (rawTx: Buffer) => Promise<any>
|
|
@@ -182,6 +188,7 @@ export type AssetApi = CommonAssetApi & {
|
|
|
182
188
|
getSupportedPurposes?: (params?: GetSupportedPurposesParams) => number[]
|
|
183
189
|
moveFunds?: MoveFunds
|
|
184
190
|
sendTx(params: TxSendParams): Promise<IdentifiableTx>
|
|
191
|
+
checkTx?: (payload: CheckTxPayload) => Promise<CheckTxResult>
|
|
185
192
|
signHardware?: (params: SignHardwareTxParams) => Promise<any>
|
|
186
193
|
signMessage?<M = string>(params: SignMessageParams<M>): Promise<any>
|
|
187
194
|
signTx(params: SignTxParams): Promise<any>
|
|
@@ -210,11 +217,12 @@ export type AbstractAsset = AssetMeta & {
|
|
|
210
217
|
toString(): string
|
|
211
218
|
}
|
|
212
219
|
|
|
213
|
-
export type CombinedAsset<A extends BaseAsset | TokenAsset = BaseAsset | TokenAsset> =
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
220
|
+
export type CombinedAsset<A extends BaseAsset | TokenAsset = BaseAsset | TokenAsset> =
|
|
221
|
+
AbstractAsset & {
|
|
222
|
+
isCombined: true
|
|
223
|
+
combinedAssets: A[]
|
|
224
|
+
combinedAssetNames: A['name'][]
|
|
225
|
+
}
|
|
218
226
|
|
|
219
227
|
export type BaseAsset = AbstractAsset & {
|
|
220
228
|
api: AssetApi
|
|
@@ -225,6 +233,8 @@ export type TokenAsset = AbstractAsset & {
|
|
|
225
233
|
api: CommonAssetApi
|
|
226
234
|
}
|
|
227
235
|
|
|
236
|
+
export type Asset = BaseAsset | TokenAsset | CombinedAsset
|
|
237
|
+
|
|
228
238
|
export type AddressOverrideCallbackParams<A extends BaseAsset = BaseAsset> = { asset: A }
|
|
229
239
|
|
|
230
240
|
export type CreateAssetParams<A extends BaseAsset = BaseAsset, C = unknown> = {
|