@@ -11,6 +11,7 @@ dotenv.config();
11
11
12
12
// TODO: calculate this
13
13
const ACCOUNT_CLASS_HASH = "0x4d07e40e93398ed3c76981e72dd1fd22557a78ce36c0515f679e27f0bb5bc5f" ;
14
+ const DEFAULT_TOKEN_ADDRESS = "0x49d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7" ;
14
15
15
16
export class StarkNetWallet {
16
17
public account : Account ;
@@ -77,7 +78,7 @@ export class StarkNetWallet {
77
78
78
79
static async getBalance ( address : string , provider : ProviderInterface , tokenAddress ?: string ) : Promise < BigNumber > {
79
80
if ( tokenAddress == null ) {
80
- tokenAddress = ensureEnvVar ( "TOKEN_ADDRESS" ) ; // todo: move to config per chain
81
+ tokenAddress = DEFAULT_TOKEN_ADDRESS ;
81
82
}
82
83
const erc20ABI = json . parse ( fs . readFileSync ( "./src/interfaces/ERC20_abi.json" ) . toString ( "ascii" ) ) ;
83
84
const erc20 = new Contract ( erc20ABI , tokenAddress , provider ) ;
@@ -177,7 +178,7 @@ export class StarkNetWallet {
177
178
178
179
async transfer ( recipientAddress : string , amount : BigNumber , tokenAddress ?: string , decimals : number = 18 ) {
179
180
if ( tokenAddress == null ) {
180
- tokenAddress = ensureEnvVar ( "TOKEN_ADDRESS" ) ;
181
+ tokenAddress = DEFAULT_TOKEN_ADDRESS ;
181
182
}
182
183
183
184
const erc20ABI = json . parse ( fs . readFileSync ( "./src/interfaces/ERC20_abi.json" ) . toString ( "ascii" ) ) ;
@@ -248,6 +249,8 @@ export class StarkNetWallet {
248
249
calldata : this . toRawCallData ( calldata ) ,
249
250
} ;
250
251
252
+ console . log ( "Call" , call ) ;
253
+
251
254
let estimateFee = await this . account . estimateInvokeFee ( call ) ;
252
255
prettyPrintFee ( estimateFee ) ;
253
256
0 commit comments