@exodus/asset-types 0.2.3 → 0.2.4

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 CHANGED
@@ -3,6 +3,16 @@
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.2.4](https://github.com/ExodusMovement/assets/compare/@exodus/asset-types@0.2.3...@exodus/asset-types@0.2.4) (2025-02-07)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+
12
+ * fix: require either signer or private key (#5016)
13
+
14
+
15
+
6
16
  ## [0.2.3](https://github.com/ExodusMovement/assets/compare/@exodus/asset-types@0.2.2...@exodus/asset-types@0.2.3) (2025-02-07)
7
17
 
8
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/asset-types",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Typings for Assets",
5
5
  "author": "Exodus Movement, Inc.",
6
6
  "repository": {
@@ -23,7 +23,8 @@
23
23
  },
24
24
  "scripts": {
25
25
  "lint": "run -T eslint .",
26
- "lint:fix": "yarn lint --fix"
26
+ "lint:fix": "yarn lint --fix",
27
+ "test": "tsc && echo"
27
28
  },
28
29
  "bugs": {
29
30
  "url": "https://github.com/ExodusMovement/assets/issues?q=is%3Aissue+is%3Aopen+label%3Aasset-types"
@@ -31,5 +32,5 @@
31
32
  "devDependencies": {
32
33
  "@types/bn.js": "^5"
33
34
  },
34
- "gitHead": "6cac727a12afc44b363ab1c5e82b32bbed71d1f0"
35
+ "gitHead": "fb14012ea166f96ea8eb3f7bc9038bdcb10a71be"
35
36
  }
package/src/asset.d.ts CHANGED
@@ -7,7 +7,7 @@ import type BN from 'bn.js'
7
7
 
8
8
  import type { AssetMeta } from './asset-meta.js'
9
9
  import type { CreateFeeMonitorApi } from './fee-monitor.js'
10
- import type { Extendable, FreeForm, RequireOnly, WithRequired } from './helpers.js'
10
+ import type { Extendable, FreeForm, RequireOnly, WithRequired, XOR } from './helpers.js'
11
11
  import type { HistoryMonitor } from './history-monitor.js'
12
12
  import type { Logger } from './logger.js'
13
13
  import type { MoveFunds } from './move-funds.js'
@@ -138,9 +138,8 @@ export type SignTxParams = Extendable<{
138
138
  txHex?: string
139
139
  partialSign?: boolean
140
140
  hdkeys?: HDKeysMap
141
- privateKey: string
142
- signer?: Signer
143
- }>
141
+ }> &
142
+ XOR<{ privateKey: string }, { signer: Signer }>
144
143
 
145
144
  export type CommonAssetApi = {
146
145
  features: ApiFeatures
package/src/helpers.d.ts CHANGED
@@ -15,3 +15,10 @@ export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] }
15
15
  * Make a set of keys of a given target type required, while making all other optional
16
16
  */
17
17
  export type RequireOnly<T, Keys extends keyof T> = Partial<T> & Pick<WithRequired<T, Keys>, Keys>
18
+
19
+ /**
20
+ * Exclusive OR
21
+ */
22
+ export type XOR<T, U> =
23
+ | (T & Partial<Record<Exclude<keyof U, keyof T>, never>>)
24
+ | (U & Partial<Record<Exclude<keyof T, keyof U>, never>>)