@tomo-inc/transaction-builder-sdk 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -3
- package/dist/index.d.cts +22 -63
- package/dist/index.d.ts +22 -63
- package/dist/index.js +2621 -0
- package/dist/index.mjs +11 -6820
- package/package.json +1 -1
- package/dist/index.cjs +0 -9429
package/README.md
CHANGED
|
@@ -26,9 +26,7 @@ import { Business } from "@tomo-inc/transaction-builder-sdk";
|
|
|
26
26
|
|
|
27
27
|
const business = new Business({
|
|
28
28
|
config: {
|
|
29
|
-
|
|
30
|
-
API_SECRET: "your-api-secret",
|
|
31
|
-
SALT: "your-salt",
|
|
29
|
+
CLIENT_ID: "your-client-id",
|
|
32
30
|
},
|
|
33
31
|
tomoStage: "prod", // or 'dev' for development
|
|
34
32
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -192,11 +192,25 @@ type PermitSignParams = {
|
|
|
192
192
|
};
|
|
193
193
|
signature: string;
|
|
194
194
|
};
|
|
195
|
+
type PermitTypeData = {
|
|
196
|
+
types: {
|
|
197
|
+
[key in string]: any;
|
|
198
|
+
};
|
|
199
|
+
message: {
|
|
200
|
+
[key in string]: any;
|
|
201
|
+
};
|
|
202
|
+
primaryType: string;
|
|
203
|
+
domain: {
|
|
204
|
+
[key in string]: any;
|
|
205
|
+
};
|
|
206
|
+
signatureHash?: string;
|
|
207
|
+
};
|
|
208
|
+
type PermitBuilderParams = {
|
|
209
|
+
signature: Hex;
|
|
210
|
+
permitTypeData: PermitTypeData;
|
|
211
|
+
};
|
|
195
212
|
|
|
196
213
|
type Config = {
|
|
197
|
-
API_KEY: string;
|
|
198
|
-
API_SECRET: string;
|
|
199
|
-
SALT: string;
|
|
200
214
|
CLIENT_ID: string;
|
|
201
215
|
};
|
|
202
216
|
type TomoStage = "dev" | "prod";
|
|
@@ -331,7 +345,7 @@ declare class Business {
|
|
|
331
345
|
*/
|
|
332
346
|
bridgeBuilder: (quote: TransactionQuoteResult, quoteParams: TransactionQuoteParams, permitSignParams?: {
|
|
333
347
|
signature: Hex;
|
|
334
|
-
permitTypeData:
|
|
348
|
+
permitTypeData: PermitTypeData;
|
|
335
349
|
} | null | undefined) => ReturnType<ReturnType<typeof bridgeBuilder>>;
|
|
336
350
|
/**
|
|
337
351
|
* Get cross-chain bridge quotes for token swaps between different chains
|
|
@@ -421,7 +435,7 @@ declare class Business {
|
|
|
421
435
|
*/
|
|
422
436
|
swapBuilder: (quote: TransactionQuoteResult, quoteParams: TransactionQuoteParams, permitSignParams?: {
|
|
423
437
|
signature: Hex;
|
|
424
|
-
permitTypeData:
|
|
438
|
+
permitTypeData: PermitTypeData;
|
|
425
439
|
} | null | undefined) => ReturnType<ReturnType<typeof swapBuilder>>;
|
|
426
440
|
/**
|
|
427
441
|
* Get all supported chains for swap operations
|
|
@@ -510,34 +524,7 @@ declare class Business {
|
|
|
510
524
|
* const unsignTx = await business.swapBuilder(quote, quoteParams, { signature, permitTypeData });
|
|
511
525
|
* ```
|
|
512
526
|
*/
|
|
513
|
-
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<
|
|
514
|
-
types: {
|
|
515
|
-
PermitDetails: {
|
|
516
|
-
name: string;
|
|
517
|
-
type: string;
|
|
518
|
-
}[];
|
|
519
|
-
PermitSingle: {
|
|
520
|
-
name: string;
|
|
521
|
-
type: string;
|
|
522
|
-
}[];
|
|
523
|
-
};
|
|
524
|
-
message: {
|
|
525
|
-
details: {
|
|
526
|
-
token: string;
|
|
527
|
-
amount: string;
|
|
528
|
-
expiration: number;
|
|
529
|
-
nonce: number;
|
|
530
|
-
};
|
|
531
|
-
spender: string;
|
|
532
|
-
sigDeadline: number;
|
|
533
|
-
};
|
|
534
|
-
primaryType: string;
|
|
535
|
-
domain: {
|
|
536
|
-
name: string;
|
|
537
|
-
chainId: number;
|
|
538
|
-
verifyingContract: Hex;
|
|
539
|
-
};
|
|
540
|
-
}>;
|
|
527
|
+
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<PermitTypeData>;
|
|
541
528
|
};
|
|
542
529
|
tron: {
|
|
543
530
|
/**
|
|
@@ -548,37 +535,9 @@ declare class Business {
|
|
|
548
535
|
* const unsignTx = await business.swapBuilder(quote, quoteParams, { signature, permitTypeData });
|
|
549
536
|
* ```
|
|
550
537
|
*/
|
|
551
|
-
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<
|
|
552
|
-
types: {
|
|
553
|
-
PermitDetails: {
|
|
554
|
-
name: string;
|
|
555
|
-
type: string;
|
|
556
|
-
}[];
|
|
557
|
-
PermitSingle: {
|
|
558
|
-
name: string;
|
|
559
|
-
type: string;
|
|
560
|
-
}[];
|
|
561
|
-
};
|
|
562
|
-
message: {
|
|
563
|
-
details: {
|
|
564
|
-
token: `0x${string}`;
|
|
565
|
-
amount: string;
|
|
566
|
-
expiration: number;
|
|
567
|
-
nonce: bigint;
|
|
568
|
-
};
|
|
569
|
-
spender: `0x${string}`;
|
|
570
|
-
sigDeadline: number;
|
|
571
|
-
};
|
|
572
|
-
primaryType: string;
|
|
573
|
-
domain: {
|
|
574
|
-
name: string;
|
|
575
|
-
chainId: number;
|
|
576
|
-
verifyingContract: string;
|
|
577
|
-
};
|
|
578
|
-
signatureHash: string;
|
|
579
|
-
}>;
|
|
538
|
+
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<PermitTypeData>;
|
|
580
539
|
rpc: string;
|
|
581
540
|
};
|
|
582
541
|
}
|
|
583
542
|
|
|
584
|
-
export { Business, type Chain, IPlatformType, type PermitSignParams, type Transaction, type TransactionEVM, type TransactionQuoteParams, type TransactionQuoteResult, type TransactionSOL, type TransactionTRON, type TransactionToken };
|
|
543
|
+
export { Business, type Chain, type Config, IPlatformType, type PermitBuilderParams, type PermitSignParams, type PermitTypeData, type TomoStage, type Transaction, type TransactionEVM, type TransactionQuoteParams, type TransactionQuoteResult, type TransactionSOL, type TransactionTRON, type TransactionToken };
|
package/dist/index.d.ts
CHANGED
|
@@ -192,11 +192,25 @@ type PermitSignParams = {
|
|
|
192
192
|
};
|
|
193
193
|
signature: string;
|
|
194
194
|
};
|
|
195
|
+
type PermitTypeData = {
|
|
196
|
+
types: {
|
|
197
|
+
[key in string]: any;
|
|
198
|
+
};
|
|
199
|
+
message: {
|
|
200
|
+
[key in string]: any;
|
|
201
|
+
};
|
|
202
|
+
primaryType: string;
|
|
203
|
+
domain: {
|
|
204
|
+
[key in string]: any;
|
|
205
|
+
};
|
|
206
|
+
signatureHash?: string;
|
|
207
|
+
};
|
|
208
|
+
type PermitBuilderParams = {
|
|
209
|
+
signature: Hex;
|
|
210
|
+
permitTypeData: PermitTypeData;
|
|
211
|
+
};
|
|
195
212
|
|
|
196
213
|
type Config = {
|
|
197
|
-
API_KEY: string;
|
|
198
|
-
API_SECRET: string;
|
|
199
|
-
SALT: string;
|
|
200
214
|
CLIENT_ID: string;
|
|
201
215
|
};
|
|
202
216
|
type TomoStage = "dev" | "prod";
|
|
@@ -331,7 +345,7 @@ declare class Business {
|
|
|
331
345
|
*/
|
|
332
346
|
bridgeBuilder: (quote: TransactionQuoteResult, quoteParams: TransactionQuoteParams, permitSignParams?: {
|
|
333
347
|
signature: Hex;
|
|
334
|
-
permitTypeData:
|
|
348
|
+
permitTypeData: PermitTypeData;
|
|
335
349
|
} | null | undefined) => ReturnType<ReturnType<typeof bridgeBuilder>>;
|
|
336
350
|
/**
|
|
337
351
|
* Get cross-chain bridge quotes for token swaps between different chains
|
|
@@ -421,7 +435,7 @@ declare class Business {
|
|
|
421
435
|
*/
|
|
422
436
|
swapBuilder: (quote: TransactionQuoteResult, quoteParams: TransactionQuoteParams, permitSignParams?: {
|
|
423
437
|
signature: Hex;
|
|
424
|
-
permitTypeData:
|
|
438
|
+
permitTypeData: PermitTypeData;
|
|
425
439
|
} | null | undefined) => ReturnType<ReturnType<typeof swapBuilder>>;
|
|
426
440
|
/**
|
|
427
441
|
* Get all supported chains for swap operations
|
|
@@ -510,34 +524,7 @@ declare class Business {
|
|
|
510
524
|
* const unsignTx = await business.swapBuilder(quote, quoteParams, { signature, permitTypeData });
|
|
511
525
|
* ```
|
|
512
526
|
*/
|
|
513
|
-
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<
|
|
514
|
-
types: {
|
|
515
|
-
PermitDetails: {
|
|
516
|
-
name: string;
|
|
517
|
-
type: string;
|
|
518
|
-
}[];
|
|
519
|
-
PermitSingle: {
|
|
520
|
-
name: string;
|
|
521
|
-
type: string;
|
|
522
|
-
}[];
|
|
523
|
-
};
|
|
524
|
-
message: {
|
|
525
|
-
details: {
|
|
526
|
-
token: string;
|
|
527
|
-
amount: string;
|
|
528
|
-
expiration: number;
|
|
529
|
-
nonce: number;
|
|
530
|
-
};
|
|
531
|
-
spender: string;
|
|
532
|
-
sigDeadline: number;
|
|
533
|
-
};
|
|
534
|
-
primaryType: string;
|
|
535
|
-
domain: {
|
|
536
|
-
name: string;
|
|
537
|
-
chainId: number;
|
|
538
|
-
verifyingContract: Hex;
|
|
539
|
-
};
|
|
540
|
-
}>;
|
|
527
|
+
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<PermitTypeData>;
|
|
541
528
|
};
|
|
542
529
|
tron: {
|
|
543
530
|
/**
|
|
@@ -548,37 +535,9 @@ declare class Business {
|
|
|
548
535
|
* const unsignTx = await business.swapBuilder(quote, quoteParams, { signature, permitTypeData });
|
|
549
536
|
* ```
|
|
550
537
|
*/
|
|
551
|
-
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<
|
|
552
|
-
types: {
|
|
553
|
-
PermitDetails: {
|
|
554
|
-
name: string;
|
|
555
|
-
type: string;
|
|
556
|
-
}[];
|
|
557
|
-
PermitSingle: {
|
|
558
|
-
name: string;
|
|
559
|
-
type: string;
|
|
560
|
-
}[];
|
|
561
|
-
};
|
|
562
|
-
message: {
|
|
563
|
-
details: {
|
|
564
|
-
token: `0x${string}`;
|
|
565
|
-
amount: string;
|
|
566
|
-
expiration: number;
|
|
567
|
-
nonce: bigint;
|
|
568
|
-
};
|
|
569
|
-
spender: `0x${string}`;
|
|
570
|
-
sigDeadline: number;
|
|
571
|
-
};
|
|
572
|
-
primaryType: string;
|
|
573
|
-
domain: {
|
|
574
|
-
name: string;
|
|
575
|
-
chainId: number;
|
|
576
|
-
verifyingContract: string;
|
|
577
|
-
};
|
|
578
|
-
signatureHash: string;
|
|
579
|
-
}>;
|
|
538
|
+
getPermitTypeData: (quoteParams: TransactionQuoteParams, quoteResult: TransactionQuoteResult) => Promise<PermitTypeData>;
|
|
580
539
|
rpc: string;
|
|
581
540
|
};
|
|
582
541
|
}
|
|
583
542
|
|
|
584
|
-
export { Business, type Chain, IPlatformType, type PermitSignParams, type Transaction, type TransactionEVM, type TransactionQuoteParams, type TransactionQuoteResult, type TransactionSOL, type TransactionTRON, type TransactionToken };
|
|
543
|
+
export { Business, type Chain, type Config, IPlatformType, type PermitBuilderParams, type PermitSignParams, type PermitTypeData, type TomoStage, type Transaction, type TransactionEVM, type TransactionQuoteParams, type TransactionQuoteResult, type TransactionSOL, type TransactionTRON, type TransactionToken };
|