Skip to content
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

Support of ExtensionOptions in SigningStargateCilent signing #1544

Open
whalelephant opened this issue Jan 16, 2024 · 3 comments
Open

Support of ExtensionOptions in SigningStargateCilent signing #1544

whalelephant opened this issue Jan 16, 2024 · 3 comments

Comments

@whalelephant
Copy link

Currently the sign function does not have argument for ExtensionOptions data and therefore users requiring such field to be non null must write their own functions such as SendTokens etc.

It would be good to have an optional field to propagate ExtensionOptions for transactions.

@ANSHTYAGI7
Copy link

can you please assign this issue to me

@ANSHTYAGI7
Copy link

import { ExtensionOptions } from 'The liabrary of extensions'

public async sign(
signerAddress: string,
messages: readonly EncodeObject[],
fee: StdFee,
memo: string,
explicitSignerData?: SignerData,
timeoutHeight?: bigint,
extensionOptions?: ExtensionOptions, // Add an optional parameter for ExtensionOptions
): Promise {
let signerData: SignerData;
if (explicitSignerData) {
signerData = explicitSignerData;
} else {
const { accountNumber, sequence } = await this.getSequence(signerAddress);
const chainId = await this.getChainId();
signerData = {
accountNumber: accountNumber,
sequence: sequence,
chainId: chainId,
};
}

return isOfflineDirectSigner(this.signer)
    ? this.signDirect(signerAddress, messages, fee, memo, signerData, timeoutHeight, extensionOptions)
    : this.signAmino(signerAddress, messages, fee, memo, signerData, timeoutHeight, extensionOptions);

}

@ANSHTYAGI7
Copy link

you can tell me enhancements to do Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants