Skip to content

Commit

Permalink
Add send BoC return hash method to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
rabm2k7 committed Jul 11, 2024
1 parent 76dfd07 commit 66ddbce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
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) {
return this.send("sendBocReturnHash", {'boc': base64});
};

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

0 comments on commit 66ddbce

Please sign in to comment.