Skip to content

Commit

Permalink
fix: add types to invoke raw script
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardojrmcom committed Sep 12, 2022
1 parent 318ee14 commit dc3aa1c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@ricardojrmcom/use-phantasma-link",
"description": "React hook for PhantasmaLink",
"version": "0.0.3-development",
"version": "0.0.4-development",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"private": false,
Expand Down
18 changes: 9 additions & 9 deletions src/phantasmaLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ export class PhantasmaLink {
}

invokeRawScript(
chain,
script,
payload,
callback,
chain: string,
script: string,
payload: string | null,
callback: () => any,
platform = 'phantasma',
signature = 'Ed25519',
) {
if (!this.socket) {
callback('not logged in');
console.warning('not logged in');
return;
}
if (script.length >= 8192) {
Expand All @@ -60,7 +60,7 @@ export class PhantasmaLink {
sb.appendBytes(bytes);
payload = sb.script;
} else {
alert('invalid payload, sorry :(');
console.warning('invalid payload, sorry :(');
return;
}

Expand Down Expand Up @@ -158,7 +158,7 @@ export class PhantasmaLink {
}
this.sendLinkRequest('signData/' + data + '/1', function (result) {
if (result.success) {
// alertbox.show('Data successfully signed')
// console.warningbox.show('Data successfully signed')
that.onMessage('Data successfully signed');

if (callback) {
Expand Down Expand Up @@ -354,7 +354,7 @@ function PavillionLink() {

this.sendTransaction = (nexus, chain, script, payload, callback) => {
if (script.length >= 8192) {
alert('script too big, sorry :(');
console.warning('script too big, sorry :(');
return; // TODO callback with error
}

Expand All @@ -368,7 +368,7 @@ function PavillionLink() {
// then we convert the bytes into hex, because thats what PhantasmaLink protocol expects
payload = sb.script;
} else {
alert('invalid payload, sorry :(');
console.warning('invalid payload, sorry :(');
return; // TODO callback with error
}
this.onSignAndSubmit = callback;
Expand Down

1 comment on commit dc3aa1c

@vercel
Copy link

@vercel vercel bot commented on dc3aa1c Sep 12, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.