@agoric/zoe 0.26.3-dev-a2c6d29.0 → 0.26.3-dev-8e82183.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/bundles/bundle-contractFacet-js-meta.json +86 -86
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +0 -1
- package/package.json +16 -16
- package/src/contractSupport/priceAuthority.d.ts +2 -0
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +4 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts +1 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +4 -0
- package/src/contractSupport/priceAuthorityTransform.d.ts +3 -1
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +4 -1
- package/src/contractSupport/priceQuote.d.ts +2 -0
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +4 -0
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +5 -1
- package/src/contracts/callSpread/payoffHandler.js +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +1 -0
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +5 -1
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/close.js +1 -1
- package/src/contracts/loan/index.d.ts +4 -0
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +6 -6
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +5 -5
- package/src/contracts/priceAggregator.d.ts +2 -2
- package/src/contracts/priceAggregator.js +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +2 -1
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +4 -0
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/tools/fakePriceAuthority.d.ts +1 -0
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +3 -1
- package/tools/manualPriceAuthority.d.ts +4 -0
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +4 -0
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +0 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +4 -0
- package/tools/types.js +2 -2
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
package/tools/types.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"oBACa,MAAM,GAAG,OAAO;2CAKlB,YAAY,KACV,OAAO,CAAC,UAAU,CAAC;;qBAKlB,MAAM,IAAI;0BACT,oBAAoB;;;;;;;;eAQrB,KAAK;gBACL,KAAK;;;;;;;;;;;;;yCAcR,KAAK,SACL,MAAM,CAAC,K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M,EAAE,QAAQ,EAAE,KAAK,KAAK,MAAM;;;;;oBAG7C,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,MAAM;;;;;uBAG7C,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC"}
|
package/tools/types-ambient.d.ts
DELETED
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
type PriceQuote = {
|
|
2
|
-
/**
|
|
3
|
-
* Amount whose value is a PriceQuoteValue
|
|
4
|
-
*/
|
|
5
|
-
quoteAmount: Amount<"set">;
|
|
6
|
-
/**
|
|
7
|
-
* The `quoteAmount` wrapped as a payment
|
|
8
|
-
*/
|
|
9
|
-
quotePayment: ERef<Payment<"set">>;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* A single-valued set of PriceDescriptions. This is the `value` in
|
|
13
|
-
* PriceQuote.quoteAmount (`{ brand, value: PriceQuoteValue }`).
|
|
14
|
-
*/
|
|
15
|
-
type PriceQuoteValue = [PriceDescription];
|
|
16
|
-
/**
|
|
17
|
-
* A description of a single quote
|
|
18
|
-
*/
|
|
19
|
-
type PriceDescription = {
|
|
20
|
-
/**
|
|
21
|
-
* The amount supplied to a trade
|
|
22
|
-
*/
|
|
23
|
-
amountIn: Amount<"nat">;
|
|
24
|
-
/**
|
|
25
|
-
* The quoted result of trading `amountIn`
|
|
26
|
-
*/
|
|
27
|
-
amountOut: Amount<"nat">;
|
|
28
|
-
/**
|
|
29
|
-
* The service that gave the `timestamp`
|
|
30
|
-
*/
|
|
31
|
-
timer: import("@agoric/time").TimerService;
|
|
32
|
-
/**
|
|
33
|
-
* A timestamp according to `timer` for the quote
|
|
34
|
-
*/
|
|
35
|
-
timestamp: import("@agoric/time").TimestampRecord;
|
|
36
|
-
/**
|
|
37
|
-
* Additional conditions for the quote
|
|
38
|
-
*/
|
|
39
|
-
conditions?: any;
|
|
40
|
-
};
|
|
41
|
-
type PriceQuoteCreate = (priceQuery: PriceQuery) => ERef<PriceQuote> | undefined;
|
|
42
|
-
type PriceQuoteTrigger = (createQuote: PriceQuoteCreate) => any;
|
|
43
|
-
type PriceAuthorityAdmin = {
|
|
44
|
-
fireTriggers: (createQuote: PriceQuoteCreate) => Promise<void>;
|
|
45
|
-
};
|
|
46
|
-
type PriceAuthorityKit = {
|
|
47
|
-
priceAuthority: PriceAuthority;
|
|
48
|
-
adminFacet: PriceAuthorityAdmin;
|
|
49
|
-
};
|
|
50
|
-
type MutableQuote = {
|
|
51
|
-
cancel: (reason?: any) => void;
|
|
52
|
-
updateLevel: (amountIn: Amount<"nat">, amountOut: Amount<"nat">) => void;
|
|
53
|
-
getPromise: () => ERef<PriceQuote>;
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* An object that mints PriceQuotes and handles
|
|
57
|
-
* triggers and notifiers for changes in the price
|
|
58
|
-
*/
|
|
59
|
-
type PriceAuthority = {
|
|
60
|
-
/**
|
|
61
|
-
* Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
|
|
62
|
-
*/
|
|
63
|
-
getQuoteIssuer: (brandIn: Brand, brandOut: Brand) => ERef<Issuer<"set">>;
|
|
64
|
-
/**
|
|
65
|
-
* Get the timer used in PriceQuotes for a given brandIn/brandOut pair
|
|
66
|
-
*/
|
|
67
|
-
getTimerService: (brandIn: Brand, brandOut: Brand) => ERef<import("@agoric/time").TimerService>;
|
|
68
|
-
/**
|
|
69
|
-
* Be notified of the latest PriceQuotes for a given
|
|
70
|
-
* `amountIn`. The rate at which these are issued may be very different between
|
|
71
|
-
* `priceAuthorities`.
|
|
72
|
-
*/
|
|
73
|
-
makeQuoteNotifier: (amountIn: Amount<"nat">, brandOut: Brand<"nat">) => ERef<Notifier<PriceQuote>>;
|
|
74
|
-
/**
|
|
75
|
-
* Resolves after `deadline` passes on the
|
|
76
|
-
* priceAuthority's timerService with the price quote of `amountIn` at that time
|
|
77
|
-
*/
|
|
78
|
-
quoteAtTime: (deadline: import("@agoric/time").Timestamp, amountIn: Amount<"nat">, brandOut: Brand<"nat">) => Promise<PriceQuote>;
|
|
79
|
-
/**
|
|
80
|
-
* Get a quote corresponding to the specified amountIn
|
|
81
|
-
*/
|
|
82
|
-
quoteGiven: (amountIn: Amount<"nat">, brandOut: Brand<"nat">) => Promise<PriceQuote>;
|
|
83
|
-
/**
|
|
84
|
-
* Get a quote corresponding to the specified amountOut
|
|
85
|
-
*/
|
|
86
|
-
quoteWanted: (brandIn: Brand<"nat">, amountOut: Amount<"nat">) => Promise<PriceQuote>;
|
|
87
|
-
/**
|
|
88
|
-
* Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
|
|
89
|
-
*/
|
|
90
|
-
quoteWhenGT: (amountIn: Amount<"nat">, amountOutLimit: Amount<"nat">) => Promise<PriceQuote>;
|
|
91
|
-
/**
|
|
92
|
-
* Resolve when a price quote of `amountIn` reaches or exceeds `amountOutLimit`
|
|
93
|
-
*/
|
|
94
|
-
quoteWhenGTE: (amountIn: Amount<"nat">, amountOutLimit: Amount<"nat">) => Promise<PriceQuote>;
|
|
95
|
-
/**
|
|
96
|
-
* Resolve when a price quote of `amountIn` reaches or drops below
|
|
97
|
-
* `amountOutLimit`
|
|
98
|
-
*/
|
|
99
|
-
quoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
|
|
100
|
-
/**
|
|
101
|
-
* Resolve when the price quote of `amountIn` drops below `amountOutLimit`
|
|
102
|
-
*/
|
|
103
|
-
quoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => Promise<PriceQuote>;
|
|
104
|
-
/**
|
|
105
|
-
* Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
|
|
106
|
-
*/
|
|
107
|
-
mutableQuoteWhenGT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
|
|
108
|
-
/**
|
|
109
|
-
* Resolve when a price quote of `amountIn` reaches or exceeds
|
|
110
|
-
* `amountOutLimit`
|
|
111
|
-
*/
|
|
112
|
-
mutableQuoteWhenGTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
|
|
113
|
-
/**
|
|
114
|
-
* Resolve when a price quote of `amountIn` reaches or drops below
|
|
115
|
-
* `amountOutLimit`
|
|
116
|
-
*/
|
|
117
|
-
mutableQuoteWhenLTE: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
|
|
118
|
-
/**
|
|
119
|
-
* Resolve when the price quote of `amountIn` drops below `amountOutLimit`
|
|
120
|
-
*/
|
|
121
|
-
mutableQuoteWhenLT: (amountIn: Amount, amountOutLimit: Amount) => ERef<MutableQuote>;
|
|
122
|
-
};
|
|
123
|
-
type PriceCalculator = (amount: Amount<"nat">) => Amount<"nat">;
|
|
124
|
-
type PriceQuery = (calcAmountIn: PriceCalculator, calcAmountOut: PriceCalculator) => {
|
|
125
|
-
amountIn: Amount<"nat">;
|
|
126
|
-
amountOut: Amount<"nat">;
|
|
127
|
-
timestamp?: import("@agoric/time").TimestampRecord;
|
|
128
|
-
} | undefined;
|
|
129
|
-
/**
|
|
130
|
-
* A description of a single quote
|
|
131
|
-
*/
|
|
132
|
-
type PriceLevel = {
|
|
133
|
-
/**
|
|
134
|
-
* The amount supplied to a trade
|
|
135
|
-
*/
|
|
136
|
-
amountIn: Amount<"nat">;
|
|
137
|
-
/**
|
|
138
|
-
* The quoted result of trading `amountIn`
|
|
139
|
-
*/
|
|
140
|
-
amountOut: Amount<"nat">;
|
|
141
|
-
};
|
|
142
|
-
//# sourceMappingURL=types-ambient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";;;;iBAIc,MAAM,CAAC,KAAK,CAAC;;;;kBAEb,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;;;;;;uBAKrB,CAAC,gBAAgB,CAAC;;;;;;;;cAQjB,MAAM,CAAC,KAAK,CAAC;;;;eAEb,MAAM,CAAC,KAAK,CAAC;;;;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@@ -1,160 +0,0 @@
|
|
|
1
|
-
// @jessie-check
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @typedef {object} PriceQuote
|
|
5
|
-
* @property {Amount<'set'>} quoteAmount
|
|
6
|
-
* Amount whose value is a PriceQuoteValue
|
|
7
|
-
* @property {ERef<Payment<'set'>>} quotePayment
|
|
8
|
-
* The `quoteAmount` wrapped as a payment
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {[PriceDescription]} PriceQuoteValue
|
|
13
|
-
* A single-valued set of PriceDescriptions. This is the `value` in
|
|
14
|
-
* PriceQuote.quoteAmount (`{ brand, value: PriceQuoteValue }`).
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* @typedef {object} PriceDescription
|
|
19
|
-
* A description of a single quote
|
|
20
|
-
* @property {Amount<'nat'>} amountIn
|
|
21
|
-
* The amount supplied to a trade
|
|
22
|
-
* @property {Amount<'nat'>} amountOut
|
|
23
|
-
* The quoted result of trading `amountIn`
|
|
24
|
-
* @property {import('@agoric/time').TimerService} timer
|
|
25
|
-
* The service that gave the `timestamp`
|
|
26
|
-
* @property {import('@agoric/time').TimestampRecord} timestamp
|
|
27
|
-
* A timestamp according to `timer` for the quote
|
|
28
|
-
* @property {any} [conditions]
|
|
29
|
-
* Additional conditions for the quote
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* @callback PriceQuoteCreate
|
|
34
|
-
* @param {PriceQuery} priceQuery
|
|
35
|
-
* @returns {ERef<PriceQuote> | undefined}
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @callback PriceQuoteTrigger
|
|
40
|
-
* @param {PriceQuoteCreate} createQuote
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @typedef {object} PriceAuthorityAdmin
|
|
45
|
-
* @property {(createQuote: PriceQuoteCreate) => Promise<void>} fireTriggers
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* @typedef {object} PriceAuthorityKit
|
|
50
|
-
* @property {PriceAuthority} priceAuthority
|
|
51
|
-
* @property {PriceAuthorityAdmin} adminFacet
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* @typedef {object} MutableQuote
|
|
56
|
-
* @property {(reason?: any) => void} cancel
|
|
57
|
-
* @property {(amountIn: Amount<'nat'>, amountOut: Amount<'nat'>) => void} updateLevel
|
|
58
|
-
* @property {() => ERef<PriceQuote>} getPromise
|
|
59
|
-
*/
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* @typedef {object} PriceAuthority
|
|
63
|
-
* An object that mints PriceQuotes and handles
|
|
64
|
-
* triggers and notifiers for changes in the price
|
|
65
|
-
*
|
|
66
|
-
* @property {(brandIn: Brand, brandOut: Brand) => ERef<Issuer<'set'>>} getQuoteIssuer
|
|
67
|
-
* Get the ERTP issuer of PriceQuotes for a given brandIn/brandOut pair
|
|
68
|
-
*
|
|
69
|
-
* @property {(brandIn: Brand,
|
|
70
|
-
* brandOut: Brand
|
|
71
|
-
* ) => ERef<import('@agoric/time').TimerService>} getTimerService
|
|
72
|
-
* Get the timer used in PriceQuotes for a given brandIn/brandOut pair
|
|
73
|
-
*
|
|
74
|
-
* @property {(amountIn: Amount<'nat'>,
|
|
75
|
-
* brandOut: Brand<'nat'>
|
|
76
|
-
* ) => ERef<Notifier<PriceQuote>>} makeQuoteNotifier
|
|
77
|
-
* Be notified of the latest PriceQuotes for a given
|
|
78
|
-
* `amountIn`. The rate at which these are issued may be very different between
|
|
79
|
-
* `priceAuthorities`.
|
|
80
|
-
*
|
|
81
|
-
* @property {(deadline: import('@agoric/time').Timestamp,
|
|
82
|
-
* amountIn: Amount<'nat'>,
|
|
83
|
-
* brandOut: Brand<'nat'>
|
|
84
|
-
* ) => Promise<PriceQuote>} quoteAtTime
|
|
85
|
-
* Resolves after `deadline` passes on the
|
|
86
|
-
* priceAuthority's timerService with the price quote of `amountIn` at that time
|
|
87
|
-
*
|
|
88
|
-
* @property {(amountIn: Amount<'nat'>,
|
|
89
|
-
* brandOut: Brand<'nat'>
|
|
90
|
-
* ) => Promise<PriceQuote>} quoteGiven
|
|
91
|
-
* Get a quote corresponding to the specified amountIn
|
|
92
|
-
*
|
|
93
|
-
* @property {(brandIn: Brand<'nat'>,
|
|
94
|
-
* amountOut: Amount<'nat'>) => Promise<PriceQuote>} quoteWanted
|
|
95
|
-
* Get a quote corresponding to the specified amountOut
|
|
96
|
-
*
|
|
97
|
-
* @property {(amountIn: Amount<'nat'>,
|
|
98
|
-
* amountOutLimit: Amount<'nat'>
|
|
99
|
-
* ) => Promise<PriceQuote>} quoteWhenGT
|
|
100
|
-
* Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
|
|
101
|
-
*
|
|
102
|
-
* @property {(amountIn: Amount<'nat'>,
|
|
103
|
-
* amountOutLimit: Amount<'nat'>
|
|
104
|
-
* ) => Promise<PriceQuote>} quoteWhenGTE
|
|
105
|
-
* Resolve when a price quote of `amountIn` reaches or exceeds `amountOutLimit`
|
|
106
|
-
*
|
|
107
|
-
* @property {(amountIn: Amount,
|
|
108
|
-
* amountOutLimit: Amount
|
|
109
|
-
* ) => Promise<PriceQuote>} quoteWhenLTE
|
|
110
|
-
* Resolve when a price quote of `amountIn` reaches or drops below
|
|
111
|
-
* `amountOutLimit`
|
|
112
|
-
*
|
|
113
|
-
* @property {(amountIn: Amount,
|
|
114
|
-
* amountOutLimit: Amount
|
|
115
|
-
* ) => Promise<PriceQuote>} quoteWhenLT
|
|
116
|
-
* Resolve when the price quote of `amountIn` drops below `amountOutLimit`
|
|
117
|
-
*
|
|
118
|
-
* @property {(amountIn: Amount,
|
|
119
|
-
* amountOutLimit: Amount
|
|
120
|
-
* ) => ERef<MutableQuote>} mutableQuoteWhenGT
|
|
121
|
-
* Resolve when a price quote of `amountIn` exceeds `amountOutLimit`
|
|
122
|
-
*
|
|
123
|
-
* @property {(amountIn: Amount,
|
|
124
|
-
* amountOutLimit: Amount
|
|
125
|
-
* ) => ERef<MutableQuote>} mutableQuoteWhenGTE
|
|
126
|
-
* Resolve when a price quote of `amountIn` reaches or exceeds
|
|
127
|
-
* `amountOutLimit`
|
|
128
|
-
*
|
|
129
|
-
* @property {(amountIn: Amount,
|
|
130
|
-
* amountOutLimit: Amount
|
|
131
|
-
* ) => ERef<MutableQuote>} mutableQuoteWhenLTE
|
|
132
|
-
* Resolve when a price quote of `amountIn` reaches or drops below
|
|
133
|
-
* `amountOutLimit`
|
|
134
|
-
*
|
|
135
|
-
* @property {(amountIn: Amount,
|
|
136
|
-
* amountOutLimit: Amount
|
|
137
|
-
* ) => ERef<MutableQuote>} mutableQuoteWhenLT
|
|
138
|
-
* Resolve when the price quote of `amountIn` drops below `amountOutLimit`
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* @typedef {(amount: Amount<'nat'>) => Amount<'nat'>} PriceCalculator
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* @callback PriceQuery
|
|
147
|
-
* @param {PriceCalculator} calcAmountIn
|
|
148
|
-
* @param {PriceCalculator} calcAmountOut
|
|
149
|
-
* @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time').TimestampRecord } | undefined}
|
|
150
|
-
*/
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* @typedef {object} PriceLevel
|
|
154
|
-
* A description of a single quote
|
|
155
|
-
*
|
|
156
|
-
* @property {Amount<'nat'>} amountIn
|
|
157
|
-
* The amount supplied to a trade
|
|
158
|
-
* @property {Amount<'nat'>} amountOut
|
|
159
|
-
* The quoted result of trading `amountIn`
|
|
160
|
-
*/
|
|
File without changes
|
|
File without changes
|