Skip to content

Instantly share code, notes, and snippets.

@SametSahin10
Created March 11, 2025 12:52
Show Gist options
  • Save SametSahin10/26b2025eb5a572996e69ff7be58f0be9 to your computer and use it in GitHub Desktop.
Save SametSahin10/26b2025eb5a572996e69ff7be58f0be9 to your computer and use it in GitHub Desktop.
import 'dart:io';
import 'package:fuse_wallet_sdk/fuse_wallet_sdk.dart';
void main() async {
// TODO: Add your private key
final credentials = EthPrivateKey.fromHex('');
final prodApiKey = 'pk_F7gisUhUTV5LyiNcftikb0UL';
final fuseSDK = await FuseSDK.init(
prodApiKey,
credentials,
withPaymaster: true,
);
final usdcTokenAddress = "0xc6bc407706b7140ee8eef2f86f9504651b63e7f9";
final wethTokenAddress = "0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590";
// TODO: Adjust the amount accordingly.
final tokenAmount = "0.00005";
final stakeTokenResponse = await fuseSDK.stakeToken(
StakeRequestBody(
accountAddress: walletAddress,
tokenAmount: tokenAmount,
tokenAddress: wethTokenAddress,
isSimpleStaking: true,
),
);
print(
"Staked token successfully. "
"Stake token response: ${stakeTokenResponse.toString()}",
);
exit(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment