Skip to content

Commit

Permalink
fix: add address alias for principal
Browse files Browse the repository at this point in the history
  • Loading branch information
janniks committed Nov 2, 2023
1 parent 62fdb43 commit bd96bb5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/transactions/src/cl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,21 @@ export function principal(address: string) {
const [addr, name] = address.split('.');
return name ? contractPrincipalCV(addr, name) : standardPrincipalCV(addr);
}
/**
* `Cl.address` — Creates a Clarity principal type, represented as a JS object
* @param address - A Stacks address (optionally with a contract name in the string)
*
* Alias for {@link principal | `Cl.principal`}
*
* @example
* ```
* import { Cl } from '@stacks/transactions';
* Cl.address('ST000000000000000000002AMW42H');
* Cl.address('ST000000000000000000002AMW42H.asset');
* ```
* @see {@link serialize}, {@link deserialize}
*/
export const address = principal;
/**
* `Cl.contractPrincipal` — Creates a Clarity contract `principal` type, represented as a JS object
*
Expand Down

0 comments on commit bd96bb5

Please sign in to comment.