Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add entryFunctionPayload in txParams for Dapps to sendUncheckedTransa…
…ction in Aptos networks
  • Loading branch information
wk3368 committed Nov 18, 2022
1 parent bcb15ba commit 38def70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/providers/jsonrpc-provider.ts
Expand Up @@ -366,7 +366,14 @@ export class JsonRpcSigner extends Signer {
// }

const allowedTransactionKeys: { [key: string]: boolean } = {
chainId: true, data: true, gasLimit: true, gasPrice: true, nonce: true, to: true, value: true
chainId: true,
data: true,
entryFunctionPayload: true,
gasLimit: true,
gasPrice: true,
nonce: true,
to: true,
value: true,
}
export class JsonRpcProvider extends BaseProvider {
readonly connection: ConnectionInfo;
Expand Down Expand Up @@ -794,6 +801,11 @@ export class JsonRpcProvider extends BaseProvider {
result[key] = hexlify((<any>transaction)[key]);
});

["entryFunctionPayload"].forEach(function (key) {
if ((<any>transaction)[key] == null) { return; }
result[key] = (<any>transaction)[key];
});

return result;
}
}
7 changes: 7 additions & 0 deletions src/types/index.ts
Expand Up @@ -327,6 +327,13 @@ export interface TransactionRequest {
expiredSecs?: U64;
addGasBufferMultiplier?: U8;

entryFunctionPayload?: {
type?: string,
function: string,
type_arguments: Array<string>,
arguments: Array<any>,
};

sender?: AccountAddress;
sender_public_key?: HexString;
sequence_number?: U64;
Expand Down

0 comments on commit 38def70

Please sign in to comment.