@@ -11,10 +11,11 @@ import type { BuildSwapTransaction } from './types';
11
11
*/
12
12
import { getAPIParamsForToken } from './utils/getAPIParamsForToken' ;
13
13
import { getSwapTransaction } from './utils/getSwapTransaction' ;
14
+ import type { Address } from 'viem' ;
14
15
15
16
vi . mock ( '@/core/network/request' ) ;
16
17
17
- const testFromAddress = '0x6Cd01c0F55ce9E0Bf78f5E90f72b4345b16d515d' ;
18
+ const testFromAddress : Address = '0x6Cd01c0F55ce9E0Bf78f5E90f72b4345b16d515d' ;
18
19
const testAmount = '3305894409732200' ;
19
20
const testAmountReference = 'from' as const ;
20
21
@@ -26,7 +27,7 @@ describe('buildSwapTransaction', () => {
26
27
it ( 'should return a swap' , async ( ) => {
27
28
const mockParams = {
28
29
useAggregator : true ,
29
- fromAddress : testFromAddress as `0x${ string } ` ,
30
+ fromAddress : testFromAddress ,
30
31
amountReference : testAmountReference ,
31
32
from : ETH_TOKEN ,
32
33
to : DEGEN_TOKEN ,
@@ -122,7 +123,7 @@ describe('buildSwapTransaction', () => {
122
123
it ( 'should return a swap with useAggregator=false' , async ( ) => {
123
124
const mockParams = {
124
125
useAggregator : false ,
125
- fromAddress : testFromAddress as `0x${ string } ` ,
126
+ fromAddress : testFromAddress ,
126
127
amountReference : testAmountReference ,
127
128
from : ETH_TOKEN ,
128
129
to : DEGEN_TOKEN ,
@@ -204,7 +205,7 @@ describe('buildSwapTransaction', () => {
204
205
it ( 'should return an error for an unsupported amount reference' , async ( ) => {
205
206
const mockParams = {
206
207
useAggregator : true ,
207
- fromAddress : testFromAddress as `0x${ string } ` ,
208
+ fromAddress : testFromAddress ,
208
209
amountReference : 'to' as const ,
209
210
from : ETH_TOKEN ,
210
211
to : DEGEN_TOKEN ,
@@ -222,7 +223,7 @@ describe('buildSwapTransaction', () => {
222
223
const mockParams = {
223
224
useAggregator : true ,
224
225
maxSlippage : '3' ,
225
- fromAddress : testFromAddress as `0x${ string } ` ,
226
+ fromAddress : testFromAddress ,
226
227
amountReference : testAmountReference ,
227
228
from : DEGEN_TOKEN ,
228
229
to : ETH_TOKEN ,
@@ -311,7 +312,7 @@ describe('buildSwapTransaction', () => {
311
312
it ( 'should return an error if sendRequest fails' , async ( ) => {
312
313
const mockParams = {
313
314
useAggregator : true ,
314
- fromAddress : testFromAddress as `0x${ string } ` ,
315
+ fromAddress : testFromAddress ,
315
316
amountReference : testAmountReference ,
316
317
from : ETH_TOKEN ,
317
318
to : DEGEN_TOKEN ,
@@ -337,7 +338,7 @@ describe('buildSwapTransaction', () => {
337
338
it ( 'should return an error object from buildSwapTransaction' , async ( ) => {
338
339
const mockParams = {
339
340
useAggregator : true ,
340
- fromAddress : testFromAddress as `0x${ string } ` ,
341
+ fromAddress : testFromAddress ,
341
342
amountReference : testAmountReference ,
342
343
from : ETH_TOKEN ,
343
344
to : DEGEN_TOKEN ,
@@ -368,7 +369,7 @@ describe('buildSwapTransaction', () => {
368
369
it ( 'should return an error object from buildSwapTransaction for invalid `amount` input' , async ( ) => {
369
370
const mockParams = {
370
371
useAggregator : true ,
371
- fromAddress : testFromAddress as `0x${ string } ` ,
372
+ fromAddress : testFromAddress ,
372
373
amountReference : testAmountReference ,
373
374
from : ETH_TOKEN ,
374
375
to : DEGEN_TOKEN ,
@@ -387,7 +388,7 @@ describe('buildSwapTransaction', () => {
387
388
const mockParams = {
388
389
useAggregator : true ,
389
390
maxSlippage : '3' ,
390
- fromAddress : testFromAddress as `0x${ string } ` ,
391
+ fromAddress : testFromAddress ,
391
392
amountReference : testAmountReference ,
392
393
from : ETH_TOKEN ,
393
394
to : DEGEN_TOKEN ,
0 commit comments