@lifi/types 17.79.0-beta.2 → 17.79.0-beta.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/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 +58 -6
- package/src/_types/step.d.ts.map +1 -1
- package/src/step.ts +63 -6
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":";;;AAiPA,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":"AA8IA,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,16 +1,44 @@
|
|
|
1
1
|
import type { TypedData, TransactionRequest, SignedTypedData, ExecutionType } from './api.js';
|
|
2
2
|
import type { Token } from './tokens/index.js';
|
|
3
|
-
|
|
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
|
+
*/
|
|
19
|
+
export type FeeSplitType = 'FIXED' | 'SHARED' | 'DYNAMIC' | 'INTERMEDIARY' | 'DISTRIBUTION';
|
|
4
20
|
export interface FeeRecipient {
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
+
*/
|
|
32
|
+
name: string;
|
|
9
33
|
/** Absolute fee amount, in source token base units (string-encoded). */
|
|
10
34
|
fee: string;
|
|
11
35
|
/**
|
|
12
|
-
*
|
|
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.
|
|
13
39
|
*/
|
|
40
|
+
type?: FeeSplitType;
|
|
41
|
+
/** Recipient wallet address on the source chain. */
|
|
14
42
|
walletAddress?: string;
|
|
15
43
|
}
|
|
16
44
|
export interface FeeCost {
|
|
@@ -22,9 +50,33 @@ export interface FeeCost {
|
|
|
22
50
|
amountUSD: string;
|
|
23
51
|
included: boolean;
|
|
24
52
|
feeSplit?: {
|
|
53
|
+
/** Sum of LI.FI's portion of the fee. */
|
|
25
54
|
lifiFee: string;
|
|
55
|
+
/**
|
|
56
|
+
* Aggregate of every non-LI.FI recipient (integrator + intermediary +
|
|
57
|
+
* any distribution entries). Provided for backward compatibility with
|
|
58
|
+
* 2-recipient consumers; new consumers should iterate `recipients`.
|
|
59
|
+
*
|
|
60
|
+
* NOTE: this value already includes `intermediaryFee` (and any
|
|
61
|
+
* distribution-recipient amounts). The legacy aggregate fields are
|
|
62
|
+
* not disjoint — never compute `lifiFee + integratorFee + intermediaryFee`
|
|
63
|
+
* to derive the parent `FeeCost.amount`; that double-counts the
|
|
64
|
+
* intermediary. The parent `amount` is the total.
|
|
65
|
+
*/
|
|
26
66
|
integratorFee: string;
|
|
67
|
+
/**
|
|
68
|
+
* Sum of the intermediary recipient's portion when `type === 'INTERMEDIARY'`
|
|
69
|
+
* is present in `recipients`. Absent when no intermediary participates.
|
|
70
|
+
*
|
|
71
|
+
* NOTE: this value is also included in `integratorFee` above. Provided
|
|
72
|
+
* separately for consumers that need to attribute the intermediary slice
|
|
73
|
+
* without iterating `recipients`.
|
|
74
|
+
*/
|
|
27
75
|
intermediaryFee?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Per-recipient fee breakdown. Source of truth for new consumers; the
|
|
78
|
+
* aggregate fields above are derived sums kept for backward compatibility.
|
|
79
|
+
*/
|
|
28
80
|
recipients?: FeeRecipient[];
|
|
29
81
|
};
|
|
30
82
|
}
|
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,
|
|
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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AA;CACnB;AAED,MAAM,WAAW,UAAW,SAAQ,QAAQ;IAC1C,IAAI,EAAE,QAAQ,CAAA;IACd,MAAM,EAAE,UAAU,CAAA;IAClB,QAAQ,EAAE,QAAQ,CAAA;CACnB;AAED,MAAM,MAAM,IAAI,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,YAAY,CAAA;AAEnE,MAAM,WAAW,QAAS,SAAQ,IAAI,CAAC,IAAI,EAAE,MAAM,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,18 +6,51 @@ import type {
|
|
|
6
6
|
} from './api.js'
|
|
7
7
|
import type { Token } from './tokens/index.js'
|
|
8
8
|
|
|
9
|
-
|
|
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
|
+
*/
|
|
25
|
+
export type FeeSplitType =
|
|
26
|
+
| 'FIXED'
|
|
27
|
+
| 'SHARED'
|
|
28
|
+
| 'DYNAMIC'
|
|
29
|
+
| 'INTERMEDIARY'
|
|
30
|
+
| 'DISTRIBUTION'
|
|
10
31
|
|
|
11
32
|
export interface FeeRecipient {
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
+
*/
|
|
44
|
+
name: string
|
|
16
45
|
/** Absolute fee amount, in source token base units (string-encoded). */
|
|
17
46
|
fee: string
|
|
18
47
|
/**
|
|
19
|
-
*
|
|
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.
|
|
20
51
|
*/
|
|
52
|
+
type?: FeeSplitType
|
|
53
|
+
/** Recipient wallet address on the source chain. */
|
|
21
54
|
walletAddress?: string
|
|
22
55
|
}
|
|
23
56
|
|
|
@@ -30,9 +63,33 @@ export interface FeeCost {
|
|
|
30
63
|
amountUSD: string
|
|
31
64
|
included: boolean
|
|
32
65
|
feeSplit?: {
|
|
66
|
+
/** Sum of LI.FI's portion of the fee. */
|
|
33
67
|
lifiFee: string
|
|
68
|
+
/**
|
|
69
|
+
* Aggregate of every non-LI.FI recipient (integrator + intermediary +
|
|
70
|
+
* any distribution entries). Provided for backward compatibility with
|
|
71
|
+
* 2-recipient consumers; new consumers should iterate `recipients`.
|
|
72
|
+
*
|
|
73
|
+
* NOTE: this value already includes `intermediaryFee` (and any
|
|
74
|
+
* distribution-recipient amounts). The legacy aggregate fields are
|
|
75
|
+
* not disjoint — never compute `lifiFee + integratorFee + intermediaryFee`
|
|
76
|
+
* to derive the parent `FeeCost.amount`; that double-counts the
|
|
77
|
+
* intermediary. The parent `amount` is the total.
|
|
78
|
+
*/
|
|
34
79
|
integratorFee: string
|
|
80
|
+
/**
|
|
81
|
+
* Sum of the intermediary recipient's portion when `type === 'INTERMEDIARY'`
|
|
82
|
+
* is present in `recipients`. Absent when no intermediary participates.
|
|
83
|
+
*
|
|
84
|
+
* NOTE: this value is also included in `integratorFee` above. Provided
|
|
85
|
+
* separately for consumers that need to attribute the intermediary slice
|
|
86
|
+
* without iterating `recipients`.
|
|
87
|
+
*/
|
|
35
88
|
intermediaryFee?: string
|
|
89
|
+
/**
|
|
90
|
+
* Per-recipient fee breakdown. Source of truth for new consumers; the
|
|
91
|
+
* aggregate fields above are derived sums kept for backward compatibility.
|
|
92
|
+
*/
|
|
36
93
|
recipients?: FeeRecipient[]
|
|
37
94
|
}
|
|
38
95
|
}
|