-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Local and Ledger wallet support #167
Changes from 2 commits
d28596c
24ce383
cd63773
eeda75e
ec4dd1f
3a2cf11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { Result } from '@chainlink/gauntlet-core' | ||
import { logger } from '@chainlink/gauntlet-core/dist/utils' | ||
import { SolanaCommand, TransactionResponse } from '@chainlink/gauntlet-solana' | ||
import { Message, Transaction } from '@solana/web3.js' | ||
import { CONTRACT_LIST } from '@chainlink/gauntlet-solana-contracts' | ||
|
||
export default class SendRawTx extends SolanaCommand { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm, why is this part of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. Was there for testing purposes only |
||
static id = 'send_tx' | ||
static category = CONTRACT_LIST.MULTISIG | ||
|
||
static examples = ['yarn gauntlet-serum-multisig send_tx --network=local --data=MULTISIG_ACCOUNT'] | ||
|
||
constructor(flags, args) { | ||
super(flags, args) | ||
|
||
this.requireFlag('message', 'Include a base64 encoded message') | ||
this.requireFlag('signature', 'Include a base58 encoded signature') | ||
} | ||
|
||
execute = async () => { | ||
const msg = Message.from(Buffer.from(this.flags.message, 'base64')) | ||
const signature = this.flags.signature | ||
|
||
logger.log('Message', msg) | ||
logger.log('Signature:', signature) | ||
const transaction = Transaction.populate(msg, [signature]) | ||
|
||
logger.log('TRANSACTION:', transaction) | ||
|
||
logger.log('Sending tx...') | ||
const txHash = await this.provider.connection.sendRawTransaction(transaction.serialize()) | ||
|
||
logger.log(txHash) | ||
return { | ||
responses: [ | ||
{ | ||
tx: this.wrapResponse(txHash, ''), | ||
contract: '', | ||
}, | ||
], | ||
} as Result<TransactionResponse> | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not executing but preparing a rawTx for a specific signer - Do we even need this functionality anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need it