@shogun-sdk/intents-sdk 1.2.6-test.15 → 1.2.6-test.17
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/dist/index.cjs +535 -484
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +121 -43
- package/dist/index.d.ts +121 -43
- package/dist/index.js +369 -318
- package/dist/index.js.map +1 -1
- package/package.json +10 -7
- package/src/auth/siwe.ts +9 -7
- package/src/constants.ts +32 -17
- package/src/core/evm/intent-helpers.ts +131 -8
- package/src/core/evm/intent-provider.ts +5 -4
- package/src/core/evm/permit2.ts +36 -0
- package/src/core/orders/api/fetch.ts +12 -36
- package/src/core/orders/api/index.ts +2 -3
- package/src/core/orders/cross-chain.ts +3 -0
- package/src/core/orders/single-chain.ts +21 -8
- package/src/core/sdk.ts +11 -2
- package/src/core/solana/dca/create-order.ts +6 -19
- package/src/core/solana/intent-helpers.ts +12 -20
- package/src/core/solana/order-instructions.ts +12 -37
- package/src/core/sui/intent-helpers.ts +4 -1
- package/src/index.ts +4 -7
- package/src/types/api.ts +14 -3
- package/src/types/intent.ts +36 -2
- package/src/utils/base-validator.ts +0 -4
- package/src/utils/generate-execution-details-hash.ts +9 -32
- package/src/utils/quote/address.ts +4 -0
- package/src/utils/quote/aggregator.ts +29 -9
- package/src/utils/quote/pricing/constants.ts +33 -0
- package/src/utils/quote/pricing/decimals.ts +11 -0
- package/src/utils/quote/pricing/estimate-amount-out.ts +36 -0
- package/src/utils/quote/pricing/expenses.ts +62 -0
- package/src/utils/quote/pricing/gas.ts +28 -0
- package/src/core/solana/transaction-options.ts +0 -83
- package/src/utils/auctioneer-headers.ts +0 -32
package/dist/index.d.cts
CHANGED
|
@@ -93,10 +93,9 @@ declare const TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, A
|
|
|
93
93
|
declare const CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, `0x${string}` | Address>;
|
|
94
94
|
declare const SINGLE_CHAIN_GUARD_ADDRESSES: Record<ChainID.Arbitrum | ChainID.Optimism | ChainID.Base | ChainID.Hyperliquid | ChainID.Solana | ChainID.BSC | ChainID.MONAD, `0x${string}` | Address>;
|
|
95
95
|
declare const DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
96
|
+
declare const DCA_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
96
97
|
declare const NATIVE_SOLANA_TOKEN_ADDRESS: Address<"So11111111111111111111111111111111111111111">;
|
|
97
98
|
declare const WRAPPED_SOL_MINT_ADDRESS: Address<"So11111111111111111111111111111111111111112">;
|
|
98
|
-
declare const SOLANA_TIP_ACCOUNTS: readonly ["4ACfpUFoaSD9bfPdeu6DBt89gB6ENTeHBXCAi87NhDEE", "D2L6yPZ2FmmmTKPgzaMKdhu6EWZcTpLy1Vhx8uvZe7NZ", "9bnz4RShgq1hAnLnZbP8kbgBg1kEmcJBYQq3gQbmnSta", "5VY91ws6B2hMmBFRsXkoAAdsPHBJwRfBht4DXox3xkwn", "2nyhqdwKcJZR2vcqCyrYsaPVdAnFoJjiksCXJ7hfEYgD", "2q5pghRs6arqVjRvT5gfgWfWcHWmw1ZuCzphgd5KfWGJ", "wyvPkWjVZz1M8fHQnMMCDTQDbkManefNNhweYk5WkcF", "3KCKozbAaF75qEU33jtzozcJ29yJuaLJTy2jFdzUY8bT", "4vieeGHPYPG2MmyPRcYjdiDmmhN3ww7hsFNap8pVN3Ey", "4TQLFNWK8AovT1gFvda5jfw2oJeRMKEmw7aH6MGBJ3or"];
|
|
99
|
-
declare const SOLANA_MIN_TIP_LAMPORTS = 200000n;
|
|
100
99
|
type SolanaMint = {
|
|
101
100
|
name: string;
|
|
102
101
|
mint: string;
|
|
@@ -118,6 +117,17 @@ declare const NATIVE_EVM_ETH_ADDRESSES: string[];
|
|
|
118
117
|
declare const WRAPPED_ETH_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
119
118
|
declare const NATIVE_SUI_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
120
119
|
declare function isNativeEvmToken(tokenAddress: string): boolean;
|
|
120
|
+
declare const EVM_ZERO_ADDRESS: Address$1;
|
|
121
|
+
/** Placeholder signature (32 zero bytes) for unsigned/validate-only intent requests. */
|
|
122
|
+
declare const EVM_ZERO_SIGNATURE = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
123
|
+
/**
|
|
124
|
+
* Output-token addresses must be normalized to the zero address before signing the EIP-712
|
|
125
|
+
* witness: the auctioneer collapses any native sentinel (`0xeee…`/`0x0…`) to `Address::default()`
|
|
126
|
+
* when it reconstructs `requestedOutput`/`extraTransfers` to recover the signer. Signing the raw
|
|
127
|
+
* sentinel instead would yield a different hash → signature recovery fails. (`tokenIn` is NOT
|
|
128
|
+
* normalized on either side, so leave it untouched.)
|
|
129
|
+
*/
|
|
130
|
+
declare function normalizeNativeEvmTokenForSigning(tokenAddress: string): string;
|
|
121
131
|
declare const TOKEN_SEARCH_API_BASE_URL = "https://shogun-token-search-api-825534211396.europe-west4.run.app";
|
|
122
132
|
|
|
123
133
|
type StopLossType = 'FIXED' | 'TRAILING_ABSOLUTE' | 'TRAILING_PERCENT';
|
|
@@ -130,7 +140,7 @@ type ExtraTransfer$1 = {
|
|
|
130
140
|
amount: bigint;
|
|
131
141
|
};
|
|
132
142
|
|
|
133
|
-
type ChainOrderStatus = 'Auction' | 'NoBids' | 'Executing' | 'Fulfilled' | 'Cancelled' | 'Outdated';
|
|
143
|
+
type ChainOrderStatus = 'Auction' | 'NoBids' | 'Executing' | 'Fulfilled' | 'Cancelled' | 'Outdated' | 'DcaIntervalFulfilled';
|
|
134
144
|
type ApiCrossChainOrder = {
|
|
135
145
|
orderId: string;
|
|
136
146
|
user: string;
|
|
@@ -183,8 +193,12 @@ type ApiUserOrders = {
|
|
|
183
193
|
interface ApiIntentResponse {
|
|
184
194
|
/** Unique identifier for the created intent */
|
|
185
195
|
intentId: string;
|
|
186
|
-
/**
|
|
187
|
-
|
|
196
|
+
/**
|
|
197
|
+
* JWT token used for authorization or subsequent requests.
|
|
198
|
+
* Optional: order-creation responses only return `intentId`; obtain a JWT via the
|
|
199
|
+
* SIWE flow (`EVMSDK.authenticate()` / `fetchJWTToken`) instead.
|
|
200
|
+
*/
|
|
201
|
+
jwt?: string;
|
|
188
202
|
}
|
|
189
203
|
type ValidResponseData = ApiUserOrders | string | ApiIntentResponse | null;
|
|
190
204
|
type ApiResponse<T extends ValidResponseData = ValidResponseData> = {
|
|
@@ -263,7 +277,11 @@ type ExecutionDetails = {
|
|
|
263
277
|
destinationAddress: string;
|
|
264
278
|
/** Extra transfers to be made */
|
|
265
279
|
extraTransfers?: ExtraTransfer$1[];
|
|
266
|
-
|
|
280
|
+
/** Stop loss type, must match the auctioneer's `stopLossType` field */
|
|
281
|
+
stopLossType?: StopLossType;
|
|
282
|
+
/** Initial trigger price (tokenIn/tokenOut) that arms the stop loss */
|
|
283
|
+
stopLossTriggerPrice?: string;
|
|
284
|
+
/** Take profit minimum amount out */
|
|
267
285
|
takeProfitMinOut?: bigint;
|
|
268
286
|
};
|
|
269
287
|
type Hash = `0x${string}`;
|
|
@@ -331,6 +349,34 @@ type SingleChainUserIntentRequest = {
|
|
|
331
349
|
Sui?: SuiPreparedData;
|
|
332
350
|
};
|
|
333
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Source chain data for a cross-chain DCA order. Mirrors the auctioneer's
|
|
354
|
+
* `CrossChainDcaOrderGenericRequestData` (common cross-chain fields + flattened
|
|
355
|
+
* `CommonDcaOrderData`). The destination fields live in `executionDetails`.
|
|
356
|
+
*/
|
|
357
|
+
type DcaCrossChainSourceChainData = {
|
|
358
|
+
user: string;
|
|
359
|
+
srcChainId: SupportedChain;
|
|
360
|
+
tokenIn: string;
|
|
361
|
+
minStablecoinsAmount: bigint;
|
|
362
|
+
deadline: number;
|
|
363
|
+
executionDetailsHash: ExecutionDetailsHash;
|
|
364
|
+
/** Flattened CommonDcaOrderData */
|
|
365
|
+
startTime: number;
|
|
366
|
+
amountInPerInterval: bigint;
|
|
367
|
+
totalIntervals: number;
|
|
368
|
+
intervalDuration: number;
|
|
369
|
+
};
|
|
370
|
+
type DcaCrossChainUserIntentRequest = {
|
|
371
|
+
genericData: DcaCrossChainSourceChainData;
|
|
372
|
+
/** JSON-stringified execution details for the destination chain */
|
|
373
|
+
executionDetails: string;
|
|
374
|
+
chainSpecificData: {
|
|
375
|
+
EVM?: DcaSingleChainEVMPreparedData;
|
|
376
|
+
Solana?: DcaSingleChainSolanaPreparedData;
|
|
377
|
+
Sui?: DcaSingleChainSuiPreparedData;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
334
380
|
type ChainPreparedData = EvmPreparedData | SuiPreparedData | SolanaPreparedData;
|
|
335
381
|
type CrossChainOrderPrepared = {
|
|
336
382
|
order: CrossChainOrder;
|
|
@@ -499,23 +545,18 @@ declare class CrossChainOrder {
|
|
|
499
545
|
toSuiTransaction(client?: any): Promise<_mysten_sui_transactions.Transaction>;
|
|
500
546
|
}
|
|
501
547
|
|
|
502
|
-
type SolanaTransactionOptions = {
|
|
503
|
-
rpcUrl?: string;
|
|
504
|
-
feePayer?: string;
|
|
505
|
-
tipAmountSol?: number | string;
|
|
506
|
-
tipLamports?: bigint;
|
|
507
|
-
tipAccount?: string;
|
|
508
|
-
tipAccounts?: readonly string[];
|
|
509
|
-
};
|
|
510
|
-
|
|
511
548
|
type SolanaOrderInstructionResult = {
|
|
512
549
|
orderAddress: string;
|
|
513
550
|
txBytes: ReadonlyUint8Array;
|
|
514
551
|
};
|
|
515
|
-
declare function getSolanaSingleChainOrderInstructions(order: SingleChainOrder, options?:
|
|
552
|
+
declare function getSolanaSingleChainOrderInstructions(order: SingleChainOrder, options?: {
|
|
553
|
+
rpcUrl?: string;
|
|
554
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
516
555
|
secretNumber: string;
|
|
517
556
|
}>;
|
|
518
|
-
declare function getSolanaCrossChainOrderInstructions(order: CrossChainOrder, options?:
|
|
557
|
+
declare function getSolanaCrossChainOrderInstructions(order: CrossChainOrder, options?: {
|
|
558
|
+
rpcUrl?: string;
|
|
559
|
+
}): Promise<SolanaOrderInstructionResult>;
|
|
519
560
|
|
|
520
561
|
type CreateDcaSingleChainOrderParams = {
|
|
521
562
|
chainId: SupportedChain;
|
|
@@ -602,6 +643,8 @@ declare abstract class BaseSDK {
|
|
|
602
643
|
createAndSendDcaSingleChainOrder(params: CreateDcaSingleChainOrderParams): Promise<ApiResponse>;
|
|
603
644
|
static sendDcaSingleChainOrder(preparedOrder: DcaSingleChainOrderPrepared): Promise<ApiResponse>;
|
|
604
645
|
static validateDcaSingleChainOrder(intentRequest: DcaSingleChainUserIntentRequest): Promise<void>;
|
|
646
|
+
static validateDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<void>;
|
|
647
|
+
static sendDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<ApiResponse>;
|
|
605
648
|
}
|
|
606
649
|
|
|
607
650
|
type CancelSingleChainOrderParams$1 = {
|
|
@@ -779,10 +822,14 @@ declare class SuiSDK extends BaseSDK {
|
|
|
779
822
|
}
|
|
780
823
|
|
|
781
824
|
/**
|
|
782
|
-
* Fetches
|
|
783
|
-
*
|
|
825
|
+
* Fetches the orders owned by the wallets encoded in a SIWE-issued JWT.
|
|
826
|
+
*
|
|
827
|
+
* The auctioneer derives the queried wallets from the verified JWT claims, never from
|
|
828
|
+
* caller-supplied params — a caller can only read intents for wallets it proved control
|
|
829
|
+
* of via SIWE. Obtain the token with `EVMSDK.authenticate()` (or the `fetchSiweMessage` +
|
|
830
|
+
* `fetchJWTToken` pair) and pass it here.
|
|
784
831
|
*/
|
|
785
|
-
declare function fetchUserOrders(
|
|
832
|
+
declare function fetchUserOrders(aggregatedToken: string): Promise<ApiUserOrders>;
|
|
786
833
|
|
|
787
834
|
declare class AuctioneerAPI {
|
|
788
835
|
aggregatedToken: string;
|
|
@@ -855,11 +902,6 @@ declare function calculateAmounts({ srcChainId, tokenIn, amountIn, destChainId,
|
|
|
855
902
|
minStablecoinsAmount: bigint;
|
|
856
903
|
}>;
|
|
857
904
|
|
|
858
|
-
declare const DEV_ACCESS_STORAGE_KEY = "x-dev-access";
|
|
859
|
-
declare const DEV_ACCESS_HEADER = "x-dev-access";
|
|
860
|
-
declare function getDevAccessHeaderValue(): string | undefined;
|
|
861
|
-
declare function withAuctioneerHeaders(headers?: Record<string, string>): Record<string, string>;
|
|
862
|
-
|
|
863
905
|
type CancelSingleChainOrderParams = {
|
|
864
906
|
orderId: string;
|
|
865
907
|
user: string;
|
|
@@ -983,15 +1025,15 @@ declare function getSecretHash(coinOutType: string, receiver: string, secretNumb
|
|
|
983
1025
|
*/
|
|
984
1026
|
declare function getSuiSingleChainLimitOrderTransaction(order: SingleChainOrder, secretHash: Uint8Array, guardAddress: string, client?: ReturnType<typeof createSuiClient>): Promise<Transaction>;
|
|
985
1027
|
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Computes the SHA-256 hash the auctioneer expects for cross-chain execution details.
|
|
1030
|
+
*
|
|
1031
|
+
* The auctioneer recomputes sha256 over the exact `executionDetails` JSON string it
|
|
1032
|
+
* receives and rejects the order when it differs (hash mismatch). Callers therefore MUST
|
|
1033
|
+
* hash the same serialized string they send on the wire — pass that string here directly
|
|
1034
|
+
* instead of re-serializing a parallel object, which is how key-order/field drift creeps in.
|
|
1035
|
+
*/
|
|
1036
|
+
declare function generateExecutionDetailsHash(executionDetails: string): string;
|
|
995
1037
|
|
|
996
1038
|
type CreateSuiSingleChainLimitOrderIntentParams = {
|
|
997
1039
|
user: string;
|
|
@@ -1083,7 +1125,9 @@ declare function generateSuiDcaOrderSecretData(tokenOut: string, receiver: strin
|
|
|
1083
1125
|
secretHash: Uint8Array;
|
|
1084
1126
|
};
|
|
1085
1127
|
|
|
1086
|
-
declare function getSolanaDcaSingleChainOrderInstructions(order: DcaSingleChainOrder, options?:
|
|
1128
|
+
declare function getSolanaDcaSingleChainOrderInstructions(order: DcaSingleChainOrder, options?: {
|
|
1129
|
+
rpcUrl?: string;
|
|
1130
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
1087
1131
|
secretNumber: string;
|
|
1088
1132
|
}>;
|
|
1089
1133
|
|
|
@@ -1399,7 +1443,7 @@ declare function createEvmCrossChainOrderIntentRequest(params: CreateEvmCrossCha
|
|
|
1399
1443
|
* @returns Object containing typed data and nonce for signing
|
|
1400
1444
|
*/
|
|
1401
1445
|
declare function generateEvmSingleChainLimitOrderTypedData(order: SingleChainOrder): Promise<{
|
|
1402
|
-
orderTypedData:
|
|
1446
|
+
orderTypedData: TypedDataDefinition;
|
|
1403
1447
|
nonce: bigint;
|
|
1404
1448
|
}>;
|
|
1405
1449
|
/**
|
|
@@ -1408,7 +1452,7 @@ declare function generateEvmSingleChainLimitOrderTypedData(order: SingleChainOrd
|
|
|
1408
1452
|
* @returns Object containing typed data and nonce for signing
|
|
1409
1453
|
*/
|
|
1410
1454
|
declare function generateEvmSingleChainDcaOrderTypedData(order: DcaSingleChainOrder): Promise<{
|
|
1411
|
-
orderTypedData:
|
|
1455
|
+
orderTypedData: TypedDataDefinition;
|
|
1412
1456
|
nonce: bigint;
|
|
1413
1457
|
}>;
|
|
1414
1458
|
/**
|
|
@@ -1417,7 +1461,7 @@ declare function generateEvmSingleChainDcaOrderTypedData(order: DcaSingleChainOr
|
|
|
1417
1461
|
* @returns Object containing typed data and nonce for signing
|
|
1418
1462
|
*/
|
|
1419
1463
|
declare function generateEvmCrossChainOrderTypedData(order: CrossChainOrder): Promise<{
|
|
1420
|
-
orderTypedData:
|
|
1464
|
+
orderTypedData: TypedDataDefinition;
|
|
1421
1465
|
nonce: bigint;
|
|
1422
1466
|
}>;
|
|
1423
1467
|
/**
|
|
@@ -1425,6 +1469,39 @@ declare function generateEvmCrossChainOrderTypedData(order: CrossChainOrder): Pr
|
|
|
1425
1469
|
* @returns Random nonce as string
|
|
1426
1470
|
*/
|
|
1427
1471
|
declare function generateEvmRandomNonce(): string;
|
|
1472
|
+
type CreateEvmCrossChainDcaOrderIntentParams = {
|
|
1473
|
+
user: `0x${string}`;
|
|
1474
|
+
sourceChainId: SupportedEvmChain;
|
|
1475
|
+
sourceTokenAddress: string;
|
|
1476
|
+
destinationChainId: number;
|
|
1477
|
+
destinationTokenAddress: string;
|
|
1478
|
+
destinationTokenMinAmount?: bigint;
|
|
1479
|
+
destinationAddress: string;
|
|
1480
|
+
minStablecoinAmount?: bigint;
|
|
1481
|
+
deadline: number;
|
|
1482
|
+
startTime: number;
|
|
1483
|
+
amountInPerInterval: bigint;
|
|
1484
|
+
totalIntervals: number;
|
|
1485
|
+
intervalDuration: number;
|
|
1486
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1487
|
+
nonce?: string;
|
|
1488
|
+
signature?: string;
|
|
1489
|
+
};
|
|
1490
|
+
/**
|
|
1491
|
+
* Creates an EVM cross-chain DCA order intent request, ready to POST to
|
|
1492
|
+
* `/user_intent/cross_chain/dca_order`. Pass `nonce`/`signature` from
|
|
1493
|
+
* {@link getEVMCrossChainDcaOrderTypedData} for an executable order.
|
|
1494
|
+
*/
|
|
1495
|
+
declare function createEvmCrossChainDcaOrderIntentRequest(params: CreateEvmCrossChainDcaOrderIntentParams): DcaCrossChainUserIntentRequest;
|
|
1496
|
+
/**
|
|
1497
|
+
* Generates the EIP-712 typed data (and nonce) for a cross-chain DCA order's Permit2 witness.
|
|
1498
|
+
* Sign `orderTypedData`, then pass the resulting `nonce`/`signature` into
|
|
1499
|
+
* {@link createEvmCrossChainDcaOrderIntentRequest} — both share the same execution-details hash.
|
|
1500
|
+
*/
|
|
1501
|
+
declare function getEVMCrossChainDcaOrderTypedData(params: CreateEvmCrossChainDcaOrderIntentParams, providedNonce?: bigint): {
|
|
1502
|
+
orderTypedData: TypedDataDefinition;
|
|
1503
|
+
nonce: bigint;
|
|
1504
|
+
};
|
|
1428
1505
|
|
|
1429
1506
|
type CreateSolanaSingleChainLimitOrderIntentParams = {
|
|
1430
1507
|
user: string;
|
|
@@ -1469,7 +1546,8 @@ type CreateSolanaCrossChainOrderIntentParams = {
|
|
|
1469
1546
|
deadline: number;
|
|
1470
1547
|
extraTransfers?: ExtraTransfer$1[];
|
|
1471
1548
|
orderPubkey?: string;
|
|
1472
|
-
|
|
1549
|
+
stopLossType?: StopLossType;
|
|
1550
|
+
stopLossTriggerPrice?: string;
|
|
1473
1551
|
takeProfitMinOut?: bigint;
|
|
1474
1552
|
};
|
|
1475
1553
|
/**
|
|
@@ -1495,7 +1573,7 @@ declare function createSolanaCrossChainOrderIntentRequest(params: CreateSolanaCr
|
|
|
1495
1573
|
* @param order The single-chain order
|
|
1496
1574
|
* @returns Promise resolving to instruction bytes
|
|
1497
1575
|
*/
|
|
1498
|
-
declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleChainOrder
|
|
1576
|
+
declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1499
1577
|
secretNumber: string;
|
|
1500
1578
|
}>;
|
|
1501
1579
|
/**
|
|
@@ -1503,7 +1581,7 @@ declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleCh
|
|
|
1503
1581
|
* @param order The DCA order
|
|
1504
1582
|
* @returns Promise resolving to instruction bytes
|
|
1505
1583
|
*/
|
|
1506
|
-
declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleChainOrder
|
|
1584
|
+
declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1507
1585
|
secretNumber: string;
|
|
1508
1586
|
}>;
|
|
1509
1587
|
/**
|
|
@@ -1511,7 +1589,7 @@ declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleC
|
|
|
1511
1589
|
* @param order The cross-chain order
|
|
1512
1590
|
* @returns Promise resolving to instruction bytes
|
|
1513
1591
|
*/
|
|
1514
|
-
declare function generateSolanaCrossChainOrderInstructions(order: CrossChainOrder
|
|
1592
|
+
declare function generateSolanaCrossChainOrderInstructions(order: CrossChainOrder): Promise<SolanaOrderInstructionResult>;
|
|
1515
1593
|
/**
|
|
1516
1594
|
* Generates secret data for Solana single-chain limit orders
|
|
1517
1595
|
* @param tokenOut Output token mint address
|
|
@@ -1542,4 +1620,4 @@ declare function generateSolanaDcaOrderSecretData(tokenOut: string, receiver: st
|
|
|
1542
1620
|
*/
|
|
1543
1621
|
declare function generateSolanaRandomSecretNumber(): string;
|
|
1544
1622
|
|
|
1545
|
-
export { AUCTIONEER_URL, type ApiCrossChainOrder, type ApiIntentResponse, type ApiResponse, type ApiSingleChainOrder, type ApiUserOrders, AuctioneerAPI, CROSS_CHAIN_GUARD_ADDRESSES, type CancelCrossChainOrderParams, type CancelSingleChainOrderParams, ChainID, type ChainOrderStatus, ChainType, type CreateCrossChainOrderParams, type CreateDcaSingleChainOrderParams, type CreateEvmCrossChainOrderIntentParams, type CreateEvmSingleChainDcaOrderIntentParams, type CreateEvmSingleChainLimitOrderIntentParams, type CreateSingleChainOrderParams, type CreateSolanaCrossChainOrderIntentParams, type CreateSolanaSingleChainDcaOrderIntentParams, type CreateSolanaSingleChainLimitOrderIntentParams, type CreateSuiCrossChainOrderIntentParams, type CreateSuiSingleChainDcaOrderIntentParams, type CreateSuiSingleChainLimitOrderIntentParams, CrossChainOrder,
|
|
1623
|
+
export { AUCTIONEER_URL, type ApiCrossChainOrder, type ApiIntentResponse, type ApiResponse, type ApiSingleChainOrder, type ApiUserOrders, AuctioneerAPI, CROSS_CHAIN_GUARD_ADDRESSES, type CancelCrossChainOrderParams, type CancelSingleChainOrderParams, ChainID, type ChainOrderStatus, ChainType, type CreateCrossChainOrderParams, type CreateDcaSingleChainOrderParams, type CreateEvmCrossChainDcaOrderIntentParams, type CreateEvmCrossChainOrderIntentParams, type CreateEvmSingleChainDcaOrderIntentParams, type CreateEvmSingleChainLimitOrderIntentParams, type CreateSingleChainOrderParams, type CreateSolanaCrossChainOrderIntentParams, type CreateSolanaSingleChainDcaOrderIntentParams, type CreateSolanaSingleChainLimitOrderIntentParams, type CreateSuiCrossChainOrderIntentParams, type CreateSuiSingleChainDcaOrderIntentParams, type CreateSuiSingleChainLimitOrderIntentParams, CrossChainOrder, DCA_CROSS_CHAIN_GUARD_ADDRESSES, DCA_SINGLE_CHAIN_GUARD_ADDRESSES, DcaSingleChainOrder, type DefiLlamaCoinData, type DefiLlamaTokensResponse, type EVMConfig, EVMSDK, EVM_ZERO_ADDRESS, EVM_ZERO_SIGNATURE, type FetchJWTParams, type FetchSiweMessageParams, IntentsOrderType, type IntentsQuoteParams, MAX_UINT_128, MAX_UINT_256, MAX_UINT_32, MAX_UINT_64, NATIVE_EVM_ETH_ADDRESSES, NATIVE_SOLANA_TOKEN_ADDRESS, NATIVE_SUI_TOKEN_ADDRESS, PERMIT2_ADDRESS, PROD_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SUI_PACKAGE_ID, QuoteProvider, type QuoteResponse, SINGLE_CHAIN_GUARD_ADDRESSES, SOLANA_MINT_TOKEN, SOLANA_USDC_MINT, SUI_GUARD_COLLATERAL_TYPE, SUI_GUARD_STABLECOIN_TYPE, SUI_PACKAGE_ID, SingleChainOrder, type SolanaConfig, type SolanaOrderInstructionResult, SolanaSDK, type StopLossType, type SuiConfig, SuiSDK, type SupportedChain, SupportedChains, type SupportedEvmChain, TEST_CROSS_CHAIN_GUARD_ADDRESSES, TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SUI_PACKAGE_ID, TOKEN_SEARCH_API_BASE_URL, type TokenInfo, type TokenSearchParams, type TokenSearchResponse, ValidationError, WRAPPED_ETH_ADDRESSES, WRAPPED_SOL_MINT_ADDRESS, calculateAmounts, cancelCrossChainOrderInstructionsAsBytes, cancelDcaSingleChainOrderInstructions, cancelSingleChainOrderInstructionsAsBytes, chainIdToChainTypeMap, createEvmCrossChainDcaOrderIntentRequest, createEvmCrossChainOrderIntentRequest, createEvmSingleChainDcaOrderIntentRequest, createEvmSingleChainLimitOrderIntentRequest, createSolanaCrossChainOrderIntentRequest, createSolanaSingleChainDcaOrderIntentRequest, createSolanaSingleChainLimitOrderIntentRequest, createSuiCrossChainOrderIntentRequest, createSuiSingleChainDcaOrderIntentRequest, createSuiSingleChainLimitOrderIntentRequest, fetchJWTToken, fetchSiweMessage, fetchUserOrders, generateEvmCrossChainOrderTypedData, generateEvmRandomNonce, generateEvmSingleChainDcaOrderTypedData, generateEvmSingleChainLimitOrderTypedData, generateExecutionDetailsHash, generateSolanaCrossChainOrderInstructions, generateSolanaDcaOrderSecretData, generateSolanaLimitOrderSecretData, generateSolanaRandomSecretNumber, generateSolanaSingleChainDcaOrderInstructions, generateSolanaSingleChainLimitOrderInstructions, generateSuiDcaOrderSecretData, generateSuiLimitOrderSecretData, getCancelCrossChainOrderRawData, getCancelSingleChainOrderRawData, getCoinFromResponse, getDcaSecretHash, getEVMCrossChainDcaOrderTypedData, getEVMCrossChainOrderTypedData, getEVMSingleChainOrderTypedData, getInvalidateNoncesRawData, getSecretHash, getSolanaCrossChainOrderInstructions, getSolanaDcaSingleChainOrderInstructions, getSolanaOrdersWithLockedFunds, getSolanaSingleChainOrderInstructions, getSuiCancelCrossChainOrder, getSuiOrderTransaction, getRandomU64Number as getSuiRandomU64Number, getSuiSingleChainDcaOrderTransaction, getSuiSingleChainLimitOrderTransaction, getTokenList, getTokensData, isErrorApiResponse, isEvmChain, isNativeEvmToken, isSuccessApiResponse, isSupportedChain, normalizeNativeEvmTokenForSigning, prepareDcaSecretData, prepareSecretData, signSingleChainDcaOrder, signSingleChainLimitOrder };
|
package/dist/index.d.ts
CHANGED
|
@@ -93,10 +93,9 @@ declare const TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, A
|
|
|
93
93
|
declare const CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedChain, `0x${string}` | Address>;
|
|
94
94
|
declare const SINGLE_CHAIN_GUARD_ADDRESSES: Record<ChainID.Arbitrum | ChainID.Optimism | ChainID.Base | ChainID.Hyperliquid | ChainID.Solana | ChainID.BSC | ChainID.MONAD, `0x${string}` | Address>;
|
|
95
95
|
declare const DCA_SINGLE_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
96
|
+
declare const DCA_CROSS_CHAIN_GUARD_ADDRESSES: Record<SupportedEvmChain, `0x${string}`>;
|
|
96
97
|
declare const NATIVE_SOLANA_TOKEN_ADDRESS: Address<"So11111111111111111111111111111111111111111">;
|
|
97
98
|
declare const WRAPPED_SOL_MINT_ADDRESS: Address<"So11111111111111111111111111111111111111112">;
|
|
98
|
-
declare const SOLANA_TIP_ACCOUNTS: readonly ["4ACfpUFoaSD9bfPdeu6DBt89gB6ENTeHBXCAi87NhDEE", "D2L6yPZ2FmmmTKPgzaMKdhu6EWZcTpLy1Vhx8uvZe7NZ", "9bnz4RShgq1hAnLnZbP8kbgBg1kEmcJBYQq3gQbmnSta", "5VY91ws6B2hMmBFRsXkoAAdsPHBJwRfBht4DXox3xkwn", "2nyhqdwKcJZR2vcqCyrYsaPVdAnFoJjiksCXJ7hfEYgD", "2q5pghRs6arqVjRvT5gfgWfWcHWmw1ZuCzphgd5KfWGJ", "wyvPkWjVZz1M8fHQnMMCDTQDbkManefNNhweYk5WkcF", "3KCKozbAaF75qEU33jtzozcJ29yJuaLJTy2jFdzUY8bT", "4vieeGHPYPG2MmyPRcYjdiDmmhN3ww7hsFNap8pVN3Ey", "4TQLFNWK8AovT1gFvda5jfw2oJeRMKEmw7aH6MGBJ3or"];
|
|
99
|
-
declare const SOLANA_MIN_TIP_LAMPORTS = 200000n;
|
|
100
99
|
type SolanaMint = {
|
|
101
100
|
name: string;
|
|
102
101
|
mint: string;
|
|
@@ -118,6 +117,17 @@ declare const NATIVE_EVM_ETH_ADDRESSES: string[];
|
|
|
118
117
|
declare const WRAPPED_ETH_ADDRESSES: Record<SupportedEvmChain, Address$1>;
|
|
119
118
|
declare const NATIVE_SUI_TOKEN_ADDRESS = "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI";
|
|
120
119
|
declare function isNativeEvmToken(tokenAddress: string): boolean;
|
|
120
|
+
declare const EVM_ZERO_ADDRESS: Address$1;
|
|
121
|
+
/** Placeholder signature (32 zero bytes) for unsigned/validate-only intent requests. */
|
|
122
|
+
declare const EVM_ZERO_SIGNATURE = "0x0000000000000000000000000000000000000000000000000000000000000000";
|
|
123
|
+
/**
|
|
124
|
+
* Output-token addresses must be normalized to the zero address before signing the EIP-712
|
|
125
|
+
* witness: the auctioneer collapses any native sentinel (`0xeee…`/`0x0…`) to `Address::default()`
|
|
126
|
+
* when it reconstructs `requestedOutput`/`extraTransfers` to recover the signer. Signing the raw
|
|
127
|
+
* sentinel instead would yield a different hash → signature recovery fails. (`tokenIn` is NOT
|
|
128
|
+
* normalized on either side, so leave it untouched.)
|
|
129
|
+
*/
|
|
130
|
+
declare function normalizeNativeEvmTokenForSigning(tokenAddress: string): string;
|
|
121
131
|
declare const TOKEN_SEARCH_API_BASE_URL = "https://shogun-token-search-api-825534211396.europe-west4.run.app";
|
|
122
132
|
|
|
123
133
|
type StopLossType = 'FIXED' | 'TRAILING_ABSOLUTE' | 'TRAILING_PERCENT';
|
|
@@ -130,7 +140,7 @@ type ExtraTransfer$1 = {
|
|
|
130
140
|
amount: bigint;
|
|
131
141
|
};
|
|
132
142
|
|
|
133
|
-
type ChainOrderStatus = 'Auction' | 'NoBids' | 'Executing' | 'Fulfilled' | 'Cancelled' | 'Outdated';
|
|
143
|
+
type ChainOrderStatus = 'Auction' | 'NoBids' | 'Executing' | 'Fulfilled' | 'Cancelled' | 'Outdated' | 'DcaIntervalFulfilled';
|
|
134
144
|
type ApiCrossChainOrder = {
|
|
135
145
|
orderId: string;
|
|
136
146
|
user: string;
|
|
@@ -183,8 +193,12 @@ type ApiUserOrders = {
|
|
|
183
193
|
interface ApiIntentResponse {
|
|
184
194
|
/** Unique identifier for the created intent */
|
|
185
195
|
intentId: string;
|
|
186
|
-
/**
|
|
187
|
-
|
|
196
|
+
/**
|
|
197
|
+
* JWT token used for authorization or subsequent requests.
|
|
198
|
+
* Optional: order-creation responses only return `intentId`; obtain a JWT via the
|
|
199
|
+
* SIWE flow (`EVMSDK.authenticate()` / `fetchJWTToken`) instead.
|
|
200
|
+
*/
|
|
201
|
+
jwt?: string;
|
|
188
202
|
}
|
|
189
203
|
type ValidResponseData = ApiUserOrders | string | ApiIntentResponse | null;
|
|
190
204
|
type ApiResponse<T extends ValidResponseData = ValidResponseData> = {
|
|
@@ -263,7 +277,11 @@ type ExecutionDetails = {
|
|
|
263
277
|
destinationAddress: string;
|
|
264
278
|
/** Extra transfers to be made */
|
|
265
279
|
extraTransfers?: ExtraTransfer$1[];
|
|
266
|
-
|
|
280
|
+
/** Stop loss type, must match the auctioneer's `stopLossType` field */
|
|
281
|
+
stopLossType?: StopLossType;
|
|
282
|
+
/** Initial trigger price (tokenIn/tokenOut) that arms the stop loss */
|
|
283
|
+
stopLossTriggerPrice?: string;
|
|
284
|
+
/** Take profit minimum amount out */
|
|
267
285
|
takeProfitMinOut?: bigint;
|
|
268
286
|
};
|
|
269
287
|
type Hash = `0x${string}`;
|
|
@@ -331,6 +349,34 @@ type SingleChainUserIntentRequest = {
|
|
|
331
349
|
Sui?: SuiPreparedData;
|
|
332
350
|
};
|
|
333
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Source chain data for a cross-chain DCA order. Mirrors the auctioneer's
|
|
354
|
+
* `CrossChainDcaOrderGenericRequestData` (common cross-chain fields + flattened
|
|
355
|
+
* `CommonDcaOrderData`). The destination fields live in `executionDetails`.
|
|
356
|
+
*/
|
|
357
|
+
type DcaCrossChainSourceChainData = {
|
|
358
|
+
user: string;
|
|
359
|
+
srcChainId: SupportedChain;
|
|
360
|
+
tokenIn: string;
|
|
361
|
+
minStablecoinsAmount: bigint;
|
|
362
|
+
deadline: number;
|
|
363
|
+
executionDetailsHash: ExecutionDetailsHash;
|
|
364
|
+
/** Flattened CommonDcaOrderData */
|
|
365
|
+
startTime: number;
|
|
366
|
+
amountInPerInterval: bigint;
|
|
367
|
+
totalIntervals: number;
|
|
368
|
+
intervalDuration: number;
|
|
369
|
+
};
|
|
370
|
+
type DcaCrossChainUserIntentRequest = {
|
|
371
|
+
genericData: DcaCrossChainSourceChainData;
|
|
372
|
+
/** JSON-stringified execution details for the destination chain */
|
|
373
|
+
executionDetails: string;
|
|
374
|
+
chainSpecificData: {
|
|
375
|
+
EVM?: DcaSingleChainEVMPreparedData;
|
|
376
|
+
Solana?: DcaSingleChainSolanaPreparedData;
|
|
377
|
+
Sui?: DcaSingleChainSuiPreparedData;
|
|
378
|
+
};
|
|
379
|
+
};
|
|
334
380
|
type ChainPreparedData = EvmPreparedData | SuiPreparedData | SolanaPreparedData;
|
|
335
381
|
type CrossChainOrderPrepared = {
|
|
336
382
|
order: CrossChainOrder;
|
|
@@ -499,23 +545,18 @@ declare class CrossChainOrder {
|
|
|
499
545
|
toSuiTransaction(client?: any): Promise<_mysten_sui_transactions.Transaction>;
|
|
500
546
|
}
|
|
501
547
|
|
|
502
|
-
type SolanaTransactionOptions = {
|
|
503
|
-
rpcUrl?: string;
|
|
504
|
-
feePayer?: string;
|
|
505
|
-
tipAmountSol?: number | string;
|
|
506
|
-
tipLamports?: bigint;
|
|
507
|
-
tipAccount?: string;
|
|
508
|
-
tipAccounts?: readonly string[];
|
|
509
|
-
};
|
|
510
|
-
|
|
511
548
|
type SolanaOrderInstructionResult = {
|
|
512
549
|
orderAddress: string;
|
|
513
550
|
txBytes: ReadonlyUint8Array;
|
|
514
551
|
};
|
|
515
|
-
declare function getSolanaSingleChainOrderInstructions(order: SingleChainOrder, options?:
|
|
552
|
+
declare function getSolanaSingleChainOrderInstructions(order: SingleChainOrder, options?: {
|
|
553
|
+
rpcUrl?: string;
|
|
554
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
516
555
|
secretNumber: string;
|
|
517
556
|
}>;
|
|
518
|
-
declare function getSolanaCrossChainOrderInstructions(order: CrossChainOrder, options?:
|
|
557
|
+
declare function getSolanaCrossChainOrderInstructions(order: CrossChainOrder, options?: {
|
|
558
|
+
rpcUrl?: string;
|
|
559
|
+
}): Promise<SolanaOrderInstructionResult>;
|
|
519
560
|
|
|
520
561
|
type CreateDcaSingleChainOrderParams = {
|
|
521
562
|
chainId: SupportedChain;
|
|
@@ -602,6 +643,8 @@ declare abstract class BaseSDK {
|
|
|
602
643
|
createAndSendDcaSingleChainOrder(params: CreateDcaSingleChainOrderParams): Promise<ApiResponse>;
|
|
603
644
|
static sendDcaSingleChainOrder(preparedOrder: DcaSingleChainOrderPrepared): Promise<ApiResponse>;
|
|
604
645
|
static validateDcaSingleChainOrder(intentRequest: DcaSingleChainUserIntentRequest): Promise<void>;
|
|
646
|
+
static validateDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<void>;
|
|
647
|
+
static sendDcaCrossChainOrder(intentRequest: DcaCrossChainUserIntentRequest): Promise<ApiResponse>;
|
|
605
648
|
}
|
|
606
649
|
|
|
607
650
|
type CancelSingleChainOrderParams$1 = {
|
|
@@ -779,10 +822,14 @@ declare class SuiSDK extends BaseSDK {
|
|
|
779
822
|
}
|
|
780
823
|
|
|
781
824
|
/**
|
|
782
|
-
* Fetches
|
|
783
|
-
*
|
|
825
|
+
* Fetches the orders owned by the wallets encoded in a SIWE-issued JWT.
|
|
826
|
+
*
|
|
827
|
+
* The auctioneer derives the queried wallets from the verified JWT claims, never from
|
|
828
|
+
* caller-supplied params — a caller can only read intents for wallets it proved control
|
|
829
|
+
* of via SIWE. Obtain the token with `EVMSDK.authenticate()` (or the `fetchSiweMessage` +
|
|
830
|
+
* `fetchJWTToken` pair) and pass it here.
|
|
784
831
|
*/
|
|
785
|
-
declare function fetchUserOrders(
|
|
832
|
+
declare function fetchUserOrders(aggregatedToken: string): Promise<ApiUserOrders>;
|
|
786
833
|
|
|
787
834
|
declare class AuctioneerAPI {
|
|
788
835
|
aggregatedToken: string;
|
|
@@ -855,11 +902,6 @@ declare function calculateAmounts({ srcChainId, tokenIn, amountIn, destChainId,
|
|
|
855
902
|
minStablecoinsAmount: bigint;
|
|
856
903
|
}>;
|
|
857
904
|
|
|
858
|
-
declare const DEV_ACCESS_STORAGE_KEY = "x-dev-access";
|
|
859
|
-
declare const DEV_ACCESS_HEADER = "x-dev-access";
|
|
860
|
-
declare function getDevAccessHeaderValue(): string | undefined;
|
|
861
|
-
declare function withAuctioneerHeaders(headers?: Record<string, string>): Record<string, string>;
|
|
862
|
-
|
|
863
905
|
type CancelSingleChainOrderParams = {
|
|
864
906
|
orderId: string;
|
|
865
907
|
user: string;
|
|
@@ -983,15 +1025,15 @@ declare function getSecretHash(coinOutType: string, receiver: string, secretNumb
|
|
|
983
1025
|
*/
|
|
984
1026
|
declare function getSuiSingleChainLimitOrderTransaction(order: SingleChainOrder, secretHash: Uint8Array, guardAddress: string, client?: ReturnType<typeof createSuiClient>): Promise<Transaction>;
|
|
985
1027
|
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
1028
|
+
/**
|
|
1029
|
+
* Computes the SHA-256 hash the auctioneer expects for cross-chain execution details.
|
|
1030
|
+
*
|
|
1031
|
+
* The auctioneer recomputes sha256 over the exact `executionDetails` JSON string it
|
|
1032
|
+
* receives and rejects the order when it differs (hash mismatch). Callers therefore MUST
|
|
1033
|
+
* hash the same serialized string they send on the wire — pass that string here directly
|
|
1034
|
+
* instead of re-serializing a parallel object, which is how key-order/field drift creeps in.
|
|
1035
|
+
*/
|
|
1036
|
+
declare function generateExecutionDetailsHash(executionDetails: string): string;
|
|
995
1037
|
|
|
996
1038
|
type CreateSuiSingleChainLimitOrderIntentParams = {
|
|
997
1039
|
user: string;
|
|
@@ -1083,7 +1125,9 @@ declare function generateSuiDcaOrderSecretData(tokenOut: string, receiver: strin
|
|
|
1083
1125
|
secretHash: Uint8Array;
|
|
1084
1126
|
};
|
|
1085
1127
|
|
|
1086
|
-
declare function getSolanaDcaSingleChainOrderInstructions(order: DcaSingleChainOrder, options?:
|
|
1128
|
+
declare function getSolanaDcaSingleChainOrderInstructions(order: DcaSingleChainOrder, options?: {
|
|
1129
|
+
rpcUrl?: string;
|
|
1130
|
+
}): Promise<SolanaOrderInstructionResult & {
|
|
1087
1131
|
secretNumber: string;
|
|
1088
1132
|
}>;
|
|
1089
1133
|
|
|
@@ -1399,7 +1443,7 @@ declare function createEvmCrossChainOrderIntentRequest(params: CreateEvmCrossCha
|
|
|
1399
1443
|
* @returns Object containing typed data and nonce for signing
|
|
1400
1444
|
*/
|
|
1401
1445
|
declare function generateEvmSingleChainLimitOrderTypedData(order: SingleChainOrder): Promise<{
|
|
1402
|
-
orderTypedData:
|
|
1446
|
+
orderTypedData: TypedDataDefinition;
|
|
1403
1447
|
nonce: bigint;
|
|
1404
1448
|
}>;
|
|
1405
1449
|
/**
|
|
@@ -1408,7 +1452,7 @@ declare function generateEvmSingleChainLimitOrderTypedData(order: SingleChainOrd
|
|
|
1408
1452
|
* @returns Object containing typed data and nonce for signing
|
|
1409
1453
|
*/
|
|
1410
1454
|
declare function generateEvmSingleChainDcaOrderTypedData(order: DcaSingleChainOrder): Promise<{
|
|
1411
|
-
orderTypedData:
|
|
1455
|
+
orderTypedData: TypedDataDefinition;
|
|
1412
1456
|
nonce: bigint;
|
|
1413
1457
|
}>;
|
|
1414
1458
|
/**
|
|
@@ -1417,7 +1461,7 @@ declare function generateEvmSingleChainDcaOrderTypedData(order: DcaSingleChainOr
|
|
|
1417
1461
|
* @returns Object containing typed data and nonce for signing
|
|
1418
1462
|
*/
|
|
1419
1463
|
declare function generateEvmCrossChainOrderTypedData(order: CrossChainOrder): Promise<{
|
|
1420
|
-
orderTypedData:
|
|
1464
|
+
orderTypedData: TypedDataDefinition;
|
|
1421
1465
|
nonce: bigint;
|
|
1422
1466
|
}>;
|
|
1423
1467
|
/**
|
|
@@ -1425,6 +1469,39 @@ declare function generateEvmCrossChainOrderTypedData(order: CrossChainOrder): Pr
|
|
|
1425
1469
|
* @returns Random nonce as string
|
|
1426
1470
|
*/
|
|
1427
1471
|
declare function generateEvmRandomNonce(): string;
|
|
1472
|
+
type CreateEvmCrossChainDcaOrderIntentParams = {
|
|
1473
|
+
user: `0x${string}`;
|
|
1474
|
+
sourceChainId: SupportedEvmChain;
|
|
1475
|
+
sourceTokenAddress: string;
|
|
1476
|
+
destinationChainId: number;
|
|
1477
|
+
destinationTokenAddress: string;
|
|
1478
|
+
destinationTokenMinAmount?: bigint;
|
|
1479
|
+
destinationAddress: string;
|
|
1480
|
+
minStablecoinAmount?: bigint;
|
|
1481
|
+
deadline: number;
|
|
1482
|
+
startTime: number;
|
|
1483
|
+
amountInPerInterval: bigint;
|
|
1484
|
+
totalIntervals: number;
|
|
1485
|
+
intervalDuration: number;
|
|
1486
|
+
extraTransfers?: ExtraTransfer$1[];
|
|
1487
|
+
nonce?: string;
|
|
1488
|
+
signature?: string;
|
|
1489
|
+
};
|
|
1490
|
+
/**
|
|
1491
|
+
* Creates an EVM cross-chain DCA order intent request, ready to POST to
|
|
1492
|
+
* `/user_intent/cross_chain/dca_order`. Pass `nonce`/`signature` from
|
|
1493
|
+
* {@link getEVMCrossChainDcaOrderTypedData} for an executable order.
|
|
1494
|
+
*/
|
|
1495
|
+
declare function createEvmCrossChainDcaOrderIntentRequest(params: CreateEvmCrossChainDcaOrderIntentParams): DcaCrossChainUserIntentRequest;
|
|
1496
|
+
/**
|
|
1497
|
+
* Generates the EIP-712 typed data (and nonce) for a cross-chain DCA order's Permit2 witness.
|
|
1498
|
+
* Sign `orderTypedData`, then pass the resulting `nonce`/`signature` into
|
|
1499
|
+
* {@link createEvmCrossChainDcaOrderIntentRequest} — both share the same execution-details hash.
|
|
1500
|
+
*/
|
|
1501
|
+
declare function getEVMCrossChainDcaOrderTypedData(params: CreateEvmCrossChainDcaOrderIntentParams, providedNonce?: bigint): {
|
|
1502
|
+
orderTypedData: TypedDataDefinition;
|
|
1503
|
+
nonce: bigint;
|
|
1504
|
+
};
|
|
1428
1505
|
|
|
1429
1506
|
type CreateSolanaSingleChainLimitOrderIntentParams = {
|
|
1430
1507
|
user: string;
|
|
@@ -1469,7 +1546,8 @@ type CreateSolanaCrossChainOrderIntentParams = {
|
|
|
1469
1546
|
deadline: number;
|
|
1470
1547
|
extraTransfers?: ExtraTransfer$1[];
|
|
1471
1548
|
orderPubkey?: string;
|
|
1472
|
-
|
|
1549
|
+
stopLossType?: StopLossType;
|
|
1550
|
+
stopLossTriggerPrice?: string;
|
|
1473
1551
|
takeProfitMinOut?: bigint;
|
|
1474
1552
|
};
|
|
1475
1553
|
/**
|
|
@@ -1495,7 +1573,7 @@ declare function createSolanaCrossChainOrderIntentRequest(params: CreateSolanaCr
|
|
|
1495
1573
|
* @param order The single-chain order
|
|
1496
1574
|
* @returns Promise resolving to instruction bytes
|
|
1497
1575
|
*/
|
|
1498
|
-
declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleChainOrder
|
|
1576
|
+
declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1499
1577
|
secretNumber: string;
|
|
1500
1578
|
}>;
|
|
1501
1579
|
/**
|
|
@@ -1503,7 +1581,7 @@ declare function generateSolanaSingleChainLimitOrderInstructions(order: SingleCh
|
|
|
1503
1581
|
* @param order The DCA order
|
|
1504
1582
|
* @returns Promise resolving to instruction bytes
|
|
1505
1583
|
*/
|
|
1506
|
-
declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleChainOrder
|
|
1584
|
+
declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleChainOrder): Promise<SolanaOrderInstructionResult & {
|
|
1507
1585
|
secretNumber: string;
|
|
1508
1586
|
}>;
|
|
1509
1587
|
/**
|
|
@@ -1511,7 +1589,7 @@ declare function generateSolanaSingleChainDcaOrderInstructions(order: DcaSingleC
|
|
|
1511
1589
|
* @param order The cross-chain order
|
|
1512
1590
|
* @returns Promise resolving to instruction bytes
|
|
1513
1591
|
*/
|
|
1514
|
-
declare function generateSolanaCrossChainOrderInstructions(order: CrossChainOrder
|
|
1592
|
+
declare function generateSolanaCrossChainOrderInstructions(order: CrossChainOrder): Promise<SolanaOrderInstructionResult>;
|
|
1515
1593
|
/**
|
|
1516
1594
|
* Generates secret data for Solana single-chain limit orders
|
|
1517
1595
|
* @param tokenOut Output token mint address
|
|
@@ -1542,4 +1620,4 @@ declare function generateSolanaDcaOrderSecretData(tokenOut: string, receiver: st
|
|
|
1542
1620
|
*/
|
|
1543
1621
|
declare function generateSolanaRandomSecretNumber(): string;
|
|
1544
1622
|
|
|
1545
|
-
export { AUCTIONEER_URL, type ApiCrossChainOrder, type ApiIntentResponse, type ApiResponse, type ApiSingleChainOrder, type ApiUserOrders, AuctioneerAPI, CROSS_CHAIN_GUARD_ADDRESSES, type CancelCrossChainOrderParams, type CancelSingleChainOrderParams, ChainID, type ChainOrderStatus, ChainType, type CreateCrossChainOrderParams, type CreateDcaSingleChainOrderParams, type CreateEvmCrossChainOrderIntentParams, type CreateEvmSingleChainDcaOrderIntentParams, type CreateEvmSingleChainLimitOrderIntentParams, type CreateSingleChainOrderParams, type CreateSolanaCrossChainOrderIntentParams, type CreateSolanaSingleChainDcaOrderIntentParams, type CreateSolanaSingleChainLimitOrderIntentParams, type CreateSuiCrossChainOrderIntentParams, type CreateSuiSingleChainDcaOrderIntentParams, type CreateSuiSingleChainLimitOrderIntentParams, CrossChainOrder,
|
|
1623
|
+
export { AUCTIONEER_URL, type ApiCrossChainOrder, type ApiIntentResponse, type ApiResponse, type ApiSingleChainOrder, type ApiUserOrders, AuctioneerAPI, CROSS_CHAIN_GUARD_ADDRESSES, type CancelCrossChainOrderParams, type CancelSingleChainOrderParams, ChainID, type ChainOrderStatus, ChainType, type CreateCrossChainOrderParams, type CreateDcaSingleChainOrderParams, type CreateEvmCrossChainDcaOrderIntentParams, type CreateEvmCrossChainOrderIntentParams, type CreateEvmSingleChainDcaOrderIntentParams, type CreateEvmSingleChainLimitOrderIntentParams, type CreateSingleChainOrderParams, type CreateSolanaCrossChainOrderIntentParams, type CreateSolanaSingleChainDcaOrderIntentParams, type CreateSolanaSingleChainLimitOrderIntentParams, type CreateSuiCrossChainOrderIntentParams, type CreateSuiSingleChainDcaOrderIntentParams, type CreateSuiSingleChainLimitOrderIntentParams, CrossChainOrder, DCA_CROSS_CHAIN_GUARD_ADDRESSES, DCA_SINGLE_CHAIN_GUARD_ADDRESSES, DcaSingleChainOrder, type DefiLlamaCoinData, type DefiLlamaTokensResponse, type EVMConfig, EVMSDK, EVM_ZERO_ADDRESS, EVM_ZERO_SIGNATURE, type FetchJWTParams, type FetchSiweMessageParams, IntentsOrderType, type IntentsQuoteParams, MAX_UINT_128, MAX_UINT_256, MAX_UINT_32, MAX_UINT_64, NATIVE_EVM_ETH_ADDRESSES, NATIVE_SOLANA_TOKEN_ADDRESS, NATIVE_SUI_TOKEN_ADDRESS, PERMIT2_ADDRESS, PROD_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_CROSS_CHAIN_GUARD_ADDRESSES, PROD_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SINGLE_CHAIN_GUARD_ADDRESSES, PROD_SUI_PACKAGE_ID, QuoteProvider, type QuoteResponse, SINGLE_CHAIN_GUARD_ADDRESSES, SOLANA_MINT_TOKEN, SOLANA_USDC_MINT, SUI_GUARD_COLLATERAL_TYPE, SUI_GUARD_STABLECOIN_TYPE, SUI_PACKAGE_ID, SingleChainOrder, type SolanaConfig, type SolanaOrderInstructionResult, SolanaSDK, type StopLossType, type SuiConfig, SuiSDK, type SupportedChain, SupportedChains, type SupportedEvmChain, TEST_CROSS_CHAIN_GUARD_ADDRESSES, TEST_DCA_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SINGLE_CHAIN_GUARD_ADDRESSES, TEST_SUI_PACKAGE_ID, TOKEN_SEARCH_API_BASE_URL, type TokenInfo, type TokenSearchParams, type TokenSearchResponse, ValidationError, WRAPPED_ETH_ADDRESSES, WRAPPED_SOL_MINT_ADDRESS, calculateAmounts, cancelCrossChainOrderInstructionsAsBytes, cancelDcaSingleChainOrderInstructions, cancelSingleChainOrderInstructionsAsBytes, chainIdToChainTypeMap, createEvmCrossChainDcaOrderIntentRequest, createEvmCrossChainOrderIntentRequest, createEvmSingleChainDcaOrderIntentRequest, createEvmSingleChainLimitOrderIntentRequest, createSolanaCrossChainOrderIntentRequest, createSolanaSingleChainDcaOrderIntentRequest, createSolanaSingleChainLimitOrderIntentRequest, createSuiCrossChainOrderIntentRequest, createSuiSingleChainDcaOrderIntentRequest, createSuiSingleChainLimitOrderIntentRequest, fetchJWTToken, fetchSiweMessage, fetchUserOrders, generateEvmCrossChainOrderTypedData, generateEvmRandomNonce, generateEvmSingleChainDcaOrderTypedData, generateEvmSingleChainLimitOrderTypedData, generateExecutionDetailsHash, generateSolanaCrossChainOrderInstructions, generateSolanaDcaOrderSecretData, generateSolanaLimitOrderSecretData, generateSolanaRandomSecretNumber, generateSolanaSingleChainDcaOrderInstructions, generateSolanaSingleChainLimitOrderInstructions, generateSuiDcaOrderSecretData, generateSuiLimitOrderSecretData, getCancelCrossChainOrderRawData, getCancelSingleChainOrderRawData, getCoinFromResponse, getDcaSecretHash, getEVMCrossChainDcaOrderTypedData, getEVMCrossChainOrderTypedData, getEVMSingleChainOrderTypedData, getInvalidateNoncesRawData, getSecretHash, getSolanaCrossChainOrderInstructions, getSolanaDcaSingleChainOrderInstructions, getSolanaOrdersWithLockedFunds, getSolanaSingleChainOrderInstructions, getSuiCancelCrossChainOrder, getSuiOrderTransaction, getRandomU64Number as getSuiRandomU64Number, getSuiSingleChainDcaOrderTransaction, getSuiSingleChainLimitOrderTransaction, getTokenList, getTokensData, isErrorApiResponse, isEvmChain, isNativeEvmToken, isSuccessApiResponse, isSupportedChain, normalizeNativeEvmTokenForSigning, prepareDcaSecretData, prepareSecretData, signSingleChainDcaOrder, signSingleChainLimitOrder };
|