File tree Expand file tree Collapse file tree 7 files changed +25
-22
lines changed
providers/debridge/functions Expand file tree Collapse file tree 7 files changed +25
-22
lines changed Original file line number Diff line number Diff line change 2020 "check-exports" : " attw --pack ." ,
2121 "lint" : " tsc" ,
2222 "test" : " jest" ,
23+ "add-change" : " npx changeset" ,
2324 "local-release" : " changeset version && changeset publish" ,
2425 "link" : " pnpm link --global" ,
2526 "prepublishOnly" : " npm run ci"
Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ function determineTransaction(
105105 dstChainId : DLNInternalId [ args . fromChain ] ,
106106 dstChainTokenOut : args . fromToken ,
107107 srcChainTokenInAmount : parseUnits ( args . amount , args . fromTokenDecimal ) ,
108- }
108+ } ;
109109 } else {
110110 return {
111111 srcChainId : DLNInternalId [ args . fromChain ] ,
Original file line number Diff line number Diff line change 1- export * from ' ./toResult' ;
1+ export * from " ./toResult" ;
Original file line number Diff line number Diff line change 1- import { toResult } from ' ./toResult' ;
1+ import { toResult } from " ./toResult" ;
22
3- describe ( ' toResult' , ( ) => {
4- it ( ' should return success true when error is false' , ( ) => {
5- const result = toResult ( ' data' , false ) ;
6- expect ( result . success ) . toBe ( true ) ;
7- expect ( result . data ) . toBe ( ' data' ) ;
8- } ) ;
3+ describe ( " toResult" , ( ) => {
4+ it ( " should return success true when error is false" , ( ) => {
5+ const result = toResult ( " data" , false ) ;
6+ expect ( result . success ) . toBe ( true ) ;
7+ expect ( result . data ) . toBe ( " data" ) ;
8+ } ) ;
99
10- it ( ' should return success false when error is true' , ( ) => {
11- const result = toResult ( ' data' , true ) ;
12- expect ( result . success ) . toBe ( false ) ;
13- expect ( result . data ) . toBe ( ' ERROR: data' ) ;
14- } ) ;
10+ it ( " should return success false when error is true" , ( ) => {
11+ const result = toResult ( " data" , true ) ;
12+ expect ( result . success ) . toBe ( false ) ;
13+ expect ( result . data ) . toBe ( " ERROR: data" ) ;
14+ } ) ;
1515} ) ;
Original file line number Diff line number Diff line change 1- import { FunctionReturn } from ' ../type' ;
1+ import { FunctionReturn } from " ../type" ;
22
3- export function toResult ( data = '' , error = false ) : FunctionReturn {
4- return {
5- success : ! error ,
6- data : error ? `ERROR: ${ data } ` : data ,
7- } ;
3+ export function toResult ( data = "" , error = false ) : FunctionReturn {
4+ return {
5+ success : ! error ,
6+ data : error ? `ERROR: ${ data } ` : data ,
7+ } ;
88}
Original file line number Diff line number Diff line change @@ -64,4 +64,4 @@ export const getChainMap = (chainId: number) => {
6464
6565export const getRpc = ( rpcUrls : string [ ] ) => {
6666 return rpcUrls [ Math . floor ( Math . random ( ) * rpcUrls . length ) ] ;
67- } ;
67+ } ;
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { z } from "zod";
22import { AdapterProvider , UseFunction } from "./adapters" ;
33import { BaseAccount } from "./accounts" ;
44import { Wallio } from "./wallio" ;
5+ import { formatUnits } from "viem" ;
56
67class MockAccount extends BaseAccount {
78 getAddress ( ) {
@@ -14,7 +15,8 @@ class MockAccount extends BaseAccount {
1415 return "MockAccount" ;
1516 }
1617 async getBalance ( ) {
17- return BigInt ( 1000 ) ;
18+ const balance = BigInt ( 1000 ) ;
19+ return formatUnits ( balance , 18 ) ;
1820 }
1921 async nativeTransfer ( to , value ) {
2022 return "0xMockTxHash" ;
You can’t perform that action at this time.
0 commit comments