UnisatSigner
scrypt-ts-opcat / UnisatSigner
Class: UnisatSigner
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:29
a [signer][https://docs.opcatlabs.io/how-to-deploy-and-call-a-contract/#signer](https://docs.opcatlabs.io/how-to-deploy-and-call-a-contract/#signer) which implemented the protocol with the [Unisat wallet][https://unisat.io](https://unisat.io), and dapps can use to interact with the Unisat wallet
Implements
Constructors
new UnisatSigner()
new UnisatSigner(
unisat
):UnisatSigner
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:32
Parameters
unisat
Returns
Methods
getAddress()
getAddress():
Promise
\<string
>
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:54
Gets the address from the Unisat wallet API.
Returns
Promise
\<string
>
A promise that resolves to the first account address string.
Implementation of
getPublicKey()
getPublicKey():
Promise
\<string
>
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:63
Retrieves the public key from the Unisat wallet API.
Returns
Promise
\<string
>
A promise that resolves to the public key as a string.
Implementation of
getUnisatAPI()
getUnisatAPI():
UnisatAPI
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:41
Retrieves the Unisat API instance from either the cached property or global window object.
Returns
The Unisat API instance.
Throws
If Unisat API is not available (not installed).
signPsbt()
signPsbt(
psbtHex
,options
?):Promise
\<string
>
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:74
Signs a PSBT (Partially Signed Opcat Transaction) using the Unisat wallet API.
Parameters
psbtHex
string
The PSBT in hexadecimal format to be signed.
options?
Optional signing options (e.g., specific inputs to sign).
Returns
Promise
\<string
>
A Promise resolving to the signed PSBT in hexadecimal format.
Implementation of
signPsbts()
signPsbts(
reqs
):Promise
\<string
[]>
Defined in: packages/scrypt-ts-opcat/src/signers/unisatSigner.ts:84
Signs multiple PSBTs (Partially Signed Opcat Transactions) using the Unisat wallet API.
Parameters
reqs
object
[]
Array of objects containing PSBT hex strings and optional signing options
Returns
Promise
\<string
[]>
Promise resolving to an array of signed PSBT hex strings