Skip to content

Commit 183a5cc

Browse files
committed
chore: branded type to smart wallet address
1 parent d98011a commit 183a5cc

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/programmable-tokens/offchain/offchain.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ export class ProgrammableTokenContract extends MeshTxInitiator {
535535
};
536536

537537
blacklistSmartWalletAddress = async (
538-
targetSmartWalletAddress: smartWalletAddress,
538+
smartWalletAddress: smartWalletAddress,
539539
): Promise<string> => {
540540
const fetcher = this.fetcher;
541541
const wallet = this.wallet;
@@ -566,7 +566,7 @@ export class ProgrammableTokenContract extends MeshTxInitiator {
566566
);
567567
if (!blacklistUtxos?.length) throw new Error("No blacklist UTxOs found");
568568

569-
const targetStakeHash = resolveStakeCredential(targetSmartWalletAddress);
569+
const targetStakeHash = resolveStakeCredential(smartWalletAddress);
570570

571571
let nodeToReplace: UTxO | null = null;
572572
let preexistingNode: BlacklistDatum | null = null;
@@ -746,10 +746,10 @@ export class ProgrammableTokenContract extends MeshTxInitiator {
746746

747747
seizeToken = async (
748748
unit: string,
749-
utxoTxHash: string,
750-
utxoOutputIndex: number,
751-
recipientSmartWallet: smartWalletAddress,
749+
txHash: string,
750+
outputIndex: number,
752751
issuerAdminPkh: string,
752+
recipientSmartWallet: smartWalletAddress,
753753
): Promise<string> => {
754754
const params = this._params;
755755
const fetcher = this.fetcher;

src/programmable-tokens/offchain/type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { PlutusScript } from "@meshsdk/common";
22

3-
export type smartWalletAddress = string;
3+
export type smartWalletAddress = string & { readonly __brand: "SmartWalletAddress" };
44

5-
export type stakeCredential = string;
5+
export type stakeCredential = string & { readonly __brand: "StakeCredential" };
66

77
export type BlacklistDatum = {
88
key: string;

0 commit comments

Comments
 (0)