Skip to content

Commit

Permalink
add urltosafe for deeplink
Browse files Browse the repository at this point in the history
  • Loading branch information
doronaviguy committed Jan 30, 2023
1 parent 063211d commit 4ee2a6c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion scripts/ts/change-validator-deeplink.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Address, beginCell, toNano } from "ton";
import { toUrlSafe } from "./utils";
const ZERO_ADDR = '-1:0000000000000000000000000000000000000000000000000000000000000000';


function buildSetValidatorMessage(newValidator: Address) {
return encodeURIComponent(beginCell().storeUint(0x1001 ,32).storeUint(1, 64).storeAddress(newValidator).endCell().toBoc({idx: false}).toString("base64"));
return toUrlSafe(beginCell().storeUint(0x1001 ,32).storeUint(1, 64).storeAddress(newValidator).endCell().toBoc({idx: false}).toString("base64"));
}

export function changeValidator(nominator: Address, newValidator: Address) : string {
Expand Down
4 changes: 3 additions & 1 deletion scripts/ts/withdraw-deeplink.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import BN from "bn.js";
import { Address, beginCell, toNano } from "ton";
import { toUrlSafe } from "./utils";


function buildWithdrawMessage(amount: BN) {
return beginCell().storeUint(0x1000 ,32).storeUint(1, 64).storeCoins(amount).endCell().toBoc({idx: false}).toString("base64");
let bocStr = beginCell().storeUint(0x1000 ,32).storeUint(1, 64).storeCoins(amount).endCell().toBoc({idx: false}).toString("base64");
return toUrlSafe(bocStr);
}

export function withdrawDeepLink(snominator: Address, amount: BN) : string {
Expand Down

0 comments on commit 4ee2a6c

Please sign in to comment.