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

Add send BoC return hash method to provider #199

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/contract/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,12 @@ class Contract {
getQuery: async () => {
return (await queryPromise).message;
},
send: async () => {
send: async (returnHash = false) => {
const query = await queryPromise;
const boc = bytesToBase64(await query.message.toBoc(false));
if (returnHash) {
return provider.sendBocReturnHash(boc);
}
return provider.sendBoc(boc);
},
estimateFee: async () => {
Expand Down
9 changes: 9 additions & 0 deletions src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ class HttpProvider {
return this.send("sendBoc", {'boc': base64});
};

/**
* Use this method to send serialized boc file: fully packed and serialized external message.
* @param base64 {string} base64 of boc bytes Cell.toBoc
* @return Object containing result, error, code
*/
async sendBocReturnHash(base64) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rabm2k7:improvement/add-send-boc-return-hash

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 month later; still waiting on a merge 😮‍💨

return this.send("sendBocReturnHash", {'boc': base64});
};

/**
* @deprecated
* Send external message
Expand Down