@agoric/portfolio-api 0.1.1-dev-c0273ce.0.c0273ce → 0.1.1-dev-6a15c79.0.6a15c79
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/README.md +48 -15
- package/package.json +4 -4
- package/src/observation-messages.d.ts +14 -14
- package/src/observation-messages.d.ts.map +1 -1
- package/src/observation-messages.js +60 -42
- package/src/places.d.ts +25 -2
- package/src/places.d.ts.map +1 -1
- package/src/places.js +102 -3
- package/src/type-guards.d.ts +3 -3
- package/src/type-guards.d.ts.map +1 -1
- package/src/type-guards.js +4 -4
- package/src/types.d.ts +46 -19
- package/src/types.d.ts.map +1 -1
- package/src/types.js +54 -19
package/README.md
CHANGED
|
@@ -32,13 +32,45 @@ existing offer boundaries and execution behavior remain unchanged.
|
|
|
32
32
|
|
|
33
33
|
`PlanObservations` retains legacy aggregate `balances` and optionally carries
|
|
34
34
|
`holdings: TypedHoldingDetail[]`. Each raw holding identifies `place`, `kind`,
|
|
35
|
-
`
|
|
35
|
+
`tokenId`, and raw asset-unit `amount`; `valueUusd` is optional micro-USD.
|
|
36
36
|
`HoldingDetail` is the union of legacy balance entries and typed raw holdings.
|
|
37
37
|
`HoldingDetailShape` and `PlanObservationsShape` check structural input;
|
|
38
|
-
converters also validate place/kind compatibility,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
converters also validate place/kind compatibility, canonical token identifiers,
|
|
39
|
+
integer ranges, and duplicate `(place, kind, tokenId)` identities. Identity
|
|
40
|
+
comparisons use exact `place` and `kind` values and chain-aware canonical
|
|
41
|
+
`tokenId` keys via `makeTokenIdKey(tokenId, place)`. EVM `0x` identifiers compare
|
|
42
|
+
in lowercase; non-EVM identifiers compare with their original case. EVM
|
|
43
|
+
contract addresses are stored as lowercase `0x` hex; other chain identifiers
|
|
44
|
+
retain their canonical spelling and case for signing and chain operations.
|
|
45
|
+
`claimable-reward` belongs to an instrument; `claimed-reward` belongs to a chain
|
|
46
|
+
account.
|
|
47
|
+
|
|
48
|
+
`tokenId` identifies the asset locally to the chain implied by `place`; it does
|
|
49
|
+
not repeat the chain as a full CAIP-19 identifier. EVM contract holdings use the
|
|
50
|
+
lowercase contract address. Every Cosmos bank asset is an ordinary `token`
|
|
51
|
+
holding with its raw bank denom, for example
|
|
52
|
+
`{ place: '@noble', kind: 'token', tokenId: 'uusdc', amount: 1_000_000n }`.
|
|
53
|
+
IBC and token-factory assets preserve their `ibc/…` or `factory/…` denoms,
|
|
54
|
+
including uppercase hashes such as `ibc/123456789ABCDEF`. These denoms compare
|
|
55
|
+
case-sensitively.
|
|
56
|
+
Different denoms remain distinct even when their display symbols match. Future
|
|
57
|
+
chains can use their own identifiers, such as Solana base58 mint addresses.
|
|
58
|
+
Resolve decimal scale from chain asset metadata for the identifier, never from
|
|
59
|
+
a display symbol. `amount` is in raw base units.
|
|
60
|
+
|
|
61
|
+
`$SYMBOL` is reserved for a chain's own coin on chains where other tokens are
|
|
62
|
+
contracts, such as `$ETH`, `$AVAX`, or later `$SOL`. The nonempty symbol is its
|
|
63
|
+
display symbol; `tokenId` is the empty string, not the zero address. Cosmos bank
|
|
64
|
+
assets do not use `$` kinds. `$` kinds and Cosmos USDC are never reward-swap
|
|
65
|
+
input.
|
|
66
|
+
|
|
67
|
+
The signed `tokenId: string` field replaces `tokenAddress: address` in
|
|
68
|
+
`YmaxObservation` domain version `1`. Nothing deployed or emitted typed
|
|
69
|
+
holdings with the old field, so no contract upgrade or live migration is
|
|
70
|
+
needed. SDK verifiers and YDS producers must adopt the schema together before
|
|
71
|
+
enabling hybrid observations or contract consumers of `holdings`. Legacy
|
|
72
|
+
balance-only signatures are unchanged. The converter checks identifier syntax
|
|
73
|
+
but does not resolve chain asset metadata or establish execution support.
|
|
42
74
|
|
|
43
75
|
Use the existing observation schema, kit, and converters from
|
|
44
76
|
`./src/observation-messages.js`: `YmaxObservationMessageSchema`,
|
|
@@ -48,22 +80,23 @@ Use the existing observation schema, kit, and converters from
|
|
|
48
80
|
which optional fields were included. Legacy balance-only messages retain their
|
|
49
81
|
original signed field definitions. There are no separate v2 schema exports.
|
|
50
82
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
`
|
|
56
|
-
`
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
without Endo
|
|
83
|
+
The micro-USD valuation field is `valueUusd` in both application data and signed
|
|
84
|
+
holdings. In application data, an unknown valuation is an absent `valueUusd`,
|
|
85
|
+
distinct from a known zero. EIP-712 cannot omit a field from only some instances
|
|
86
|
+
of a struct type, so on the wire every typed holding carries `valueUusd` as an
|
|
87
|
+
`int256`, with a sentinel `VALUE_UUSD_UNKNOWN` (`-1n`) standing for an unknown
|
|
88
|
+
valuation. `portfolioObservationsToEIP712` encodes an absent valuation as the
|
|
89
|
+
sentinel and `portfolioObservationsFromEIP712` strips it; the sentinel never
|
|
90
|
+
appears in `TypedHoldingDetail`. Known valuations must satisfy `0n <= value <=
|
|
91
|
+
MAX_VALUE_UUSD` (`2n ** 255n - 1n`). Integer normalization works without Endo
|
|
92
|
+
initialization.
|
|
60
93
|
|
|
61
94
|
Deprecated `balanceUsdc` remains optional unsigned `uint256` without a
|
|
62
95
|
sentinel: include it on every raw holding or omit it from all of them. It is a
|
|
63
96
|
transitional bridge for consumers that still read legacy `balances`: decoding
|
|
64
97
|
typed holdings sums `balanceUsdc` per place into `balances`. Producers put the
|
|
65
98
|
place's legacy balance on one holding per place and `0n` on the others.
|
|
66
|
-
`
|
|
99
|
+
`valueUusd` never feeds `balances`. When authoring typed holdings, `balances`
|
|
67
100
|
may be empty or must equal that derivation (as decoding returns); anything else
|
|
68
101
|
is rejected rather than silently discarded.
|
|
69
102
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/portfolio-api",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-6a15c79.0.6a15c79",
|
|
4
4
|
"description": "API for Portfolio management",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@agoric/internal": "0.3.3-dev-
|
|
51
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
50
|
+
"@agoric/internal": "0.3.3-dev-6a15c79.0.6a15c79",
|
|
51
|
+
"@agoric/orchestration": "0.1.1-dev-6a15c79.0.6a15c79",
|
|
52
52
|
"@endo/common": "^1.4.0",
|
|
53
53
|
"@endo/errors": "^1.3.1",
|
|
54
54
|
"@endo/patterns": "^1.9.1"
|
|
@@ -74,5 +74,5 @@
|
|
|
74
74
|
"engines": {
|
|
75
75
|
"node": "^22.11 || ^24.14"
|
|
76
76
|
},
|
|
77
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "6a15c79d17c1b78abc8cae659bb02843770dd6f1"
|
|
78
78
|
}
|
|
@@ -71,15 +71,15 @@ declare const ObservationSubTypes: {
|
|
|
71
71
|
type: "string";
|
|
72
72
|
} | {
|
|
73
73
|
optional: true;
|
|
74
|
-
name: "
|
|
75
|
-
type: "
|
|
74
|
+
name: "tokenId";
|
|
75
|
+
type: "string";
|
|
76
76
|
} | {
|
|
77
77
|
optional: true;
|
|
78
78
|
name: "amount";
|
|
79
79
|
type: "uint256";
|
|
80
80
|
} | {
|
|
81
81
|
optional: true;
|
|
82
|
-
name: "
|
|
82
|
+
name: "valueUusd";
|
|
83
83
|
type: "int256";
|
|
84
84
|
})[]];
|
|
85
85
|
readonly InstrumentDetail: readonly [{
|
|
@@ -142,15 +142,15 @@ export declare const YmaxObservationMessageSchema: {
|
|
|
142
142
|
type: "string";
|
|
143
143
|
} | {
|
|
144
144
|
optional: true;
|
|
145
|
-
name: "
|
|
146
|
-
type: "
|
|
145
|
+
name: "tokenId";
|
|
146
|
+
type: "string";
|
|
147
147
|
} | {
|
|
148
148
|
optional: true;
|
|
149
149
|
name: "amount";
|
|
150
150
|
type: "uint256";
|
|
151
151
|
} | {
|
|
152
152
|
optional: true;
|
|
153
|
-
name: "
|
|
153
|
+
name: "valueUusd";
|
|
154
154
|
type: "int256";
|
|
155
155
|
})[]];
|
|
156
156
|
readonly InstrumentDetail: readonly [{
|
|
@@ -180,17 +180,17 @@ export type PortfolioObservationsContent = {
|
|
|
180
180
|
};
|
|
181
181
|
/**
|
|
182
182
|
* EIP-712 cannot omit a field from only some instances of a struct type, so
|
|
183
|
-
* typed holdings always carry `
|
|
183
|
+
* typed holdings always carry `valueUusd` on the wire, using this sentinel for
|
|
184
184
|
* an unknown valuation. The converters below translate it to and from an
|
|
185
|
-
* absent `
|
|
185
|
+
* absent `valueUusd` in {@link TypedHoldingDetail}; it never reaches
|
|
186
186
|
* application data.
|
|
187
187
|
*/
|
|
188
|
-
export declare const
|
|
188
|
+
export declare const VALUE_UUSD_UNKNOWN = -1n;
|
|
189
189
|
/** Largest valuation representable in the signed `int256` wire field. */
|
|
190
|
-
export declare const
|
|
190
|
+
export declare const MAX_VALUE_UUSD: bigint;
|
|
191
191
|
/**
|
|
192
192
|
* Author either legacy balances or typed holdings using the shared schema.
|
|
193
|
-
* Typed holdings always carry `
|
|
193
|
+
* Typed holdings always carry `valueUusd`, with {@link VALUE_UUSD_UNKNOWN}
|
|
194
194
|
* standing for an absent valuation. With typed holdings, `balances` may only
|
|
195
195
|
* repeat what their `balanceUsdc` values derive (as decoding returns), so no
|
|
196
196
|
* balance is silently dropped.
|
|
@@ -200,9 +200,9 @@ export declare const portfolioObservationsToEIP712: ({ portfolioId, syncState, o
|
|
|
200
200
|
* Decode normalized authenticated observations. The handler must use
|
|
201
201
|
* onUnknownSignedField: 'throw'. This converter does not verify signatures.
|
|
202
202
|
* For typed holdings, `balances` is derived from their deprecated
|
|
203
|
-
* `balanceUsdc` (see {@link balancesFromTypedHoldings}), never from `
|
|
204
|
-
* A typed holding's {@link
|
|
205
|
-
* `
|
|
203
|
+
* `balanceUsdc` (see {@link balancesFromTypedHoldings}), never from `valueUusd`.
|
|
204
|
+
* A typed holding's {@link VALUE_UUSD_UNKNOWN} valuation decodes to an absent
|
|
205
|
+
* `valueUusd`.
|
|
206
206
|
*/
|
|
207
207
|
export declare const portfolioObservationsFromEIP712: ({ portfolio, syncState, holdings, instruments, }: PortfolioObservationsEIP712) => PortfolioObservationsContent;
|
|
208
208
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observation-messages.d.ts","sourceRoot":"","sources":["observation-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"observation-messages.d.ts","sourceRoot":"","sources":["observation-messages.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAEV,qBAAqB,EACtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,UAAU,EAEf,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC7B,MAAM,oDAAoD,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAS7E,OAAO,KAAK,EACV,gBAAgB,EAEhB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAQpB,QAAA,MAAM,yBAAyB;IAC7B;;;;;;;OAOG;;;;;;;;;;;;;;CAO6D,CAAC;AAiBnE,QAAA,MAAM,mBAAmB;IACvB,sCAAsC;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AwDhC,CAAC"}
|
|
@@ -37,9 +37,12 @@ import {
|
|
|
37
37
|
} from '@agoric/orchestration/src/utils/eip712-messages.js';
|
|
38
38
|
;
|
|
39
39
|
import {
|
|
40
|
+
isEvmChain,
|
|
40
41
|
isInterChainAccountRef,
|
|
41
42
|
isInstrumentId,
|
|
42
43
|
isPortfolioBalancePlaceRef,
|
|
44
|
+
maybeChainOf,
|
|
45
|
+
getCanonicalHoldingKey,
|
|
43
46
|
} from './places.js';
|
|
44
47
|
;
|
|
45
48
|
|
|
@@ -76,13 +79,13 @@ const holdingDetailV1 = [
|
|
|
76
79
|
|
|
77
80
|
const holdingDetailV2 = [
|
|
78
81
|
{ name: 'kind', type: 'string' },
|
|
79
|
-
{ name: '
|
|
82
|
+
{ name: 'tokenId', type: 'string' },
|
|
80
83
|
{ name: 'amount', type: 'uint256' },
|
|
81
84
|
/**
|
|
82
|
-
* Valuation in micro-USD, or {@link
|
|
85
|
+
* Valuation in micro-USD, or {@link VALUE_UUSD_UNKNOWN} if not observed.
|
|
83
86
|
* Signed only to make room for that sentinel.
|
|
84
87
|
*/
|
|
85
|
-
{ name: '
|
|
88
|
+
{ name: 'valueUusd', type: 'int256' },
|
|
86
89
|
] ;
|
|
87
90
|
|
|
88
91
|
const ObservationSubTypes = {
|
|
@@ -154,54 +157,54 @@ export const ymaxObservationMessageKit
|
|
|
154
157
|
|
|
155
158
|
/**
|
|
156
159
|
* EIP-712 cannot omit a field from only some instances of a struct type, so
|
|
157
|
-
* typed holdings always carry `
|
|
160
|
+
* typed holdings always carry `valueUusd` on the wire, using this sentinel for
|
|
158
161
|
* an unknown valuation. The converters below translate it to and from an
|
|
159
|
-
* absent `
|
|
162
|
+
* absent `valueUusd` in {@link TypedHoldingDetail}; it never reaches
|
|
160
163
|
* application data.
|
|
161
164
|
*/
|
|
162
|
-
export const
|
|
165
|
+
export const VALUE_UUSD_UNKNOWN = -1n;
|
|
163
166
|
|
|
164
167
|
/** Largest valuation representable in the signed `int256` wire field. */
|
|
165
|
-
export const
|
|
168
|
+
export const MAX_VALUE_UUSD = 2n ** 255n - 1n;
|
|
166
169
|
|
|
167
170
|
/** A `HoldingDetail` entry as it appears on the wire. */
|
|
168
171
|
;
|
|
169
172
|
|
|
170
173
|
|
|
171
174
|
/** A typed holding as it appears on the (normalized) wire. */
|
|
172
|
-
;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
+
;
|
|
176
|
+
|
|
177
|
+
|
|
175
178
|
|
|
176
179
|
|
|
177
180
|
/** Application -> wire: an absent valuation becomes the sentinel. */
|
|
178
181
|
const typedHoldingToEIP712 = ({
|
|
179
182
|
place,
|
|
180
183
|
kind,
|
|
181
|
-
|
|
184
|
+
tokenId,
|
|
182
185
|
amount,
|
|
183
|
-
|
|
186
|
+
valueUusd,
|
|
184
187
|
...rest
|
|
185
188
|
} ) => ({
|
|
186
189
|
place,
|
|
187
190
|
kind,
|
|
188
|
-
|
|
191
|
+
tokenId,
|
|
189
192
|
amount,
|
|
190
|
-
|
|
193
|
+
valueUusd: valueUusd ?? VALUE_UUSD_UNKNOWN,
|
|
191
194
|
// deprecated, and must be uniformly present or absent
|
|
192
195
|
...(rest.balanceUsdc === undefined ? {} : { balanceUsdc: rest.balanceUsdc }),
|
|
193
196
|
});
|
|
194
197
|
|
|
195
198
|
/** Wire -> application: the sentinel (or an absent field) becomes absent. */
|
|
196
199
|
const typedHoldingFromEIP712 = ({
|
|
197
|
-
|
|
200
|
+
valueUusd,
|
|
198
201
|
...rest
|
|
199
202
|
} ) =>
|
|
200
203
|
({
|
|
201
204
|
...rest,
|
|
202
|
-
...(
|
|
205
|
+
...(valueUusd === undefined || valueUusd === VALUE_UUSD_UNKNOWN
|
|
203
206
|
? {}
|
|
204
|
-
: {
|
|
207
|
+
: { valueUusd }),
|
|
205
208
|
}) ;
|
|
206
209
|
|
|
207
210
|
const assertUint256 = (value , field ) => {
|
|
@@ -227,11 +230,16 @@ const assertTypedHoldings
|
|
|
227
230
|
for (const {
|
|
228
231
|
place,
|
|
229
232
|
kind,
|
|
230
|
-
|
|
233
|
+
tokenId,
|
|
231
234
|
amount,
|
|
232
|
-
|
|
235
|
+
valueUusd,
|
|
233
236
|
balanceUsdc,
|
|
237
|
+
...rest
|
|
234
238
|
} of holdings) {
|
|
239
|
+
const unknownFields = Object.keys(rest);
|
|
240
|
+
if (unknownFields.length) {
|
|
241
|
+
throw TypeError(`unknown holding fields: ${unknownFields.join(', ')}`);
|
|
242
|
+
}
|
|
235
243
|
if (!isPortfolioBalancePlaceRef(place)) {
|
|
236
244
|
throw TypeError(`invalid holding place ${JSON.stringify(place)}`);
|
|
237
245
|
}
|
|
@@ -251,28 +259,39 @@ const assertTypedHoldings
|
|
|
251
259
|
`holding kind ${kind} is incompatible with place ${place}`,
|
|
252
260
|
);
|
|
253
261
|
}
|
|
262
|
+
const isEvmPlace = isEvmChain(maybeChainOf(place));
|
|
263
|
+
// EIP-712 strings do not normalize addresses. Reject non-canonical hex
|
|
264
|
+
// in signed data. Other chains retain their local identifiers, e.g. Cosmos
|
|
265
|
+
// denoms or Solana mints. Identity keys canonicalize only EVM identifiers.
|
|
254
266
|
if (
|
|
255
|
-
typeof
|
|
256
|
-
|
|
267
|
+
typeof tokenId !== 'string' ||
|
|
268
|
+
/\s/.test(tokenId) ||
|
|
269
|
+
(!isNative && isEvmPlace && !/^0x[0-9a-f]{40}$/.test(tokenId))
|
|
257
270
|
) {
|
|
258
|
-
throw TypeError(`invalid holding token
|
|
271
|
+
throw TypeError(`invalid holding token identifier ${String(tokenId)}`);
|
|
259
272
|
}
|
|
260
|
-
if (
|
|
261
|
-
|
|
273
|
+
if (
|
|
274
|
+
isNative !== (tokenId === '') ||
|
|
275
|
+
(isEvmPlace && /^0x0{40}$/.test(tokenId)) ||
|
|
276
|
+
(isNative && !isEvmPlace)
|
|
277
|
+
) {
|
|
278
|
+
throw TypeError(
|
|
279
|
+
`holding kind ${kind} has an incompatible token identifier`,
|
|
280
|
+
);
|
|
262
281
|
}
|
|
263
|
-
const
|
|
264
|
-
if (identities.has(
|
|
265
|
-
throw TypeError(`duplicate holding identity ${
|
|
282
|
+
const holdingKey = getCanonicalHoldingKey({ place, kind, tokenId });
|
|
283
|
+
if (identities.has(holdingKey)) {
|
|
284
|
+
throw TypeError(`duplicate holding identity ${holdingKey}`);
|
|
266
285
|
}
|
|
267
|
-
identities.add(
|
|
286
|
+
identities.add(holdingKey);
|
|
268
287
|
assertUint256(amount, 'amount');
|
|
269
288
|
if (
|
|
270
|
-
|
|
271
|
-
(typeof
|
|
272
|
-
|
|
273
|
-
|
|
289
|
+
valueUusd !== undefined &&
|
|
290
|
+
(typeof valueUusd !== 'bigint' ||
|
|
291
|
+
valueUusd < 0n ||
|
|
292
|
+
valueUusd > MAX_VALUE_UUSD)
|
|
274
293
|
) {
|
|
275
|
-
throw RangeError(`invalid valuation
|
|
294
|
+
throw RangeError(`invalid valuation valueUusd: ${String(valueUusd)}`);
|
|
276
295
|
}
|
|
277
296
|
if (balanceUsdc !== undefined) {
|
|
278
297
|
assertUint256(balanceUsdc, 'balanceUsdc');
|
|
@@ -285,7 +304,7 @@ const assertTypedHoldings
|
|
|
285
304
|
* `balanceUsdc` of typed holdings, summed per place, so consumers of
|
|
286
305
|
* `balances` keep working when producers switch to typed holdings. Producers
|
|
287
306
|
* put the legacy place balance on one holding per place and `0n` on the
|
|
288
|
-
* others. Never derived from `
|
|
307
|
+
* others. Never derived from `valueUusd`. Empty if the holdings omit
|
|
289
308
|
* `balanceUsdc` (EIP-712 requires it on all of them or none).
|
|
290
309
|
*/
|
|
291
310
|
const balancesFromTypedHoldings = (
|
|
@@ -305,7 +324,7 @@ const balancesFromTypedHoldings = (
|
|
|
305
324
|
|
|
306
325
|
/**
|
|
307
326
|
* Author either legacy balances or typed holdings using the shared schema.
|
|
308
|
-
* Typed holdings always carry `
|
|
327
|
+
* Typed holdings always carry `valueUusd`, with {@link VALUE_UUSD_UNKNOWN}
|
|
309
328
|
* standing for an absent valuation. With typed holdings, `balances` may only
|
|
310
329
|
* repeat what their `balanceUsdc` values derive (as decoding returns), so no
|
|
311
330
|
* balance is silently dropped.
|
|
@@ -374,9 +393,9 @@ export const portfolioObservationsToEIP712 = ({
|
|
|
374
393
|
* Decode normalized authenticated observations. The handler must use
|
|
375
394
|
* onUnknownSignedField: 'throw'. This converter does not verify signatures.
|
|
376
395
|
* For typed holdings, `balances` is derived from their deprecated
|
|
377
|
-
* `balanceUsdc` (see {@link balancesFromTypedHoldings}), never from `
|
|
378
|
-
* A typed holding's {@link
|
|
379
|
-
* `
|
|
396
|
+
* `balanceUsdc` (see {@link balancesFromTypedHoldings}), never from `valueUusd`.
|
|
397
|
+
* A typed holding's {@link VALUE_UUSD_UNKNOWN} valuation decodes to an absent
|
|
398
|
+
* `valueUusd`.
|
|
380
399
|
*/
|
|
381
400
|
export const portfolioObservationsFromEIP712 = ({
|
|
382
401
|
portfolio,
|
|
@@ -387,8 +406,7 @@ export const portfolioObservationsFromEIP712 = ({
|
|
|
387
406
|
const legacyBalances = {};
|
|
388
407
|
const rawHoldings = [];
|
|
389
408
|
for (const holding of holdings) {
|
|
390
|
-
const { place, balanceUsdc, kind,
|
|
391
|
-
holding;
|
|
409
|
+
const { place, balanceUsdc, kind, tokenId, amount, valueUusd } = holding;
|
|
392
410
|
if (!isPortfolioBalancePlaceRef(place)) {
|
|
393
411
|
throw TypeError(`invalid holding place ${JSON.stringify(place)}`);
|
|
394
412
|
}
|
|
@@ -396,9 +414,9 @@ export const portfolioObservationsFromEIP712 = ({
|
|
|
396
414
|
// partial hybrid is rejected rather than having signed fields dropped.
|
|
397
415
|
if (
|
|
398
416
|
kind !== undefined ||
|
|
399
|
-
|
|
417
|
+
tokenId !== undefined ||
|
|
400
418
|
amount !== undefined ||
|
|
401
|
-
|
|
419
|
+
valueUusd !== undefined
|
|
402
420
|
) {
|
|
403
421
|
rawHoldings.push(typedHoldingFromEIP712(holding));
|
|
404
422
|
} else {
|
package/src/places.d.ts
CHANGED
|
@@ -8,10 +8,14 @@
|
|
|
8
8
|
import type { TypeTag } from '@agoric/internal/src/tagged.js';
|
|
9
9
|
import type { SupportedChain, YieldProtocol } from './constants.js';
|
|
10
10
|
import type { InstrumentId } from './instruments.js';
|
|
11
|
-
import type { AssetPlaceRef, DepositFromChainRef, InterChainAccountRef, LocalChainAccountRef, PortfolioBalancePlaceRef, WithdrawToChainRef } from './types.js';
|
|
11
|
+
import type { AssetPlaceRef, DepositFromChainRef, InterChainAccountRef, LocalChainAccountRef, PortfolioBalancePlaceRef, TypedHoldingDetail, WithdrawToChainRef } from './types.js';
|
|
12
12
|
export type TokenUsage = 'swapFrom' | 'swapTo';
|
|
13
13
|
export type TokenIdKey = TypeTag<string, 'TokenIdKey'>;
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Canonicalize a token ID for comparison using its place's chain.
|
|
16
|
+
* Supply place when known; omitting it preserves legacy 0x lowercasing.
|
|
17
|
+
*/
|
|
18
|
+
export declare const makeTokenIdKey: (tokenId: string, place?: unknown) => TokenIdKey;
|
|
15
19
|
/**
|
|
16
20
|
* cf. https://github.com/Agoric/ymax-web/blob/main/yds/src/data/tokens.ts:
|
|
17
21
|
* TokenMetadata
|
|
@@ -468,4 +472,23 @@ export declare const isERC4626MorphoInstrumentId: (ref: string) => ref is ERC462
|
|
|
468
472
|
*/
|
|
469
473
|
export declare const isBeefyInstrumentId: (ref: string) => ref is BeefyInstrumentId;
|
|
470
474
|
export declare const chainOf: (id: AssetPlaceRef) => SupportedChain;
|
|
475
|
+
/** JS idiom for `Some SupportedChain | None`. */
|
|
476
|
+
export declare const maybeChainOf: (id: unknown) => SupportedChain | null;
|
|
477
|
+
/** Whether the specimen names an opted-in EVM chain. */
|
|
478
|
+
export declare const isEvmChain: (specimen: unknown) => boolean;
|
|
479
|
+
/**
|
|
480
|
+
* Get a holding identity suitable for use as a PropertyKey.
|
|
481
|
+
* Place and kind compare exactly; token IDs compare canonical form,
|
|
482
|
+
* which is lowercased on the EVM.
|
|
483
|
+
*
|
|
484
|
+
* The original holding remains unchanged for signing and chain operations.
|
|
485
|
+
*/
|
|
486
|
+
export declare const getCanonicalHoldingKey: (holding: Partial<Pick<TypedHoldingDetail, "place" | "kind" | "tokenId">>) => string;
|
|
487
|
+
/**
|
|
488
|
+
* Compare nonempty token IDs, requiring a 0x payload for EVM IDs.
|
|
489
|
+
* Empty native `$SYMBOL` identifiers never match, even each other.
|
|
490
|
+
*/
|
|
491
|
+
export declare const matchHoldingTokenId: (holding: Pick<TypedHoldingDetail, "place" | "tokenId"> & {
|
|
492
|
+
kind?: TypedHoldingDetail["kind"];
|
|
493
|
+
}, tokenId: string) => boolean;
|
|
471
494
|
//# sourceMappingURL=places.d.ts.map
|
package/src/places.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"places.d.ts","sourceRoot":"","sources":["places.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"places.d.ts","sourceRoot":"","sources":["places.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAEV,cAAc,EACd,aAAa,EACd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAepB,MAAM,MAAM,UAAU,GAAG,UAAU,GAAG,QAAQ,CAAC;AAE/C,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACzB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,CAAC;AAaF,wDAAwD;AACxD,eAAO,MAAM,UAAU,GAAI,UAAU,OAAO,KAAG,OACqB,CAAC;AAGrE;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GACjC,SAAS,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC,CAAC,KACvE,MASF,CAAC;AAGF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAC9B,SAAS,IAAI,CAAC,kBAAkB,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG;IACvD,IAAI,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,CAAC;CACnC,EACD,SAAS,MAAM,KACd,OAoBF,CAAC"}
|
package/src/places.js
CHANGED
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
11
15
|
|
|
12
16
|
|
|
13
17
|
|
|
@@ -16,6 +20,7 @@
|
|
|
16
20
|
|
|
17
21
|
|
|
18
22
|
|
|
23
|
+
|
|
19
24
|
|
|
20
25
|
|
|
21
26
|
const isPrimitive = (value ) =>
|
|
@@ -35,8 +40,24 @@ const deepFreeze = (value ) => {
|
|
|
35
40
|
|
|
36
41
|
;
|
|
37
42
|
|
|
38
|
-
|
|
39
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Canonicalize a token ID for comparison using its place's chain.
|
|
45
|
+
* Supply place when known; omitting it preserves legacy 0x lowercasing.
|
|
46
|
+
*/
|
|
47
|
+
export const makeTokenIdKey = (
|
|
48
|
+
tokenId ,
|
|
49
|
+
place ,
|
|
50
|
+
) => {
|
|
51
|
+
if (typeof tokenId !== 'string') {
|
|
52
|
+
throw TypeError('tokenId must be a string');
|
|
53
|
+
}
|
|
54
|
+
// Canonical lowercase tokenIdKey on unspecified place or EVM.
|
|
55
|
+
const probablyEvm = place == null || isEvmChain(maybeChainOf(place));
|
|
56
|
+
if (probablyEvm && tokenId.startsWith('0x')) {
|
|
57
|
+
return tokenId.toLowerCase() ;
|
|
58
|
+
}
|
|
59
|
+
return tokenId ;
|
|
60
|
+
};
|
|
40
61
|
deepFreeze(makeTokenIdKey);
|
|
41
62
|
|
|
42
63
|
/**
|
|
@@ -358,3 +379,81 @@ export const chainOf = (id ) => {
|
|
|
358
379
|
throw Error(`Cannot determine chain for ${id}`);
|
|
359
380
|
};
|
|
360
381
|
deepFreeze(chainOf);
|
|
382
|
+
|
|
383
|
+
/** JS idiom for `Some SupportedChain | None`. */
|
|
384
|
+
export const maybeChainOf = (id ) => {
|
|
385
|
+
try {
|
|
386
|
+
return chainOf(id );
|
|
387
|
+
} catch {
|
|
388
|
+
return null;
|
|
389
|
+
}
|
|
390
|
+
};
|
|
391
|
+
deepFreeze(maybeChainOf);
|
|
392
|
+
|
|
393
|
+
// Type-only coverage keeps this module Endo-free and checks additions to
|
|
394
|
+
// AxelarChain without importing the runtime constants module.
|
|
395
|
+
const evmChains = deepFreeze({
|
|
396
|
+
Arbitrum: true,
|
|
397
|
+
Avalanche: true,
|
|
398
|
+
Base: true,
|
|
399
|
+
Ethereum: true,
|
|
400
|
+
Optimism: true,
|
|
401
|
+
} );
|
|
402
|
+
|
|
403
|
+
/** Whether the specimen names an opted-in EVM chain. */
|
|
404
|
+
export const isEvmChain = (specimen ) =>
|
|
405
|
+
typeof specimen === 'string' && Object.hasOwn(evmChains, specimen);
|
|
406
|
+
deepFreeze(isEvmChain);
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Get a holding identity suitable for use as a PropertyKey.
|
|
410
|
+
* Place and kind compare exactly; token IDs compare canonical form,
|
|
411
|
+
* which is lowercased on the EVM.
|
|
412
|
+
*
|
|
413
|
+
* The original holding remains unchanged for signing and chain operations.
|
|
414
|
+
*/
|
|
415
|
+
export const getCanonicalHoldingKey = (
|
|
416
|
+
holding ,
|
|
417
|
+
) => {
|
|
418
|
+
const { place = null, kind = null, tokenId = null } = holding;
|
|
419
|
+
|
|
420
|
+
if (tokenId == null) {
|
|
421
|
+
throw TypeError(`cannot canonicalize nullish tokenId`);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Canonical key form.
|
|
425
|
+
return JSON.stringify([place, kind, makeTokenIdKey(tokenId, place)]);
|
|
426
|
+
};
|
|
427
|
+
deepFreeze(getCanonicalHoldingKey);
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Compare nonempty token IDs, requiring a 0x payload for EVM IDs.
|
|
431
|
+
* Empty native `$SYMBOL` identifiers never match, even each other.
|
|
432
|
+
*/
|
|
433
|
+
export const matchHoldingTokenId = (
|
|
434
|
+
holding
|
|
435
|
+
|
|
436
|
+
,
|
|
437
|
+
tokenId ,
|
|
438
|
+
) => {
|
|
439
|
+
const { tokenId: holdingTokenId } = holding;
|
|
440
|
+
if (!holdingTokenId || !tokenId) return false;
|
|
441
|
+
|
|
442
|
+
// EVM token IDs must contain a 0x-prefixed payload.
|
|
443
|
+
if (isEvmChain(maybeChainOf(holding.place))) {
|
|
444
|
+
if (
|
|
445
|
+
!holdingTokenId.startsWith('0x') ||
|
|
446
|
+
!tokenId.startsWith('0x') ||
|
|
447
|
+
holdingTokenId.length < 3 ||
|
|
448
|
+
tokenId.length < 3
|
|
449
|
+
) {
|
|
450
|
+
return false;
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
return (
|
|
455
|
+
getCanonicalHoldingKey(holding) ===
|
|
456
|
+
getCanonicalHoldingKey({ ...holding, tokenId })
|
|
457
|
+
);
|
|
458
|
+
};
|
|
459
|
+
deepFreeze(matchHoldingTokenId);
|
package/src/type-guards.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type { ChainTokenMetadata, ChainTokenMetadataEntry, TokenIdKey, TokenMeta
|
|
|
6
6
|
export declare const TokenUsageShape: import("@endo/patterns").MatcherOf<"or", ["swapFrom", "swapTo"]>;
|
|
7
7
|
/** Structural withdrawal parameters; route and holding identity need decoding. */
|
|
8
8
|
export declare const WithdrawParamsShape: CastedPattern<WithdrawParams>;
|
|
9
|
-
/**
|
|
9
|
+
/** A chain's own coin uses '$' plus a nonempty display symbol, e.g. '$ETH'. */
|
|
10
10
|
export declare const HoldingKindShape: CastedPattern<HoldingKind>;
|
|
11
11
|
export declare const HoldingDetailV1Shape: import("@endo/patterns").MatcherOf<"splitRecord", [{
|
|
12
12
|
place: import("@endo/patterns").MatcherOf<"string", string>;
|
|
@@ -19,10 +19,10 @@ export declare const HoldingDetailV2Shape: import("@endo/patterns").MatcherOf<"s
|
|
|
19
19
|
}) | (import("@endo/pass-style").CopyTaggedInterface<import("@endo/pass-style").PassableCap, Error> & {
|
|
20
20
|
"Symbol(castedType)"?: HoldingKind | undefined;
|
|
21
21
|
});
|
|
22
|
-
|
|
22
|
+
tokenId: import("@endo/patterns").MatcherOf<"string", string>;
|
|
23
23
|
amount: import("@endo/patterns").MatcherOf<"nat", bigint>;
|
|
24
24
|
}, {
|
|
25
|
-
|
|
25
|
+
valueUusd: import("@endo/patterns").MatcherOf<"and", [import("@endo/patterns").MatcherOf<"nat", bigint>, import("@endo/patterns").MatcherOf<"lte", import("@endo/patterns").Key>]>;
|
|
26
26
|
balanceUsdc: import("@endo/patterns").MatcherOf<"nat", bigint>;
|
|
27
27
|
}, {}]>;
|
|
28
28
|
/** Structural shape; the observation decoder also checks places and addresses. */
|
package/src/type-guards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,EAAK,KAAK,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,KAAK,EACV,iBAAiB,EACjB,oCAAoC,EACpC,iCAAiC,EACjC,kBAAkB,EAClB,cAAc,EACd,WA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AYvD,CAAC;AAGF,eAAO,MAAM,oBAAoB;;;WAIhC,CAAC;AAGF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;OAShC,CAAC;AAGF,kFAAkF;AAClF,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,aAAa,CAG3D,CAAC;AAGF,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,gBAAgB,CAW/D,CAAC;AAGJ,eAAO,MAAM,kBAAkB,EAAE,aAAa,CAAC,aAAa,CAW3D,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,kBAAkB,CAWnE,CAAC;AAGJ,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,iBAAiB,CACxD,CAAC;AAEb,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,MAAM,CAE5D,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,aAAa,CAAC,kBAAkB,CAIlE,CAAC;AAEL,eAAO,MAAM,sCAAsC,EAAE,aAAa,CAAC,iCAAiC,CAKjG,CAAC;AAEJ,eAAO,MAAM,yCAAyC,EAAE,aAAa,CAAC,oCAAoC,CAKvG,CAAC"}
|
package/src/type-guards.js
CHANGED
|
@@ -34,7 +34,7 @@ export {
|
|
|
34
34
|
* Application-level valuation: absent when unknown. The EIP-712 converters
|
|
35
35
|
* own the wire sentinel; it is not accepted here.
|
|
36
36
|
*/
|
|
37
|
-
const
|
|
37
|
+
const ValueUusdShape = M.and(M.nat(), M.lte(2n ** 255n - 1n));
|
|
38
38
|
|
|
39
39
|
export const TokenUsageShape = M.or('swapFrom', 'swapTo');
|
|
40
40
|
harden(TokenUsageShape);
|
|
@@ -50,7 +50,7 @@ export const WithdrawParamsShape = M.splitRecord(
|
|
|
50
50
|
);
|
|
51
51
|
harden(WithdrawParamsShape);
|
|
52
52
|
|
|
53
|
-
/**
|
|
53
|
+
/** A chain's own coin uses '$' plus a nonempty display symbol, e.g. '$ETH'. */
|
|
54
54
|
export const HoldingKindShape = M.or(
|
|
55
55
|
'shares',
|
|
56
56
|
'principal',
|
|
@@ -77,10 +77,10 @@ export const HoldingDetailV2Shape = M.splitRecord(
|
|
|
77
77
|
{
|
|
78
78
|
place: M.string(),
|
|
79
79
|
kind: HoldingKindShape,
|
|
80
|
-
|
|
80
|
+
tokenId: M.string(),
|
|
81
81
|
amount: M.nat(),
|
|
82
82
|
},
|
|
83
|
-
{
|
|
83
|
+
{ valueUusd: ValueUusdShape, balanceUsdc: M.nat() },
|
|
84
84
|
{},
|
|
85
85
|
);
|
|
86
86
|
harden(HoldingDetailV2Shape);
|
package/src/types.d.ts
CHANGED
|
@@ -158,7 +158,7 @@ export type PlanObservations = {
|
|
|
158
158
|
balances: Partial<Record<PortfolioBalancePlaceRef, bigint>>;
|
|
159
159
|
/**
|
|
160
160
|
* Authenticated raw holdings. When present, `balances` is derived from their
|
|
161
|
-
* deprecated `balanceUsdc` (never from `
|
|
161
|
+
* deprecated `balanceUsdc` (never from `valueUusd`).
|
|
162
162
|
*/
|
|
163
163
|
holdings?: TypedHoldingDetail[];
|
|
164
164
|
instrumentTvls: Partial<Record<InstrumentId, InstrumentTvlObservation>>;
|
|
@@ -168,7 +168,12 @@ export type PlanObservations = {
|
|
|
168
168
|
* vault shares; `principal` identifies instrument principal (for example Aave
|
|
169
169
|
* or Compound). `claimable-reward` belongs to an instrument, while
|
|
170
170
|
* `claimed-reward` and other `token` holdings belong to a chain account.
|
|
171
|
-
*
|
|
171
|
+
* Cosmos bank assets are ordinary `token` holdings, e.g. Noble USDC has
|
|
172
|
+
* `kind: 'token', tokenId: 'uusdc'`. `$SYMBOL` is reserved for a chain's own
|
|
173
|
+
* coin on chains where other tokens are contracts (such as `$ETH`, `$AVAX`,
|
|
174
|
+
* or later `$SOL`); it uses an empty `tokenId`. The nonempty symbol is the
|
|
175
|
+
* coin's display symbol. `$` holdings and Cosmos USDC are never reward-swap
|
|
176
|
+
* input.
|
|
172
177
|
*/
|
|
173
178
|
export type HoldingKind = 'shares' | 'principal' | 'claimable-reward' | 'claimed-reward' | 'token' | `$${string}`;
|
|
174
179
|
/** A legacy balance observation, in micro-USDC. */
|
|
@@ -176,20 +181,50 @@ export type LegacyHoldingDetail = {
|
|
|
176
181
|
place: PortfolioBalancePlaceRef;
|
|
177
182
|
balanceUsdc: bigint;
|
|
178
183
|
};
|
|
184
|
+
type EvmHoldingPlace = Extract<PortfolioBalancePlaceRef, `@${AxelarChain}` | `${string}_${AxelarChain}`>;
|
|
185
|
+
type NonNativeHoldingKind = Exclude<HoldingKind, `$${string}`>;
|
|
186
|
+
/**
|
|
187
|
+
* Token identifier local to the chain implied by `place`: a lowercase EVM
|
|
188
|
+
* contract address (vault for shares, underlying token for principal,
|
|
189
|
+
* rewards, or ERC-20 holdings), a raw Cosmos bank denom (e.g. `uusdc`,
|
|
190
|
+
* `ibc/…`, `factory/…`), or another chain's canonical identifier such as a
|
|
191
|
+
* Solana mint. `$SYMBOL` holdings use the empty string. Do not substitute
|
|
192
|
+
* a display symbol or repeat the chain as a CAIP-19 identifier. Resolve
|
|
193
|
+
* decimal scale from chain asset metadata for this identifier. Preserve its
|
|
194
|
+
* spelling for storage, signing, and chain operations. Compare token IDs using
|
|
195
|
+
* `makeTokenIdKey(tokenId, place)`: EVM `0x` identifiers compare in lowercase;
|
|
196
|
+
* non-EVM identifiers compare case-sensitively.
|
|
197
|
+
*/
|
|
198
|
+
type HoldingIdentity = {
|
|
199
|
+
place: EvmHoldingPlace;
|
|
200
|
+
kind: NonNativeHoldingKind;
|
|
201
|
+
tokenId: EvmAddress;
|
|
202
|
+
} | {
|
|
203
|
+
place: Exclude<PortfolioBalancePlaceRef, EvmHoldingPlace>;
|
|
204
|
+
kind: NonNativeHoldingKind;
|
|
205
|
+
tokenId: string;
|
|
206
|
+
} | {
|
|
207
|
+
place: `@${AxelarChain}`;
|
|
208
|
+
kind: `$${string}`;
|
|
209
|
+
tokenId: '';
|
|
210
|
+
};
|
|
179
211
|
/**
|
|
180
212
|
* One authenticated raw holding, independent of its USD valuation.
|
|
181
213
|
*
|
|
182
|
-
* The identity is `(place, kind,
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
214
|
+
* The identity is `(place, kind, tokenId)`: compare `place` and `kind` exactly
|
|
215
|
+
* and compare `tokenId` using its chain-aware canonical key. EVM addresses
|
|
216
|
+
* must be lowercase hex; other chain identifiers compare case-sensitively
|
|
217
|
+
* and retain their canonical spelling when stored and signed. Multiple holdings
|
|
218
|
+
* may share a place, including multiple reward tokens, but duplicate identities
|
|
219
|
+
* are rejected. Instrument holdings appear under the instrument, not again
|
|
220
|
+
* under its chain account.
|
|
221
|
+
* Missing holdings are unobserved and must never be treated as zero.
|
|
187
222
|
*
|
|
188
223
|
* Signed observations use the shared `YmaxObservation` version-1 schema.
|
|
189
224
|
* Legacy balance-only entries retain their original resolved signed type;
|
|
190
225
|
* typed fields are optional in that schema for compatibility, but must form a
|
|
191
226
|
* complete typed holding when present. Optional-field presence is uniform per
|
|
192
|
-
* signed struct type. The converters always include `
|
|
227
|
+
* signed struct type. The converters always include `valueUusd` for typed
|
|
193
228
|
* holdings on the wire, encoding an absent valuation as `-1n` and stripping
|
|
194
229
|
* that sentinel when decoding. Never add unsigned holdings to a legacy
|
|
195
230
|
* signature, or infer shares from either valuation field.
|
|
@@ -198,23 +233,15 @@ export type LegacyHoldingDetail = {
|
|
|
198
233
|
* typed holdings with transitional `balanceUsdc`; consumers then adopt typed
|
|
199
234
|
* holdings before legacy balances and balance-only entries are retired.
|
|
200
235
|
*/
|
|
201
|
-
export type TypedHoldingDetail = {
|
|
202
|
-
/**
|
|
203
|
-
place: PortfolioBalancePlaceRef;
|
|
204
|
-
kind: HoldingKind;
|
|
205
|
-
/**
|
|
206
|
-
* Vault address for shares; underlying token address for principal, rewards,
|
|
207
|
-
* and other ERC-20 holdings. Native tokens use the zero address.
|
|
208
|
-
*/
|
|
209
|
-
tokenAddress: EvmAddress;
|
|
210
|
-
/** Native token units, independent of USD valuation. Zero is observed zero. */
|
|
236
|
+
export type TypedHoldingDetail = HoldingIdentity & {
|
|
237
|
+
/** Raw asset units, independent of USD valuation. Zero is observed zero. */
|
|
211
238
|
amount: bigint;
|
|
212
239
|
/**
|
|
213
240
|
* Valuation in micro-USD; absent if not observed, distinct from known zero.
|
|
214
241
|
* Known values range from `0n` through `2n ** 255n - 1n`. This is not a raw
|
|
215
242
|
* token quantity and must not be added to `balanceUsdc`.
|
|
216
243
|
*/
|
|
217
|
-
|
|
244
|
+
valueUusd?: bigint;
|
|
218
245
|
/**
|
|
219
246
|
* @deprecated Transitional legacy valuation in micro-USDC, summed per place
|
|
220
247
|
* into `PlanObservations['balances']` for consumers not yet reading typed
|
package/src/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,qBAAqB,IAAI,0BAA0B,EACpD,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;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185
|
|
|
@@ -190,7 +190,12 @@ import {
|
|
|
190
190
|
* vault shares; `principal` identifies instrument principal (for example Aave
|
|
191
191
|
* or Compound). `claimable-reward` belongs to an instrument, while
|
|
192
192
|
* `claimed-reward` and other `token` holdings belong to a chain account.
|
|
193
|
-
*
|
|
193
|
+
* Cosmos bank assets are ordinary `token` holdings, e.g. Noble USDC has
|
|
194
|
+
* `kind: 'token', tokenId: 'uusdc'`. `$SYMBOL` is reserved for a chain's own
|
|
195
|
+
* coin on chains where other tokens are contracts (such as `$ETH`, `$AVAX`,
|
|
196
|
+
* or later `$SOL`); it uses an empty `tokenId`. The nonempty symbol is the
|
|
197
|
+
* coin's display symbol. `$` holdings and Cosmos USDC are never reward-swap
|
|
198
|
+
* input.
|
|
194
199
|
*/
|
|
195
200
|
;
|
|
196
201
|
|
|
@@ -206,20 +211,58 @@ import {
|
|
|
206
211
|
|
|
207
212
|
|
|
208
213
|
|
|
214
|
+
;
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
|
|
218
|
+
;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Token identifier local to the chain implied by `place`: a lowercase EVM
|
|
222
|
+
* contract address (vault for shares, underlying token for principal,
|
|
223
|
+
* rewards, or ERC-20 holdings), a raw Cosmos bank denom (e.g. `uusdc`,
|
|
224
|
+
* `ibc/…`, `factory/…`), or another chain's canonical identifier such as a
|
|
225
|
+
* Solana mint. `$SYMBOL` holdings use the empty string. Do not substitute
|
|
226
|
+
* a display symbol or repeat the chain as a CAIP-19 identifier. Resolve
|
|
227
|
+
* decimal scale from chain asset metadata for this identifier. Preserve its
|
|
228
|
+
* spelling for storage, signing, and chain operations. Compare token IDs using
|
|
229
|
+
* `makeTokenIdKey(tokenId, place)`: EVM `0x` identifiers compare in lowercase;
|
|
230
|
+
* non-EVM identifiers compare case-sensitively.
|
|
231
|
+
*/
|
|
232
|
+
;
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
209
249
|
/**
|
|
210
250
|
* One authenticated raw holding, independent of its USD valuation.
|
|
211
251
|
*
|
|
212
|
-
* The identity is `(place, kind,
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
252
|
+
* The identity is `(place, kind, tokenId)`: compare `place` and `kind` exactly
|
|
253
|
+
* and compare `tokenId` using its chain-aware canonical key. EVM addresses
|
|
254
|
+
* must be lowercase hex; other chain identifiers compare case-sensitively
|
|
255
|
+
* and retain their canonical spelling when stored and signed. Multiple holdings
|
|
256
|
+
* may share a place, including multiple reward tokens, but duplicate identities
|
|
257
|
+
* are rejected. Instrument holdings appear under the instrument, not again
|
|
258
|
+
* under its chain account.
|
|
259
|
+
* Missing holdings are unobserved and must never be treated as zero.
|
|
217
260
|
*
|
|
218
261
|
* Signed observations use the shared `YmaxObservation` version-1 schema.
|
|
219
262
|
* Legacy balance-only entries retain their original resolved signed type;
|
|
220
263
|
* typed fields are optional in that schema for compatibility, but must form a
|
|
221
264
|
* complete typed holding when present. Optional-field presence is uniform per
|
|
222
|
-
* signed struct type. The converters always include `
|
|
265
|
+
* signed struct type. The converters always include `valueUusd` for typed
|
|
223
266
|
* holdings on the wire, encoding an absent valuation as `-1n` and stripping
|
|
224
267
|
* that sentinel when decoding. Never add unsigned holdings to a legacy
|
|
225
268
|
* signature, or infer shares from either valuation field.
|
|
@@ -228,23 +271,15 @@ import {
|
|
|
228
271
|
* typed holdings with transitional `balanceUsdc`; consumers then adopt typed
|
|
229
272
|
* holdings before legacy balances and balance-only entries are retired.
|
|
230
273
|
*/
|
|
231
|
-
;
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
274
|
+
;
|
|
275
|
+
|
|
241
276
|
|
|
242
277
|
|
|
243
278
|
|
|
244
279
|
|
|
245
280
|
|
|
246
281
|
|
|
247
|
-
|
|
282
|
+
|
|
248
283
|
|
|
249
284
|
|
|
250
285
|
|