eliza
eliza copied to clipboard
feat: implement coinbase mass payments across base/sol/eth/pol/arb
Relates to:
Issue: Ensure dynamic parsing, validation, and execution for mass payouts using Coinbase SDK.
Risks
Risk Level: Medium
- Impact on transaction accuracy due to potential mapping mismatches between CSV headers and object fields.
- Dependencies on external Coinbase SDK stability.
Background
What does this PR do?
This PR implements dynamic mass payout capabilities using the Coinbase SDK. Key updates include:
- Parsing
transferTemplatedetails to dynamically construct transactions for processing. - Validating input parameters (e.g.,
receivingAddresses,network) to ensure they comply with supported formats and networks. - Appending all processed transactions (successes and failures) to a CSV file dynamically created in
src/plugins/transactions.csv. - Generating wallet details dynamically if not already present.
- If a wallet is not pre-configured:
- A new wallet is generated and saved to
characters/charactername.character.jsonundersettings.secrets. - If the character file does not exist, the wallet details are saved to a
character-seed.txtfile, and a note is added to move these details manually to the character's settings or environment variables.
- A new wallet is generated and saved to
What kind of change is this?
Improvements: Adds dynamic appending and parsing of CSV data.
Features: Introduces mass payouts using Coinbase SDK for supported networks.
Documentation changes needed?
Yes. The changes require an update to project documentation to reflect:
- New
transferTemplatestructure for mass payouts. - Supported networks (
base,sol,eth,arb,pol). - Steps to validate environment variables for
COINBASE_API_KEYandCOINBASE_PRIVATE_KEY. - Guidance for handling dynamically generated wallets (e.g., adding details from
character-seed.txttosettings.secretsor.env).
Testing
Where should a reviewer start?
massPayoutProvider.getfunction for dynamic parsing and handling of CSV records.executeMassPayoutlogic for sequential processing of transactions.- Integration of Coinbase SDK for wallet initialization and balance checks.
Detailed testing steps
-
Setup Environment Variables:
- Ensure
COINBASE_API_KEYandCOINBASE_PRIVATE_KEYare set in the.envfile or runtime settings.
- Ensure
-
Process Mass Payout Transactions:
- Execute a payout request using the
SEND_MASS_PAYOUTaction. - Validate successful transactions are logged in the CSV file.
- Execute a payout request using the
-
Wallet Generation:
- Remove
COINBASE_GENERATED_WALLET_HEX_SEEDandCOINBASE_GENERATED_WALLET_IDfrom your configuration. - Verify that a new wallet is created and stored in
characters/charactername.character.jsonundersettings.secrets. - If the character file does not exist, confirm that the wallet details are written to
charactername-seed.txtwith instructions to move them manually.
- Remove
-
Validate Edge Cases:
- Process invalid addresses.
- Handle insufficient wallet balances.
- Verify proper CSV appending and transaction updates.
Screenshots
https://drive.google.com/file/d/160rreXAoKBj9db8lIMjF5LW8EmAihQmi/view?usp=sharing
After
- Dynamic CSV appending:
Address,Amount,Status,Error Code,Transaction URL
0xA0ba2ACB5846A54834173fB0DD9444F756810f06,0.0001,Success,,https://basescan.org/tx/0x420332...
0xF14F2c49aa90BaFA223EE074C1C33b59891826bF,0.0001,Failed,Insufficient Funds,
Screen Recording:
Deploy Notes
- Verify CSV file path in
src/plugins/transactions.csvis accessible. - Ensure wallet initialization works seamlessly for networks without pre-generated wallet details.
Database changes
- None.
Deployment instructions
- Deploy as part of the next release cycle.
- Monitor logs for unexpected behaviors during payout execution.
- Validate that all necessary environment variables are set and accessible.
- Ensure new wallets are properly stored or manually moved to character configurations.
[Discord](https://discord.gg/ai16z) username
0x8664