@ouronet/ouronet-core 4.3.6

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.
Files changed (101) hide show
  1. package/CHANGELOG.md +3043 -0
  2. package/README.md +1940 -0
  3. package/dist/codex/codec.d.ts +77 -0
  4. package/dist/codex/codec.js +123 -0
  5. package/dist/codex/errors.d.ts +14 -0
  6. package/dist/codex/errors.js +20 -0
  7. package/dist/codex/index.d.ts +27 -0
  8. package/dist/codex/index.js +25 -0
  9. package/dist/codex/seedTypeMigration.d.ts +35 -0
  10. package/dist/codex/seedTypeMigration.js +45 -0
  11. package/dist/codex/types.d.ts +100 -0
  12. package/dist/codex/types.js +19 -0
  13. package/dist/constants/index.d.ts +2 -0
  14. package/dist/constants/index.js +3 -0
  15. package/dist/constants/ouronet.d.ts +33 -0
  16. package/dist/constants/ouronet.js +59 -0
  17. package/dist/constants/tokenIds.d.ts +13 -0
  18. package/dist/constants/tokenIds.js +21 -0
  19. package/dist/index.d.ts +18 -0
  20. package/dist/index.js +1 -0
  21. package/dist/interactions/activateFunctions.d.ts +67 -0
  22. package/dist/interactions/activateFunctions.js +154 -0
  23. package/dist/interactions/addLiquidityFunctions.d.ts +140 -0
  24. package/dist/interactions/addLiquidityFunctions.js +485 -0
  25. package/dist/interactions/coilFunctions.d.ts +73 -0
  26. package/dist/interactions/coilFunctions.js +213 -0
  27. package/dist/interactions/crossChainFunctions.d.ts +211 -0
  28. package/dist/interactions/crossChainFunctions.js +463 -0
  29. package/dist/interactions/dexAcquisitionPoolFunctions.d.ts +18 -0
  30. package/dist/interactions/dexAcquisitionPoolFunctions.js +18 -0
  31. package/dist/interactions/dexCollectablesFunctions.d.ts +28 -0
  32. package/dist/interactions/dexCollectablesFunctions.js +227 -0
  33. package/dist/interactions/dexFunctions.d.ts +23 -0
  34. package/dist/interactions/dexFunctions.js +23 -0
  35. package/dist/interactions/dexOrtoFungibleFunctions.d.ts +33 -0
  36. package/dist/interactions/dexOrtoFungibleFunctions.js +171 -0
  37. package/dist/interactions/dexParseFunctions.d.ts +150 -0
  38. package/dist/interactions/dexParseFunctions.js +316 -0
  39. package/dist/interactions/dexSwapPairAdminFunctions.d.ts +75 -0
  40. package/dist/interactions/dexSwapPairAdminFunctions.js +255 -0
  41. package/dist/interactions/dexSwapPairCalcFunctions.d.ts +55 -0
  42. package/dist/interactions/dexSwapPairCalcFunctions.js +218 -0
  43. package/dist/interactions/dexSwapPairDashboardFunctions.d.ts +47 -0
  44. package/dist/interactions/dexSwapPairDashboardFunctions.js +179 -0
  45. package/dist/interactions/dexSwapPairExecuteFunctions.d.ts +40 -0
  46. package/dist/interactions/dexSwapPairExecuteFunctions.js +301 -0
  47. package/dist/interactions/dexSwapPairSmartSwapFunctions.d.ts +25 -0
  48. package/dist/interactions/dexSwapPairSmartSwapFunctions.js +166 -0
  49. package/dist/interactions/dexTrueFungibleFunctions.d.ts +52 -0
  50. package/dist/interactions/dexTrueFungibleFunctions.js +220 -0
  51. package/dist/interactions/dexTypes.d.ts +465 -0
  52. package/dist/interactions/dexTypes.js +6 -0
  53. package/dist/interactions/errors.d.ts +12 -0
  54. package/dist/interactions/errors.js +13 -0
  55. package/dist/interactions/guardFunctions.d.ts +33 -0
  56. package/dist/interactions/guardFunctions.js +110 -0
  57. package/dist/interactions/index.d.ts +1 -0
  58. package/dist/interactions/index.js +20 -0
  59. package/dist/interactions/infoOneFunctions.d.ts +133 -0
  60. package/dist/interactions/infoOneFunctions.js +566 -0
  61. package/dist/interactions/kadenaFunctions.d.ts +11 -0
  62. package/dist/interactions/kadenaFunctions.js +40 -0
  63. package/dist/interactions/kpayFunctions.d.ts +45 -0
  64. package/dist/interactions/kpayFunctions.js +191 -0
  65. package/dist/interactions/ouroAccountFunctions.d.ts +64 -0
  66. package/dist/interactions/ouroAccountFunctions.js +229 -0
  67. package/dist/interactions/ouroBalanceFunctions.d.ts +39 -0
  68. package/dist/interactions/ouroBalanceFunctions.js +100 -0
  69. package/dist/interactions/ouroCoilFunctions.d.ts +33 -0
  70. package/dist/interactions/ouroCoilFunctions.js +190 -0
  71. package/dist/interactions/ouroFunctions.d.ts +23 -0
  72. package/dist/interactions/ouroFunctions.js +23 -0
  73. package/dist/interactions/ouroMovieBoosterFunctions.d.ts +18 -0
  74. package/dist/interactions/ouroMovieBoosterFunctions.js +203 -0
  75. package/dist/interactions/ouroPriceFunctions.d.ts +38 -0
  76. package/dist/interactions/ouroPriceFunctions.js +96 -0
  77. package/dist/interactions/ouroPrimordialsFunctions.d.ts +10 -0
  78. package/dist/interactions/ouroPrimordialsFunctions.js +480 -0
  79. package/dist/interactions/ouroRotateFunctions.d.ts +22 -0
  80. package/dist/interactions/ouroRotateFunctions.js +114 -0
  81. package/dist/interactions/ouroSubCompressFunctions.d.ts +23 -0
  82. package/dist/interactions/ouroSubCompressFunctions.js +191 -0
  83. package/dist/interactions/ouroTransferFunctions.d.ts +14 -0
  84. package/dist/interactions/ouroTransferFunctions.js +87 -0
  85. package/dist/interactions/ouroTypes.d.ts +113 -0
  86. package/dist/interactions/ouroTypes.js +6 -0
  87. package/dist/interactions/ouroUrStoaFunctions.d.ts +16 -0
  88. package/dist/interactions/ouroUrStoaFunctions.js +121 -0
  89. package/dist/interactions/ouroWrapFunctions.d.ts +22 -0
  90. package/dist/interactions/ouroWrapFunctions.js +234 -0
  91. package/dist/interactions/pensionFunctions.d.ts +12 -0
  92. package/dist/interactions/pensionFunctions.js +127 -0
  93. package/dist/interactions/urStoaFunctions.d.ts +104 -0
  94. package/dist/interactions/urStoaFunctions.js +475 -0
  95. package/dist/interactions/wrapFunctions.d.ts +46 -0
  96. package/dist/interactions/wrapFunctions.js +221 -0
  97. package/dist/pact/cfmBuilders.d.ts +807 -0
  98. package/dist/pact/cfmBuilders.js +812 -0
  99. package/dist/pact/index.d.ts +1 -0
  100. package/dist/pact/index.js +10 -0
  101. package/package.json +64 -0
@@ -0,0 +1,220 @@
1
+ /**
2
+ * dexTrueFungibleFunctions.ts
3
+ * True Fungible (TF) entity reads — LP entries, header, entries, native/frozen LP, button state, swpair lookup.
4
+ */
5
+ import { KADENA_NAMESPACE } from "../constants/index.js";
6
+ import { pactRead } from "@stoachain/stoa-core/reads";
7
+ import { getLogger } from "@stoachain/stoa-core/observability";
8
+ export async function getTrueFungibleLPEntry(account, swpair, izNative) {
9
+ try {
10
+ const boolStr = izNative ? "true" : "false";
11
+ const pactCode = izNative
12
+ ? `(${KADENA_NAMESPACE}.DPL-UR.URC_0008b_TrueFungibleLPEntry "${account}" "${swpair}" ${boolStr})`
13
+ : `(try false (${KADENA_NAMESPACE}.DPL-UR.URC_0008b_TrueFungibleLPEntry "${account}" "${swpair}" ${boolStr}))`;
14
+ const response = await pactRead(pactCode, { tier: "T2" });
15
+ if (!response?.result || response.result.status === "failure")
16
+ return null;
17
+ const data = response.result.data;
18
+ if (!izNative && (typeof data === "boolean" || data === false))
19
+ return null;
20
+ if (!data || typeof data !== "object")
21
+ return null;
22
+ return data;
23
+ }
24
+ catch (error) {
25
+ getLogger().error("Error in getTrueFungibleLPEntry:", error);
26
+ return null;
27
+ }
28
+ }
29
+ export async function getLPEntries(account, swpair) {
30
+ const [native, frozen] = await Promise.all([
31
+ getTrueFungibleLPEntry(account, swpair, true),
32
+ getTrueFungibleLPEntry(account, swpair, false),
33
+ ]);
34
+ return { native, frozen };
35
+ }
36
+ /**
37
+ * Fetch swap pairs owned by a specific Ouronet resident account.
38
+ * Returns a list of swpair IDs that the account can manage.
39
+ */
40
+ export async function getOwnedSwapPairs(account) {
41
+ try {
42
+ const response = await pactRead(`(${KADENA_NAMESPACE}.SWP.URD_OwnedSwapPairs "${account}")`, { tier: "T5" });
43
+ if (!response?.result || response.result.status === "failure")
44
+ return [];
45
+ const data = response.result.data;
46
+ if (Array.isArray(data))
47
+ return data;
48
+ return [];
49
+ }
50
+ catch (error) {
51
+ getLogger().error("Error in getOwnedSwapPairs:", error);
52
+ return [];
53
+ }
54
+ }
55
+ /**
56
+ * Fetch True Fungible header data for an account.
57
+ * Returns global TF count, held TF list/count, managed TF list/count.
58
+ */
59
+ export async function getTrueFungibleHeader(account) {
60
+ try {
61
+ const pactCode = `(${KADENA_NAMESPACE}.DPL-UR.URC_0016_TruefungibleHeader "${account}")`;
62
+ const response = await pactRead(pactCode, { tier: "T5" });
63
+ if (!response?.result || response.result.status === "failure")
64
+ return null;
65
+ const data = response.result.data;
66
+ if (!data || typeof data !== "object")
67
+ return null;
68
+ return data;
69
+ }
70
+ catch (err) {
71
+ getLogger().error("URC_0016_TruefungibleHeader failed:", err);
72
+ return null;
73
+ }
74
+ }
75
+ /**
76
+ * Batch-fetch TrueFungibleEntry data for multiple token IDs using the chain mapper function.
77
+ * Works for Native, Frozen, and Reserved tokens (not LP).
78
+ * Uses URC_0008a_TrueFungibleEntryMapper(account, dptfs:[string])
79
+ */
80
+ export async function getTrueFungibleEntries(account, tokenIds) {
81
+ if (tokenIds.length === 0)
82
+ return [];
83
+ try {
84
+ const listItems = tokenIds.map(id => `"${id}"`).join(" ");
85
+ const pactCode = `(${KADENA_NAMESPACE}.DPL-UR.URC_0008a_TrueFungibleEntryMapper "${account}" [${listItems}])`;
86
+ const response = await pactRead(pactCode, { tier: "T5" });
87
+ if (!response?.result || response.result.status === "failure")
88
+ return tokenIds.map(() => null);
89
+ const data = response.result.data;
90
+ if (!Array.isArray(data))
91
+ return tokenIds.map(() => null);
92
+ return data.map((item) => {
93
+ if (!item || typeof item !== "object" || item === false)
94
+ return null;
95
+ return item;
96
+ });
97
+ }
98
+ catch (err) {
99
+ getLogger().error("URC_0008a_TrueFungibleEntryMapper failed:", err);
100
+ return tokenIds.map(() => null);
101
+ }
102
+ }
103
+ /**
104
+ * Batch-fetch Native LP entry data using the chain mapper function.
105
+ * Uses URC_0008b_TrueFungibleNativeLPMapper(account, lp-ids:[string])
106
+ * Accepts LP token IDs directly — chain resolves swpairs internally.
107
+ */
108
+ export async function getNativeLPEntries(account, lpIds) {
109
+ if (lpIds.length === 0)
110
+ return [];
111
+ try {
112
+ const listItems = lpIds.map(id => `"${id}"`).join(" ");
113
+ const pactCode = `(${KADENA_NAMESPACE}.DPL-UR.URC_0008b_TrueFungibleNativeLPMapper "${account}" [${listItems}])`;
114
+ const response = await pactRead(pactCode, { tier: "T5" });
115
+ if (!response?.result || response.result.status === "failure")
116
+ return lpIds.map(() => null);
117
+ const data = response.result.data;
118
+ if (!Array.isArray(data))
119
+ return lpIds.map(() => null);
120
+ return data.map((item) => {
121
+ if (!item || typeof item !== "object" || item === false)
122
+ return null;
123
+ return item;
124
+ });
125
+ }
126
+ catch (err) {
127
+ getLogger().error("URC_0008b_TrueFungibleNativeLPMapper failed:", err);
128
+ return lpIds.map(() => null);
129
+ }
130
+ }
131
+ /**
132
+ * Batch-fetch Frozen LP entry data using the chain mapper function.
133
+ * Uses URC_0008b_TrueFungibleFrozenLPMapper(account, lp-ids:[string])
134
+ * Accepts LP token IDs directly — chain resolves swpairs internally.
135
+ */
136
+ export async function getFrozenLPEntries(account, lpIds) {
137
+ if (lpIds.length === 0)
138
+ return [];
139
+ try {
140
+ const listItems = lpIds.map(id => `"${id}"`).join(" ");
141
+ const pactCode = `(${KADENA_NAMESPACE}.DPL-UR.URC_0008b_TrueFungibleFrozenLPMapper "${account}" [${listItems}])`;
142
+ const response = await pactRead(pactCode, { tier: "T5" });
143
+ if (!response?.result || response.result.status === "failure")
144
+ return lpIds.map(() => null);
145
+ const data = response.result.data;
146
+ if (!Array.isArray(data))
147
+ return lpIds.map(() => null);
148
+ return data.map((item) => {
149
+ if (!item || typeof item !== "object" || item === false)
150
+ return null;
151
+ return item;
152
+ });
153
+ }
154
+ catch (err) {
155
+ getLogger().error("URC_0008b_TrueFungibleFrozenLPMapper failed:", err);
156
+ return lpIds.map(() => null);
157
+ }
158
+ }
159
+ /**
160
+ * Get the SWP-Pair ID from an LP token ID.
161
+ * Uses SWP.UR_GetLpSwpair on chain.
162
+ */
163
+ export async function getSwpairFromLpId(lpId) {
164
+ try {
165
+ const pactCode = `(${KADENA_NAMESPACE}.SWP.UR_GetLpSwpair "${lpId}")`;
166
+ const response = await pactRead(pactCode, { tier: "T5" });
167
+ if (!response?.result || response.result.status === "failure")
168
+ return null;
169
+ const data = response.result.data;
170
+ if (typeof data !== "string")
171
+ return null;
172
+ return data;
173
+ }
174
+ catch (error) {
175
+ getLogger().error("Error in getSwpairFromLpId:", error);
176
+ return null;
177
+ }
178
+ }
179
+ /**
180
+ * Batch-fetch SWP-Pair IDs for multiple LP token IDs using a single Pact (map ...) call.
181
+ */
182
+ export async function getSwpairsFromLpIds(lpIds) {
183
+ if (lpIds.length === 0)
184
+ return [];
185
+ try {
186
+ const listItems = lpIds.map(id => `"${id}"`).join(" ");
187
+ const pactCode = `(map (lambda (lid:string) (try "" (${KADENA_NAMESPACE}.SWP.UR_GetLpSwpair lid))) [${listItems}])`;
188
+ const response = await pactRead(pactCode, { tier: "T5" });
189
+ if (!response?.result || response.result.status === "failure")
190
+ return lpIds.map(() => null);
191
+ const data = response.result.data;
192
+ if (!Array.isArray(data))
193
+ return lpIds.map(() => null);
194
+ return data.map((v) => (typeof v === "string" && v !== "" ? v : null));
195
+ }
196
+ catch (error) {
197
+ getLogger().error("Error in getSwpairsFromLpIds:", error);
198
+ return lpIds.map(() => null);
199
+ }
200
+ }
201
+ /**
202
+ * Fetch button enable/disable state for a specific token held by an account.
203
+ * Uses URC_0017_TruefungibleButton(account, dptf)
204
+ */
205
+ export async function getTrueFungibleButtonState(account, dptfId) {
206
+ try {
207
+ const pactCode = `(${KADENA_NAMESPACE}.DPL-UR.URC_0017_TruefungibleButton "${account}" "${dptfId}")`;
208
+ const response = await pactRead(pactCode, { tier: "T5" });
209
+ if (!response?.result || response.result.status === "failure")
210
+ return null;
211
+ const data = response.result.data;
212
+ if (!data || typeof data !== "object")
213
+ return null;
214
+ return data;
215
+ }
216
+ catch (err) {
217
+ getLogger().error("URC_0017_TruefungibleButton failed:", err);
218
+ return null;
219
+ }
220
+ }
@@ -0,0 +1,465 @@
1
+ /**
2
+ * dexTypes.ts
3
+ * Cross-cutting interface and type-alias definitions for the DEX entity files.
4
+ * Sole non-local re-export: IKadenaKeypair from @stoachain/stoa-core/signing.
5
+ */
6
+ export type { IKadenaKeypair } from "@stoachain/stoa-core/signing";
7
+ import type { IKadenaKeypair } from "@stoachain/stoa-core/signing";
8
+ export interface IOuroAccountKeypair {
9
+ readonly address: string;
10
+ readonly publicKey: string;
11
+ readonly privateKey?: string;
12
+ }
13
+ export interface DecimalValue {
14
+ readonly decimal: string;
15
+ }
16
+ export interface SwapPoolData {
17
+ readonly "liquid-fee": number;
18
+ readonly "lp-fee": number;
19
+ readonly "lp-supply": DecimalValue;
20
+ readonly "special-fee": number;
21
+ readonly "special-fee-targets-short": readonly string[];
22
+ readonly "pool-value-in-dwk": DecimalValue;
23
+ readonly "special-fee-targets": readonly string[];
24
+ readonly "tvl-in-$": string;
25
+ readonly "lp-value-in-$": string;
26
+ readonly "pool-type": string;
27
+ readonly "special-fee-targets-proportions": readonly number[];
28
+ readonly "pool-type-word": string;
29
+ readonly "pool-token-supplies": readonly DecimalValue[];
30
+ readonly "lp-value-in-dwk": DecimalValue;
31
+ readonly "total-fee": number;
32
+ readonly "pool-tokens": readonly string[];
33
+ }
34
+ export interface PoolPreviewData {
35
+ readonly "liquid-fee": number;
36
+ readonly "lp-fee": number;
37
+ readonly "lp-supply": DecimalValue;
38
+ readonly "special-fee": number;
39
+ readonly "special-fee-targets-short": readonly string[];
40
+ readonly "pool-value-in-dwk": DecimalValue;
41
+ readonly "special-fee-targets": readonly string[];
42
+ readonly "tvl-in-$": string;
43
+ readonly "lp-value-in-$": string;
44
+ readonly "pool-type": string;
45
+ readonly "special-fee-targets-proportions": readonly number[];
46
+ readonly "pool-type-word": string;
47
+ readonly "pool-token-supplies": readonly DecimalValue[];
48
+ readonly "lp-value-in-dwk": DecimalValue;
49
+ readonly "total-fee": number;
50
+ readonly "pool-tokens": readonly string[];
51
+ readonly "ft-pool-value-in-dwk": string;
52
+ readonly "ft-lp-supply": string;
53
+ readonly "ft-lp-value-in-dwk": string;
54
+ readonly "ft-pool-token-supplies": readonly string[];
55
+ readonly "weigths": readonly number[];
56
+ }
57
+ export interface SwpairInternalDashboard {
58
+ readonly "special-fee-target-proportions": readonly number[];
59
+ readonly "primality": string;
60
+ readonly "liquid-fee": number;
61
+ readonly "lp-fee": number;
62
+ readonly "lp-supply": DecimalValue;
63
+ readonly "special-fee": number;
64
+ readonly "ft-pool-value-in-dwk": string;
65
+ readonly "special-fee-targets-short": readonly string[];
66
+ readonly "pool-value-in-dwk": DecimalValue;
67
+ readonly "special-fee-targets": readonly string[];
68
+ readonly "tvl-in-$": string;
69
+ readonly "fee-lockup": string;
70
+ readonly "swapping-enabled": string;
71
+ readonly "ft-lp-supply": string;
72
+ readonly "genesis-supplies": readonly number[];
73
+ readonly "liquidity-enabled": string;
74
+ readonly "genesis-weights": readonly number[];
75
+ readonly "lp-value-in-$": string;
76
+ readonly "pool-type": string;
77
+ readonly "amplifier": number;
78
+ readonly "ft-genesis-supplies": readonly string[];
79
+ readonly "pool-type-word": string;
80
+ readonly "ft-lp-value-in-dwk": string;
81
+ readonly "pool-token-supplies": readonly DecimalValue[];
82
+ readonly "ft-pool-token-supplies": readonly string[];
83
+ readonly "lp-value-in-dwk": DecimalValue;
84
+ readonly "fee-unlocks": {
85
+ readonly "int": number;
86
+ };
87
+ readonly "weigths": readonly number[];
88
+ readonly "frozen-and-sleeping": string;
89
+ readonly "total-fee": number;
90
+ readonly "pool-tokens": readonly string[];
91
+ }
92
+ export interface SwapCalculationResult {
93
+ readonly "output-amount": string;
94
+ readonly "to-liquidity-providers": readonly string[];
95
+ readonly "to-liquid-boost": string;
96
+ readonly "to-special-targets": string;
97
+ }
98
+ export interface InverseSwapResult {
99
+ readonly [key: string]: any;
100
+ }
101
+ export interface CappedInverseResult {
102
+ readonly decimal: string;
103
+ }
104
+ export interface UserAccountSupplies {
105
+ readonly [key: string]: any;
106
+ }
107
+ export interface SwapLiquidityProviderItem {
108
+ readonly token: string;
109
+ readonly amount: number;
110
+ }
111
+ export interface SwapLiquidityProviderItemPrecise {
112
+ readonly token: string;
113
+ readonly amount: string;
114
+ }
115
+ export interface SwapExecutionParams {
116
+ readonly patronKeypair: IOuroAccountKeypair;
117
+ readonly kadenaKeypair: IKadenaKeypair;
118
+ readonly guardKeypair: IKadenaKeypair;
119
+ readonly account: string;
120
+ readonly swpair: string;
121
+ readonly outputId: string;
122
+ }
123
+ /**
124
+ * Slippage bounds object returned by SWPU.UDC_SpawnSlippageBounds
125
+ */
126
+ export interface SlippageBounds {
127
+ readonly "expected-output-amount": number;
128
+ readonly "output-precision": number;
129
+ readonly "slippage-percent": number;
130
+ }
131
+ /**
132
+ * Return type for SmartSwap hopper preview
133
+ */
134
+ export interface SmartSwapHopper {
135
+ readonly "output-amount"?: any;
136
+ readonly "best-output"?: any;
137
+ readonly "output"?: any;
138
+ readonly "hops"?: number | {
139
+ readonly int: number;
140
+ };
141
+ readonly "trace"?: readonly string[];
142
+ readonly "nodes"?: readonly string[];
143
+ readonly "edges"?: readonly string[];
144
+ readonly [key: string]: any;
145
+ }
146
+ /**
147
+ * Return type for SmartSwap slippage bounds
148
+ */
149
+ export interface SmartSwapSlippageBounds {
150
+ readonly "expected-output-amount": DecimalValue | number;
151
+ readonly "output-precision": {
152
+ readonly int: number;
153
+ } | number;
154
+ readonly "slippage-percent": DecimalValue | number;
155
+ }
156
+ /**
157
+ * SmartSwap execution params
158
+ */
159
+ export interface SmartSwapExecutionParams {
160
+ readonly patronKeypair: IOuroAccountKeypair;
161
+ readonly kadenaKeypair: IKadenaKeypair;
162
+ readonly guardKeypair: IKadenaKeypair;
163
+ readonly account: string;
164
+ readonly inputId: string;
165
+ readonly inputAmount: string | number;
166
+ readonly outputId: string;
167
+ readonly slippage?: number;
168
+ }
169
+ /** Response shape from URC_0008b_TrueFungibleLPEntry */
170
+ export interface TrueFungibleLPEntry {
171
+ readonly t1: string;
172
+ readonly t2: string;
173
+ readonly "wallet-supply": {
174
+ readonly decimal: string;
175
+ } | number;
176
+ readonly "dptf-supply": {
177
+ readonly decimal: string;
178
+ } | number;
179
+ readonly "wallet-worth-in-stoa": {
180
+ readonly decimal: string;
181
+ } | number;
182
+ readonly "wallet-worth-in-dollarz": string;
183
+ readonly "token-worth-in-stoa": {
184
+ readonly decimal: string;
185
+ } | number;
186
+ readonly "token-worth-in-dollarz": string;
187
+ }
188
+ /**
189
+ * Response shape from URC_0016_TruefungibleHeader
190
+ */
191
+ export interface TrueFungibleHeaderData {
192
+ readonly "total-true-fungible-number": number | {
193
+ readonly int: number;
194
+ };
195
+ readonly "held-tf": readonly string[];
196
+ readonly "held-tf-number": number | {
197
+ readonly int: number;
198
+ };
199
+ readonly "mngd-tf": readonly string[];
200
+ readonly "mngd-tf-number": number | {
201
+ readonly int: number;
202
+ };
203
+ }
204
+ /**
205
+ * Response shape from URC_0008a_TrueFungibleEntry (Native/Frozen/Reserved tokens)
206
+ */
207
+ export interface TrueFungibleEntryData {
208
+ readonly t1: string;
209
+ readonly t2: string;
210
+ readonly "wallet-supply": {
211
+ readonly decimal: string;
212
+ } | number;
213
+ readonly "dptf-supply": {
214
+ readonly decimal: string;
215
+ } | number;
216
+ readonly "wallet-worth-in-stoa": {
217
+ readonly decimal: string;
218
+ } | number;
219
+ readonly "wallet-worth-in-dollarz": string;
220
+ readonly "token-worth-in-stoa": {
221
+ readonly decimal: string;
222
+ } | number;
223
+ readonly "token-worth-in-dollarz": string;
224
+ }
225
+ /**
226
+ * Response shape from URC_0017_TruefungibleButton
227
+ * Boolean per action key — true = button enabled, false = disabled.
228
+ * where-* keys provide target pool info for coil/curl/constrict/brumate.
229
+ */
230
+ export interface TrueFungibleButtonState {
231
+ readonly mint: boolean;
232
+ readonly burn: boolean;
233
+ readonly wipe: boolean;
234
+ readonly unfold: boolean;
235
+ readonly freeze: boolean;
236
+ readonly reserve: boolean;
237
+ readonly vest: boolean;
238
+ readonly sleep: boolean;
239
+ readonly hibernate: boolean;
240
+ readonly coil: boolean;
241
+ readonly curl: boolean;
242
+ readonly constrict: boolean;
243
+ readonly brumate: boolean;
244
+ readonly recover: boolean;
245
+ readonly sublimate: boolean;
246
+ readonly compress: boolean;
247
+ readonly transmute: boolean;
248
+ readonly unwrap: boolean;
249
+ readonly transfer: boolean;
250
+ readonly "where-coil"?: any;
251
+ readonly "where-curl"?: any;
252
+ readonly "where-constrict"?: any;
253
+ readonly "where-brumate"?: any;
254
+ }
255
+ export interface OrtoFungibleHeaderData {
256
+ readonly "total-orto-fungible-number": number | {
257
+ readonly int: number;
258
+ };
259
+ readonly "total-orto-fungible-nonces": number | {
260
+ readonly int: number;
261
+ };
262
+ readonly "held-of": readonly string[];
263
+ readonly "held-of-number": number | {
264
+ readonly int: number;
265
+ };
266
+ readonly "mngd-of": readonly string[];
267
+ readonly "mngd-of-number": number | {
268
+ readonly int: number;
269
+ };
270
+ }
271
+ /**
272
+ * OrtoFungible token category, classified from the token-id prefix:
273
+ * Sleeping LP: Z|S|, Z|W|, Z|P|
274
+ * Vesting: V|
275
+ * Sleeping: Z| (but NOT Z|S|, Z|W|, Z|P|)
276
+ * Hibernating: H|
277
+ * Native: everything else
278
+ */
279
+ export type OrtoFungibleCategory = "native" | "vesting" | "sleeping" | "hibernating" | "sleeping-lp";
280
+ /**
281
+ * Response shape from URC_0009a_OrtoFungibleEntryMapper
282
+ * Same as TrueFungibleEntryData but with extra "wallet-nonces" field.
283
+ */
284
+ export interface OrtoFungibleEntryData {
285
+ readonly t1: string;
286
+ readonly t2: string;
287
+ readonly "wallet-supply": {
288
+ readonly decimal: string;
289
+ } | number;
290
+ readonly "dpof-supply": {
291
+ readonly decimal: string;
292
+ } | number;
293
+ readonly "wallet-worth-in-stoa": {
294
+ readonly decimal: string;
295
+ } | number;
296
+ readonly "wallet-worth-in-dollarz": string;
297
+ readonly "token-worth-in-stoa": {
298
+ readonly decimal: string;
299
+ } | number;
300
+ readonly "token-worth-in-dollarz": string;
301
+ readonly "wallet-nonces": readonly number[];
302
+ readonly "wallet-nonces-no": number | {
303
+ readonly int: number;
304
+ };
305
+ }
306
+ /**
307
+ * Hibernating nonce data — custom metadata for hibernating tokens.
308
+ * Returns: { dptf-id, nonce-supply, mint-time, release-time, hibernating-fee-promile, remainder, hibernating-fee }
309
+ */
310
+ export interface HibernatingNonceData {
311
+ readonly "dptf-id": string;
312
+ readonly "nonce-supply": {
313
+ readonly decimal: string;
314
+ } | number;
315
+ readonly "mint-time": string;
316
+ readonly "release-time": string;
317
+ readonly "hibernating-fee-promile": {
318
+ readonly decimal: string;
319
+ } | number;
320
+ readonly "remainder": {
321
+ readonly decimal: string;
322
+ } | number;
323
+ readonly "hibernating-fee": {
324
+ readonly decimal: string;
325
+ } | number;
326
+ }
327
+ export interface OrtofungibleButtonState {
328
+ readonly transfer: boolean;
329
+ readonly transmit: boolean;
330
+ readonly redeem: boolean;
331
+ readonly "reverse-hrbt": boolean;
332
+ readonly unvest: boolean;
333
+ readonly unsleep: boolean;
334
+ readonly merge: boolean;
335
+ readonly awake: boolean;
336
+ readonly slumber: boolean;
337
+ readonly wipe: boolean;
338
+ readonly burn: boolean;
339
+ readonly mint: boolean;
340
+ readonly "add-quantity": boolean;
341
+ readonly [key: string]: boolean;
342
+ }
343
+ export interface CollectablesHeaderData {
344
+ readonly "total-semi-fungible-number": number | {
345
+ readonly int: number;
346
+ };
347
+ readonly "total-semi-fungible-nonces": number | {
348
+ readonly int: number;
349
+ };
350
+ readonly "held-sf": readonly string[];
351
+ readonly "held-sf-number": number | {
352
+ readonly int: number;
353
+ };
354
+ readonly "mngd-sf": readonly string[];
355
+ readonly "mngd-sf-no": number | {
356
+ readonly int: number;
357
+ };
358
+ readonly "total-non-fungible-number": number | {
359
+ readonly int: number;
360
+ };
361
+ readonly "total-non-fungible-nonces": number | {
362
+ readonly int: number;
363
+ };
364
+ readonly "held-nf": readonly string[];
365
+ readonly "held-nf-number": number | {
366
+ readonly int: number;
367
+ };
368
+ readonly "mngd-nf": readonly string[];
369
+ readonly "mngd-nf-no": number | {
370
+ readonly int: number;
371
+ };
372
+ }
373
+ export interface CollectableNonceEntry {
374
+ readonly nonce: number | {
375
+ readonly int: number;
376
+ };
377
+ readonly supply: number | {
378
+ readonly decimal: string;
379
+ } | {
380
+ readonly int: number;
381
+ };
382
+ }
383
+ export interface CollectableEntryData {
384
+ readonly t1: string;
385
+ readonly t2: string;
386
+ readonly "wallet-nonces": readonly CollectableNonceEntry[];
387
+ readonly "wallet-nonces-no": number | {
388
+ readonly int: number;
389
+ };
390
+ }
391
+ export interface NonceMetaData {
392
+ readonly score: number;
393
+ readonly composition: readonly number[];
394
+ readonly "meta-data": Readonly<Record<string, any>>;
395
+ }
396
+ export interface URIType {
397
+ readonly image: boolean;
398
+ readonly audio: boolean;
399
+ readonly video: boolean;
400
+ readonly document: boolean;
401
+ readonly archive: boolean;
402
+ readonly model: boolean;
403
+ readonly exotic: boolean;
404
+ }
405
+ export interface URIData {
406
+ readonly image: string;
407
+ readonly audio: string;
408
+ readonly video: string;
409
+ readonly document: string;
410
+ readonly archive: string;
411
+ readonly model: string;
412
+ readonly exotic: string;
413
+ }
414
+ export interface NonceData {
415
+ readonly royalty: number;
416
+ readonly ignis: number;
417
+ readonly name: string;
418
+ readonly description: string;
419
+ readonly "meta-data": NonceMetaData;
420
+ readonly "asset-type": URIType;
421
+ readonly "uri-primary": URIData;
422
+ readonly "uri-secondary": URIData;
423
+ readonly "uri-tertiary": URIData;
424
+ }
425
+ export interface SetAllowedNonceForPosition {
426
+ readonly "allowed-nonces": readonly number[] | ReadonlyArray<number | {
427
+ readonly int: number;
428
+ }>;
429
+ }
430
+ export interface SetAllowedClassForPosition {
431
+ readonly "allowed-sclass": number | {
432
+ readonly int: number;
433
+ };
434
+ }
435
+ export interface SetDefinition {
436
+ readonly "set-class": number | {
437
+ readonly int: number;
438
+ };
439
+ readonly "set-name": string;
440
+ readonly "set-score-multiplier": number | {
441
+ readonly decimal: string;
442
+ };
443
+ readonly "nonce-of-set": number | {
444
+ readonly int: number;
445
+ };
446
+ readonly "iz-active": boolean;
447
+ readonly "primordial": boolean;
448
+ readonly "composite": boolean;
449
+ readonly "primordial-set-definition": readonly SetAllowedNonceForPosition[];
450
+ readonly "composite-set-definition": readonly SetAllowedClassForPosition[];
451
+ readonly "nonce-data": any;
452
+ readonly "split-data": any;
453
+ }
454
+ export interface CollectablesButtonState {
455
+ readonly morph: boolean;
456
+ readonly "add-quantity": boolean;
457
+ readonly burn: boolean;
458
+ readonly respawn: boolean;
459
+ readonly wipe: boolean;
460
+ readonly fuse: boolean;
461
+ readonly split: boolean;
462
+ readonly "break-set": boolean;
463
+ readonly transfer: boolean;
464
+ readonly [key: string]: boolean;
465
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * dexTypes.ts
3
+ * Cross-cutting interface and type-alias definitions for the DEX entity files.
4
+ * Sole non-local re-export: IKadenaKeypair from @stoachain/stoa-core/signing.
5
+ */
6
+ export {};
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Typed error for shape mismatches in Kadena RPC envelopes.
3
+ *
4
+ * Mirrors `InvalidEnvelopeError` (stoa-core/signing/partialSig.ts): extends
5
+ * Error (NOT TypeError — TypeError is reserved for input-validation seam
6
+ * errors), uses ES2022 Error.cause for original-envelope propagation.
7
+ */
8
+ export declare class KadenaShapeError extends Error {
9
+ constructor(message: string, options?: {
10
+ cause?: unknown;
11
+ });
12
+ }