@lifi/types 17.79.0-beta.3 → 17.79.0-beta.5
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/package.json +1 -1
- package/src/_cjs/step.js.map +1 -1
- package/src/_esm/step.js.map +1 -1
- package/src/_types/step.d.ts +48 -2
- package/src/_types/step.d.ts.map +1 -1
- package/src/step.ts +48 -2
package/package.json
CHANGED
package/src/_cjs/step.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.js","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":";;;AAyOA,gCAEC;AAED,kCAEC;AAED,wCAEC;AAED,oCAEC;AAhHY,QAAA,SAAS,GAAG;IACvB,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAA;AA4FV,SAAgB,UAAU,CAAC,IAAU;IACnC,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAA;AAC7B,CAAC;AAED,SAAgB,WAAW,CAAC,IAAU;IACpC,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,CAAA;AAC9B,CAAC;AAED,SAAgB,cAAc,CAAC,IAAU;IACvC,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;AACjC,CAAC;AAED,SAAgB,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAA;AAC/B,CAAC"}
|
package/src/_esm/step.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.js","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":"AAsIA,OAAO;AACP,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,MAAM;IACN,MAAM;IACN,OAAO;IACP,UAAU;IACV,QAAQ;CACA,CAAA;AA4FV,MAAM,UAAU,UAAU,CAAC,IAAU;IACnC,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAA;AAC7B,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAU;IACpC,OAAO,IAAI,CAAC,IAAI,KAAK,OAAO,CAAA;AAC9B,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAU;IACvC,OAAO,IAAI,CAAC,IAAI,KAAK,UAAU,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAU;IACrC,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAA;AAC/B,CAAC"}
|
package/src/_types/step.d.ts
CHANGED
|
@@ -1,12 +1,42 @@
|
|
|
1
1
|
import type { TypedData, TransactionRequest, SignedTypedData, ExecutionType } from './api.js';
|
|
2
2
|
import type { Token } from './tokens/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* How a fee was calculated / the role of the recipient in the split.
|
|
5
|
+
*
|
|
6
|
+
* - `FIXED` — a fixed LI.FI cut applied alongside the integrator's own fee.
|
|
7
|
+
* - `SHARED` — a single shared pool divided between LI.FI and the integrator.
|
|
8
|
+
* - `DYNAMIC` — fee resolved at quote time from configured rules (e.g. dynamic
|
|
9
|
+
* stablecoin pricing).
|
|
10
|
+
* - `INTERMEDIARY` — a third-party recipient that carves a configured share
|
|
11
|
+
* from the integrator pool (e.g. a widget or aggregator).
|
|
12
|
+
* - `DISTRIBUTION` — a partner-specified extra recipient added in parallel to
|
|
13
|
+
* the integrator/intermediary split via the `distributionFees` request param.
|
|
14
|
+
*
|
|
15
|
+
* The union is expected to grow over time. When pattern-matching with a
|
|
16
|
+
* `switch`, always include a `default` branch so adding a new value remains
|
|
17
|
+
* a non-breaking minor for consumers.
|
|
18
|
+
*/
|
|
3
19
|
export type FeeSplitType = 'FIXED' | 'SHARED' | 'DYNAMIC' | 'INTERMEDIARY' | 'DISTRIBUTION';
|
|
4
20
|
export interface FeeRecipient {
|
|
5
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* Recipient identifier. Polymorphic — interpret in conjunction with `type`:
|
|
23
|
+
* - `'lifi'` for the LI.FI platform recipient,
|
|
24
|
+
* - the integrator id (e.g. `'jumper'`) for the integrator recipient,
|
|
25
|
+
* - the intermediary id (e.g. `'mesh'`) when `type === 'INTERMEDIARY'`,
|
|
26
|
+
* - the recipient wallet address when `type === 'DISTRIBUTION'`.
|
|
27
|
+
*
|
|
28
|
+
* Do not display this value directly in user-facing UI without
|
|
29
|
+
* `type`-aware formatting — for `DISTRIBUTION` rows the value is a
|
|
30
|
+
* raw hex address.
|
|
31
|
+
*/
|
|
6
32
|
name: string;
|
|
7
33
|
/** Absolute fee amount, in source token base units (string-encoded). */
|
|
8
34
|
fee: string;
|
|
9
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* Fee calculation type. Absent when not statically determinable (e.g.
|
|
37
|
+
* an integrator entry whose `feeType` could not be resolved from the
|
|
38
|
+
* matching planned fee cost). Consumers should null-check before reading.
|
|
39
|
+
*/
|
|
10
40
|
type?: FeeSplitType;
|
|
11
41
|
/** Recipient wallet address on the source chain. */
|
|
12
42
|
walletAddress?: string;
|
|
@@ -20,9 +50,25 @@ export interface FeeCost {
|
|
|
20
50
|
amountUSD: string;
|
|
21
51
|
included: boolean;
|
|
22
52
|
feeSplit?: {
|
|
53
|
+
/** LI.FI's slice of the fee. */
|
|
23
54
|
lifiFee: string;
|
|
55
|
+
/**
|
|
56
|
+
* The integrator's slice of the fee — the integrator's portion only,
|
|
57
|
+
* NOT including any intermediary or distribution-recipient amounts.
|
|
58
|
+
*/
|
|
24
59
|
integratorFee: string;
|
|
60
|
+
/**
|
|
61
|
+
* The intermediary's slice when an intermediary participates in the
|
|
62
|
+
* split. Absent otherwise.
|
|
63
|
+
*/
|
|
25
64
|
intermediaryFee?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Per-recipient fee breakdown. Source of truth for new consumers — the
|
|
67
|
+
* aggregate fields above are disjoint slices kept for backward
|
|
68
|
+
* compatibility with 2-recipient consumers and can be summed alongside
|
|
69
|
+
* `recipients[]` of `type: 'DISTRIBUTION'` entries to derive the parent
|
|
70
|
+
* `FeeCost.amount`. New consumers should iterate `recipients` directly.
|
|
71
|
+
*/
|
|
26
72
|
recipients?: FeeRecipient[];
|
|
27
73
|
};
|
|
28
74
|
}
|
package/src/_types/step.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,QAAQ,GACR,SAAS,GACT,cAAc,GACd,cAAc,CAAA;AAElB,MAAM,WAAW,YAAY;IAC3B
|
|
1
|
+
{"version":3,"file":"step.d.ts","sourceRoot":"","sources":["../step.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,kBAAkB,EAClB,eAAe,EACf,aAAa,EACd,MAAM,UAAU,CAAA;AACjB,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,YAAY,GACpB,OAAO,GACP,QAAQ,GACR,SAAS,GACT,cAAc,GACd,cAAc,CAAA;AAElB,MAAM,WAAW,YAAY;IAC3B;;;;;;;;;;OAUG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAA;IACnB,oDAAoD;IACpD,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAA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AM,CAAC;IAClD,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,IAAI,EAAE,CAAA;CACtB;AAED,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,SAAS,EAAE,eAAe,EAAE,CAAA;CAC7B;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,SAAS,CAEzD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,YAAY,CAE/D;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,UAAU,CAE3D"}
|
package/src/step.ts
CHANGED
|
@@ -6,6 +6,22 @@ import type {
|
|
|
6
6
|
} from './api.js'
|
|
7
7
|
import type { Token } from './tokens/index.js'
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* How a fee was calculated / the role of the recipient in the split.
|
|
11
|
+
*
|
|
12
|
+
* - `FIXED` — a fixed LI.FI cut applied alongside the integrator's own fee.
|
|
13
|
+
* - `SHARED` — a single shared pool divided between LI.FI and the integrator.
|
|
14
|
+
* - `DYNAMIC` — fee resolved at quote time from configured rules (e.g. dynamic
|
|
15
|
+
* stablecoin pricing).
|
|
16
|
+
* - `INTERMEDIARY` — a third-party recipient that carves a configured share
|
|
17
|
+
* from the integrator pool (e.g. a widget or aggregator).
|
|
18
|
+
* - `DISTRIBUTION` — a partner-specified extra recipient added in parallel to
|
|
19
|
+
* the integrator/intermediary split via the `distributionFees` request param.
|
|
20
|
+
*
|
|
21
|
+
* The union is expected to grow over time. When pattern-matching with a
|
|
22
|
+
* `switch`, always include a `default` branch so adding a new value remains
|
|
23
|
+
* a non-breaking minor for consumers.
|
|
24
|
+
*/
|
|
9
25
|
export type FeeSplitType =
|
|
10
26
|
| 'FIXED'
|
|
11
27
|
| 'SHARED'
|
|
@@ -14,11 +30,25 @@ export type FeeSplitType =
|
|
|
14
30
|
| 'DISTRIBUTION'
|
|
15
31
|
|
|
16
32
|
export interface FeeRecipient {
|
|
17
|
-
/**
|
|
33
|
+
/**
|
|
34
|
+
* Recipient identifier. Polymorphic — interpret in conjunction with `type`:
|
|
35
|
+
* - `'lifi'` for the LI.FI platform recipient,
|
|
36
|
+
* - the integrator id (e.g. `'jumper'`) for the integrator recipient,
|
|
37
|
+
* - the intermediary id (e.g. `'mesh'`) when `type === 'INTERMEDIARY'`,
|
|
38
|
+
* - the recipient wallet address when `type === 'DISTRIBUTION'`.
|
|
39
|
+
*
|
|
40
|
+
* Do not display this value directly in user-facing UI without
|
|
41
|
+
* `type`-aware formatting — for `DISTRIBUTION` rows the value is a
|
|
42
|
+
* raw hex address.
|
|
43
|
+
*/
|
|
18
44
|
name: string
|
|
19
45
|
/** Absolute fee amount, in source token base units (string-encoded). */
|
|
20
46
|
fee: string
|
|
21
|
-
/**
|
|
47
|
+
/**
|
|
48
|
+
* Fee calculation type. Absent when not statically determinable (e.g.
|
|
49
|
+
* an integrator entry whose `feeType` could not be resolved from the
|
|
50
|
+
* matching planned fee cost). Consumers should null-check before reading.
|
|
51
|
+
*/
|
|
22
52
|
type?: FeeSplitType
|
|
23
53
|
/** Recipient wallet address on the source chain. */
|
|
24
54
|
walletAddress?: string
|
|
@@ -33,9 +63,25 @@ export interface FeeCost {
|
|
|
33
63
|
amountUSD: string
|
|
34
64
|
included: boolean
|
|
35
65
|
feeSplit?: {
|
|
66
|
+
/** LI.FI's slice of the fee. */
|
|
36
67
|
lifiFee: string
|
|
68
|
+
/**
|
|
69
|
+
* The integrator's slice of the fee — the integrator's portion only,
|
|
70
|
+
* NOT including any intermediary or distribution-recipient amounts.
|
|
71
|
+
*/
|
|
37
72
|
integratorFee: string
|
|
73
|
+
/**
|
|
74
|
+
* The intermediary's slice when an intermediary participates in the
|
|
75
|
+
* split. Absent otherwise.
|
|
76
|
+
*/
|
|
38
77
|
intermediaryFee?: string
|
|
78
|
+
/**
|
|
79
|
+
* Per-recipient fee breakdown. Source of truth for new consumers — the
|
|
80
|
+
* aggregate fields above are disjoint slices kept for backward
|
|
81
|
+
* compatibility with 2-recipient consumers and can be summed alongside
|
|
82
|
+
* `recipients[]` of `type: 'DISTRIBUTION'` entries to derive the parent
|
|
83
|
+
* `FeeCost.amount`. New consumers should iterate `recipients` directly.
|
|
84
|
+
*/
|
|
39
85
|
recipients?: FeeRecipient[]
|
|
40
86
|
}
|
|
41
87
|
}
|