Leveraging Particle’s AA SDK within Android applications.
network.particle:aa-service
dependency within your build.gradle
file, filling in latest_version
with the most recent release on Maven.
This should be defined in a way similar to the example below:
📘 Important details before initialization
Before initializing the SDK, there are a few key points to keep in mind, specifically regarding the utilization of Paymasters (to sponsor gas fees, pay for gas in ERC-20 tokens, etc.)
ParticleNetwork.initAAMode
, which takes the following parameters:
apiKey
, a singular or array of specific chains mapped to a given Biconomy API key, allowing for the usage of Biconomy’s Paymaster (if applicable).aaService
, dictating the smart account implementation to be used, this can be:
BiconomyV1AAService
, a Biconomy smart accountBiconomyV2AAService
, a Biconomy smart accountCyberConnectAAService
, a CyberConnect smart account.SimpleV1AAService
, a SimpleAccount implementation.SimpleV2AAService
, a SimpleAccount implementation.LightAAService
, a Light Account implementation.initAAMode
, you’ll need to intentionally enable it (signaling an updated address on the wallet interface, among other things) by using ParticleNetwork.getAAService().enableAAMode()
. Alternatively, if it’s already enabled and you’d like to disable it, you can do so with disableAAMode
.
If you’re unsure whether or not AA mode is enabled or not, you can retrieve a Boolean representing this status with isAAModeEnable
.
E.g.:
ParticleNetwork
can be done through ParticleNetwork.signAndSendTransaction
, which takes the following parameters:
transaction
, a stringified standard transaction object.callback
, return handling.feeMode
, the mechanism to be used for paying gas fees, can be:
FeeModeGasless
, for sponsored transactions. This will happen automatically for Testnets, pulling from your previously defined (or configured) Paymaster for Mainnets.FeeModeNative
, native payments.FeeModeToken
, enables the selection of a specific mechanism, takes one parameter:
feeQuote
, to be used when leveraging a Token Paymaster, can be retrieved through ParticleNetwork.getAAService().rpcGetFeeQuotes()
.signAndSendTransaction
method on a relevant adapter. This takes the same parameters, although it requires passing the publicAddress
of the targeted user for the transaction.
signAndSendTransaction
, you can use quickSendTransaction
to batch multiple transactions together within a single UserOperation. quickSendTransaction
requires the following parameters:
transactions
, an array of stringified transaction objects.feeMode
, the mechanism for paying gas fees.messageSigner
, the owner/Signer address that’ll be signing the UserOperation.callback
, return handling.Methods | Parameters |
---|---|
rpcGetSmartAccount | addresses: List<String> |
rpcGetFeeQuotes | eoaAddress: String, transactions: List<PrefixedHexString> |
rpcCreateUserPaidTransaction | eoaAddress: String, transactions: List<PrefixedHexString> , erc4337FeeQuote: Erc4337FeeQuote |
rpcSendUserPaidTransaction | eoaAddress: String, walletTransaction: WalletTransaction, signature: String |
rpcSendGaslessTransaction | eoaAddress: String, userOp: WalletUserOp, signature: String |
rpcCreateGaslessTransaction | eoaAddress: String, transactions: List<PrefixedHexString> |
isDeploy | eoaAddress: String |
deployWalletContract | messageSigner: MessageSigner, feeMode: FeeMode* |
isAAModeEnable | |
enableAAMode | |
disableAAMode | |
getSmartAccount | eosAddress: String |
getSmartAccountSync | eosAddress: String |
getSmartAddress | eosAddress: String |
getSmartAccounts | eosAddresses: List<String> |
isSupportChainInfo | chainInfo: ChainInfo |
getSupportChainInfos | |
quickSendTransaction | transactions: String, feeMode: FeeMode\*, messageSigner: MessageSigner, sendCallback: WebServiceCallback<SignOutput> * |
quickSendTransaction | transactions: List<String> , feeMode: FeeMode*, messageSigner: MessageSigner, sendCallback: WebServiceCallback<SignOutput> * |