@sodax/types 1.5.7-beta → 2.0.0-rc.10

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 (124) hide show
  1. package/README.md +86 -20
  2. package/dist/backend/backendApi.d.ts +74 -0
  3. package/dist/backend/backendApi.js +1 -0
  4. package/dist/backend/index.d.ts +1 -81
  5. package/dist/backend/index.js +1 -2
  6. package/dist/{btc/index.d.ts → bitcoin/bitcoin.d.ts} +30 -31
  7. package/dist/{btc/index.js → bitcoin/bitcoin.js} +4 -4
  8. package/dist/bitcoin/index.d.ts +1 -0
  9. package/dist/bitcoin/index.js +1 -0
  10. package/dist/chains/chain-keys.d.ts +30 -0
  11. package/dist/chains/chain-keys.js +38 -0
  12. package/dist/chains/chains.d.ts +3602 -0
  13. package/dist/chains/chains.js +711 -0
  14. package/dist/chains/index.d.ts +2 -0
  15. package/dist/chains/index.js +2 -0
  16. package/dist/chains/tokens.d.ts +4617 -0
  17. package/dist/chains/tokens.js +2242 -0
  18. package/dist/common/common.d.ts +281 -0
  19. package/dist/common/common.js +29 -0
  20. package/dist/common/constants.d.ts +69 -0
  21. package/dist/common/constants.js +30 -0
  22. package/dist/common/index.d.ts +2 -275
  23. package/dist/common/index.js +2 -2
  24. package/dist/dex/dex.d.ts +267 -0
  25. package/dist/dex/dex.js +127 -0
  26. package/dist/dex/index.d.ts +1 -0
  27. package/dist/dex/index.js +1 -0
  28. package/dist/dex/pancakeswap-infinity.d.ts +538 -0
  29. package/dist/dex/pancakeswap-infinity.js +2 -0
  30. package/dist/evm/evm.d.ts +47 -0
  31. package/dist/evm/evm.js +1 -0
  32. package/dist/evm/index.d.ts +1 -40
  33. package/dist/evm/index.js +1 -2
  34. package/dist/icon/icon.d.ts +54 -0
  35. package/dist/icon/icon.js +1 -0
  36. package/dist/icon/index.d.ts +1 -36
  37. package/dist/icon/index.js +1 -2
  38. package/dist/index.d.ts +15 -8
  39. package/dist/index.js +15 -8
  40. package/dist/injective/index.d.ts +1 -68
  41. package/dist/injective/index.js +1 -17
  42. package/dist/injective/injective.d.ts +102 -0
  43. package/dist/injective/injective.js +1 -0
  44. package/dist/moneyMarket/index.d.ts +1 -0
  45. package/dist/moneyMarket/index.js +1 -0
  46. package/dist/moneyMarket/moneyMarket.d.ts +2559 -0
  47. package/dist/moneyMarket/moneyMarket.js +199 -0
  48. package/dist/near/index.d.ts +1 -70
  49. package/dist/near/index.js +1 -2
  50. package/dist/near/near-api-js.d.ts +6118 -0
  51. package/dist/near/near-api-js.js +1 -0
  52. package/dist/near/near.d.ts +74 -0
  53. package/dist/near/near.js +1 -0
  54. package/dist/shared/index.d.ts +1 -0
  55. package/dist/shared/index.js +1 -0
  56. package/dist/shared/shared.d.ts +16 -0
  57. package/dist/shared/shared.js +5 -0
  58. package/dist/sodax-config/index.d.ts +1 -0
  59. package/dist/sodax-config/index.js +1 -0
  60. package/dist/sodax-config/sodax-config.d.ts +6307 -0
  61. package/dist/sodax-config/sodax-config.js +21 -0
  62. package/dist/solana/index.d.ts +1 -100
  63. package/dist/solana/index.js +1 -2
  64. package/dist/solana/solana-web3.d.ts +389 -0
  65. package/dist/solana/solana-web3.js +1 -0
  66. package/dist/solana/solana.d.ts +110 -0
  67. package/dist/solana/solana.js +1 -0
  68. package/dist/stacks/index.d.ts +1 -17
  69. package/dist/stacks/index.js +1 -2
  70. package/dist/stacks/stacks.d.ts +210 -0
  71. package/dist/stacks/stacks.js +1 -0
  72. package/dist/stellar/index.d.ts +1 -70
  73. package/dist/stellar/index.js +1 -2
  74. package/dist/stellar/stellar.d.ts +96 -0
  75. package/dist/stellar/stellar.js +1 -0
  76. package/dist/sui/index.d.ts +1 -33
  77. package/dist/sui/index.js +1 -2
  78. package/dist/sui/sui.d.ts +311 -0
  79. package/dist/sui/sui.js +1 -0
  80. package/dist/swap/index.d.ts +1 -0
  81. package/dist/swap/index.js +1 -0
  82. package/dist/swap/swap.d.ts +3500 -0
  83. package/dist/swap/swap.js +248 -0
  84. package/dist/utils/deep-partial.d.ts +8 -0
  85. package/dist/utils/deep-partial.js +1 -0
  86. package/dist/utils/index.d.ts +2 -0
  87. package/dist/utils/index.js +2 -0
  88. package/dist/utils/utils.d.ts +60 -0
  89. package/dist/utils/utils.js +143 -0
  90. package/dist/wallet/index.d.ts +2 -0
  91. package/dist/wallet/index.js +2 -0
  92. package/dist/wallet/providers.d.ts +23 -0
  93. package/dist/wallet/providers.js +1 -0
  94. package/dist/wallet/wallet.d.ts +18 -0
  95. package/dist/wallet/wallet.js +1 -0
  96. package/package.json +42 -14
  97. package/dist/backend/index.d.ts.map +0 -1
  98. package/dist/backend/index.js.map +0 -1
  99. package/dist/btc/index.d.ts.map +0 -1
  100. package/dist/btc/index.js.map +0 -1
  101. package/dist/common/index.d.ts.map +0 -1
  102. package/dist/common/index.js.map +0 -1
  103. package/dist/constants/index.d.ts +0 -7299
  104. package/dist/constants/index.d.ts.map +0 -1
  105. package/dist/constants/index.js +0 -3227
  106. package/dist/constants/index.js.map +0 -1
  107. package/dist/evm/index.d.ts.map +0 -1
  108. package/dist/evm/index.js.map +0 -1
  109. package/dist/icon/index.d.ts.map +0 -1
  110. package/dist/icon/index.js.map +0 -1
  111. package/dist/index.d.ts.map +0 -1
  112. package/dist/index.js.map +0 -1
  113. package/dist/injective/index.d.ts.map +0 -1
  114. package/dist/injective/index.js.map +0 -1
  115. package/dist/near/index.d.ts.map +0 -1
  116. package/dist/near/index.js.map +0 -1
  117. package/dist/solana/index.d.ts.map +0 -1
  118. package/dist/solana/index.js.map +0 -1
  119. package/dist/stacks/index.d.ts.map +0 -1
  120. package/dist/stacks/index.js.map +0 -1
  121. package/dist/stellar/index.d.ts.map +0 -1
  122. package/dist/stellar/index.js.map +0 -1
  123. package/dist/sui/index.d.ts.map +0 -1
  124. package/dist/sui/index.js.map +0 -1
@@ -0,0 +1,311 @@
1
+ import type { Base64String, Hex } from '../shared/shared.js';
2
+ import type { ICoreWallet } from '../wallet/wallet.js';
3
+ export type SuiReturnType<Raw extends boolean> = Raw extends true ? SuiRawTransaction : Raw extends false ? string : SuiRawTransaction | string;
4
+ export type SuiRawTransaction = {
5
+ from: Hex;
6
+ to: string;
7
+ value: bigint;
8
+ data: Base64String;
9
+ };
10
+ export type SuiTransaction = {
11
+ toJSON: () => Promise<string>;
12
+ };
13
+ export type SuiArgument = 'GasCoin' | {
14
+ Input: number;
15
+ } | {
16
+ Result: number;
17
+ } | {
18
+ NestedResult: [number, number];
19
+ };
20
+ export interface SuiExecutionResult {
21
+ mutableReferenceOutputs?: [SuiArgument, number[], string][];
22
+ returnValues?: [number[], string][];
23
+ }
24
+ export interface SuiCoinStruct {
25
+ balance: string;
26
+ coinObjectId: string;
27
+ coinType: string;
28
+ digest: string;
29
+ previousTransaction: string;
30
+ version: string;
31
+ }
32
+ export interface SuiPaginatedCoins {
33
+ data: SuiCoinStruct[];
34
+ hasNextPage: boolean;
35
+ nextCursor?: string | null;
36
+ }
37
+ export type SuiObjectRef = {
38
+ digest: string;
39
+ objectId: string;
40
+ version: string;
41
+ };
42
+ export type Authenticator =
43
+ /** The contained SuiAddress exclusively has all permissions: read, write, delete, transfer */
44
+ {
45
+ SingleOwner: string;
46
+ };
47
+ export interface SuiBalance {
48
+ coinObjectCount: number;
49
+ coinType: string;
50
+ lockedBalance: {
51
+ [key: string]: string;
52
+ };
53
+ totalBalance: string;
54
+ }
55
+ export type SuiObjectOwner = {
56
+ AddressOwner: string;
57
+ } | {
58
+ ObjectOwner: string;
59
+ } | {
60
+ Shared: {
61
+ initial_shared_version: string;
62
+ };
63
+ } | 'Immutable' | {
64
+ ConsensusV2: {
65
+ authenticator: Authenticator;
66
+ start_version: string;
67
+ };
68
+ };
69
+ export type SuiOwnedObjectRef = {
70
+ owner: SuiObjectOwner;
71
+ reference: SuiObjectRef;
72
+ };
73
+ export type SuiGasCostSummary = {
74
+ computationCost: string;
75
+ storageCost: string;
76
+ storageRebate: string;
77
+ nonRefundableStorageFee: string;
78
+ };
79
+ export type SuiExecutionStatus = {
80
+ status: 'success' | 'failure';
81
+ error?: string;
82
+ };
83
+ export type SuiTransactionEffectsModifiedAtVersions = {
84
+ objectId: string;
85
+ sequenceNumber: string;
86
+ };
87
+ export type SuiTransactionEffects = {
88
+ messageVersion: 'v1';
89
+ status: SuiExecutionStatus;
90
+ executedEpoch: string;
91
+ gasUsed: SuiGasCostSummary;
92
+ transactionDigest: string;
93
+ gasObject: SuiOwnedObjectRef;
94
+ dependencies?: string[];
95
+ created?: SuiOwnedObjectRef[];
96
+ mutated?: SuiOwnedObjectRef[];
97
+ deleted?: SuiObjectRef[];
98
+ wrapped?: SuiObjectRef[];
99
+ unwrapped?: SuiOwnedObjectRef[];
100
+ unwrappedThenDeleted?: SuiObjectRef[];
101
+ sharedObjects?: SuiObjectRef[];
102
+ modifiedAtVersions?: SuiTransactionEffectsModifiedAtVersions[];
103
+ eventsDigest?: string | null;
104
+ };
105
+ export type SuiEventId = {
106
+ txDigest: string;
107
+ eventSeq: string;
108
+ };
109
+ /** `parsedJson` is intentionally untyped in the Sui SDK — it carries arbitrary Move struct data. */
110
+ export type SuiEvent = {
111
+ /**
112
+ * Sequential event ID, ie (transaction seq number, event seq number). 1) Serves as a unique event ID
113
+ * for each fullnode 2) Also serves to sequence events for the purposes of pagination and querying. A
114
+ * higher id is an event seen later by that fullnode. This ID is the "cursor" for event querying.
115
+ */
116
+ id: SuiEventId;
117
+ /** Move package where this event was emitted. */
118
+ packageId: string;
119
+ /** Parsed json value of the event */
120
+ parsedJson: unknown;
121
+ /** Sender's Sui address. */
122
+ sender: string;
123
+ /** UTC timestamp in milliseconds since epoch (1/1/1970) */
124
+ timestampMs?: string | null;
125
+ /** Move module where this event was emitted. */
126
+ transactionModule: string;
127
+ /** Move event type. */
128
+ type: string;
129
+ bcs: string;
130
+ bcsEncoding: 'base64';
131
+ } | {
132
+ /**
133
+ * Sequential event ID, ie (transaction seq number, event seq number). 1) Serves as a unique event ID
134
+ * for each fullnode 2) Also serves to sequence events for the purposes of pagination and querying. A
135
+ * higher id is an event seen later by that fullnode. This ID is the "cursor" for event querying.
136
+ */
137
+ id: SuiEventId;
138
+ /** Move package where this event was emitted. */
139
+ packageId: string;
140
+ /** Parsed json value of the event */
141
+ parsedJson: unknown;
142
+ /** Sender's Sui address. */
143
+ sender: string;
144
+ /** UTC timestamp in milliseconds since epoch (1/1/1970) */
145
+ timestampMs?: string | null;
146
+ /** Move module where this event was emitted. */
147
+ transactionModule: string;
148
+ /** Move event type. */
149
+ type: string;
150
+ bcs: string;
151
+ bcsEncoding: 'base58';
152
+ };
153
+ export type SuiObjectChange = {
154
+ type: 'published';
155
+ digest: string;
156
+ modules: string[];
157
+ packageId: string;
158
+ version: string;
159
+ } | {
160
+ type: 'transferred';
161
+ digest: string;
162
+ objectId: string;
163
+ objectType: string;
164
+ recipient: SuiObjectOwner;
165
+ sender: string;
166
+ version: string;
167
+ } | {
168
+ type: 'mutated';
169
+ digest: string;
170
+ objectId: string;
171
+ objectType: string;
172
+ owner: SuiObjectOwner;
173
+ previousVersion: string;
174
+ sender: string;
175
+ version: string;
176
+ } | {
177
+ type: 'deleted';
178
+ objectId: string;
179
+ objectType: string;
180
+ sender: string;
181
+ version: string;
182
+ } | {
183
+ type: 'wrapped';
184
+ objectId: string;
185
+ objectType: string;
186
+ sender: string;
187
+ version: string;
188
+ } | {
189
+ type: 'created';
190
+ digest: string;
191
+ objectId: string;
192
+ objectType: string;
193
+ owner: SuiObjectOwner;
194
+ sender: string;
195
+ version: string;
196
+ };
197
+ export type SuiBalanceChange = {
198
+ amount: string;
199
+ coinType: string;
200
+ owner: SuiObjectOwner;
201
+ };
202
+ export type SuiGasData = {
203
+ budget: string;
204
+ owner: string;
205
+ payment: SuiObjectRef[];
206
+ price: string;
207
+ };
208
+ export type SuiMoveCallTransaction = {
209
+ arguments?: SuiArgument[];
210
+ function: string;
211
+ module: string;
212
+ package: string;
213
+ type_arguments?: string[];
214
+ };
215
+ export type SuiTransactionCommand = {
216
+ MoveCall: SuiMoveCallTransaction;
217
+ } | {
218
+ TransferObjects: [SuiArgument[], SuiArgument];
219
+ } | {
220
+ SplitCoins: [SuiArgument, SuiArgument[]];
221
+ } | {
222
+ MergeCoins: [SuiArgument, SuiArgument[]];
223
+ } | {
224
+ Publish: string[];
225
+ } | {
226
+ Upgrade: [string[], string, SuiArgument];
227
+ } | {
228
+ MakeMoveVec: [string | null, SuiArgument[]];
229
+ };
230
+ export type SuiCallArg = {
231
+ type: 'object';
232
+ digest: string;
233
+ objectId: string;
234
+ objectType: 'immOrOwnedObject';
235
+ version: string;
236
+ } | {
237
+ type: 'object';
238
+ initialSharedVersion: string;
239
+ mutable: boolean;
240
+ objectId: string;
241
+ objectType: 'sharedObject';
242
+ } | {
243
+ type: 'object';
244
+ digest: string;
245
+ objectId: string;
246
+ objectType: 'receiving';
247
+ version: string;
248
+ }
249
+ /** `value` is typed as `unknown` in the Sui SDK — it carries arbitrary BCS-decoded primitive values. */
250
+ | {
251
+ type: 'pure';
252
+ value: unknown;
253
+ };
254
+ export type SuiTransactionBlockKind = {
255
+ kind: 'ProgrammableTransaction';
256
+ inputs: SuiCallArg[];
257
+ transactions: SuiTransactionCommand[];
258
+ } | {
259
+ kind: 'ChangeEpoch';
260
+ epoch: string;
261
+ computation_charge: string;
262
+ storage_charge: string;
263
+ storage_rebate: string;
264
+ epoch_start_timestamp_ms: string;
265
+ } | {
266
+ kind: 'Genesis';
267
+ objects: string[];
268
+ } | {
269
+ kind: 'ConsensusCommitPrologue';
270
+ epoch: string;
271
+ round: string;
272
+ commit_timestamp_ms: string;
273
+ } | {
274
+ kind: 'EndOfEpochTransaction';
275
+ transactions: {
276
+ kind: string;
277
+ }[];
278
+ } | {
279
+ kind: string;
280
+ };
281
+ export type SuiTransactionBlockData = {
282
+ gasData: SuiGasData;
283
+ messageVersion: 'v1';
284
+ sender: string;
285
+ transaction: SuiTransactionBlockKind;
286
+ };
287
+ export type SuiTransactionBlock = {
288
+ data: SuiTransactionBlockData;
289
+ txSignatures: string[];
290
+ };
291
+ export type SuiRawTransactionReceipt = {
292
+ digest: string;
293
+ effects?: SuiTransactionEffects | null;
294
+ events?: SuiEvent[] | null;
295
+ objectChanges?: SuiObjectChange[] | null;
296
+ balanceChanges?: SuiBalanceChange[] | null;
297
+ timestampMs?: string | null;
298
+ checkpoint?: string | null;
299
+ transaction?: SuiTransactionBlock | null;
300
+ confirmedLocalExecution?: boolean | null;
301
+ errors?: string[];
302
+ rawEffects?: number[];
303
+ rawTransaction?: string;
304
+ };
305
+ export interface ISuiWalletProvider extends ICoreWallet {
306
+ readonly chainType: 'SUI';
307
+ getWalletAddress: () => Promise<string>;
308
+ signAndExecuteTxn: (txn: SuiTransaction) => Promise<string>;
309
+ viewContract(tx: SuiTransaction, packageId: string, module: string, functionName: string, args: unknown[], typeArgs: string[]): Promise<SuiExecutionResult>;
310
+ getCoins: (address: string, token: string) => Promise<SuiPaginatedCoins>;
311
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export * from './swap.js';
@@ -0,0 +1 @@
1
+ export * from './swap.js';