Skip to content

Commit

Permalink
Address useful methods
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzaycev committed May 22, 2024
1 parent 31afedb commit cbcb5a2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/Olifanton/Interop/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,24 @@ public function toString(?bool $isUserFriendly = null,
return $addressBase64;
}

public function asWallet(): string
{
return $this->toString(
isUserFriendly: true,
isUrlSafe: true,
isBounceable: false,
);
}

public function asContract(): string
{
return $this->toString(
isUserFriendly: true,
isUrlSafe: true,
isBounceable: true,
);
}

/**
* Returns Workchain ID.
*
Expand Down Expand Up @@ -210,6 +228,11 @@ public static function isValid(string | Address $address): bool
}
}

public static function zero(): self
{
return new self("UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ");
}

#[ArrayShape([
'isTestOnly' => "bool",
'isBounceable' => "bool",
Expand Down

0 comments on commit cbcb5a2

Please sign in to comment.