@turnkey/http
’s TurnkeyClient
Creating a stamper inserts an iframe in the current page.
new IframeStamper(Defined in: iframe-stamper/dist/index.d.ts:76 Creates a new iframe stamper. This function does not insert the iframe in the DOM. Callconfig
):IframeStamper
.init()
to insert the iframe element in the DOM.
TIframeStamperConfig
IframeStamper
container: HTMLElement
Defined in: iframe-stamper/dist/index.d.ts:66
iframe: HTMLIFrameElement
Defined in: iframe-stamper/dist/index.d.ts:67
iframeOrigin: string
Defined in: iframe-stamper/dist/index.d.ts:68
iframePublicKey:Defined in: iframe-stamper/dist/index.d.ts:69null
|string
messageChannel: MessageChannel
Defined in: iframe-stamper/dist/index.d.ts:70
applySettings(Defined in: iframe-stamper/dist/index.d.ts:160 Function to apply settings on allowed parameters in the iframe This is used to style the HTML element used for plaintext in wallet and private key import.settings
):Promise
<boolean
>
TIframeSettings
Promise
<boolean
>
clear(): void
Defined in: iframe-stamper/dist/index.d.ts:86
Removes the iframe from the DOM
void
clearEmbeddedKey():Defined in: iframe-stamper/dist/index.d.ts:99 Clears the embedded key within an iframe.Promise
<null
>
Promise
<null
>
extractKeyEncryptedBundle(Defined in: iframe-stamper/dist/index.d.ts:155 Function to extract an encrypted bundle from the iframe The bundle should be encrypted to Turnkey’s Signer enclave’s initial public key Encryption should be performed with HPKE (RFC 9180). The key format to encode the private key in before it’s encrypted and imported: HEXADECIMAL or SOLANA. Defaults to HEXADECIMAL. This is used during the private key import flow.keyFormat
?):Promise
<string
>
KeyFormat
Promise
<string
>
extractWalletEncryptedBundle():Defined in: iframe-stamper/dist/index.d.ts:147 Function to extract an encrypted bundle from the iframe The bundle should be encrypted to Turnkey’s Signer enclave’s initial public key Encryption should be performed with HPKE (RFC 9180). This is used during the wallet import flow.Promise
<string
>
Promise
<string
>
getEmbeddedPublicKey():Defined in: iframe-stamper/dist/index.d.ts:95 Returns the public key, orPromise
<null
|string
>
null
if the underlying iframe isn’t properly initialized.
This differs from the above in that it reaches out to the live iframe to see if an embedded key exists.
Promise
<null
| string
>
init(Defined in: iframe-stamper/dist/index.d.ts:82 Inserts the iframe on the page and returns a promise resolving to the iframe’s public keydangerouslyOverrideIframeKeyTtl
?):Promise
<string
>
number
Optional TTL override for the iframe’s embedded key (default 48 hours). Only use this if you are intentional about the security implications.
Promise
<string
>
initEmbeddedKey():Defined in: iframe-stamper/dist/index.d.ts:106 Creates a new embedded key within an iframe. If an embedded key already exists, this will return it. This is primarily to be used in conjunction withPromise
<null
|string
>
clearEmbeddedKey()
: after an embedded key is cleared,
this can be used to create a new one.
Promise
<null
| string
>
the newly created embedded public key.
injectCredentialBundle(Defined in: iframe-stamper/dist/index.d.ts:120 Function to inject a new credential into the iframe The bundle should be encrypted to the iframe’s initial public key Encryption should be performed with HPKE (RFC 9180). This is used during recovery and auth flows.bundle
):Promise
<boolean
>
string
Promise
<boolean
>
injectImportBundle(Defined in: iframe-stamper/dist/index.d.ts:140 Function to inject an import bundle into the iframe This is used to initiate either the wallet import flow or the private key import flow.bundle
,organizationId
,userId
):Promise
<boolean
>
string
string
string
Promise
<boolean
>
injectKeyExportBundle(Defined in: iframe-stamper/dist/index.d.ts:128 Function to inject an export bundle into the iframe The bundle should be encrypted to the iframe’s initial public key Encryption should be performed with HPKE (RFC 9180). The key format to encode the private key in after it’s exported and decrypted: HEXADECIMAL or SOLANA. Defaults to HEXADECIMAL. This is used during the private key export flow.bundle
,organizationId
,keyFormat
?):Promise
<boolean
>
string
string
KeyFormat
Promise
<boolean
>
injectWalletExportBundle(Defined in: iframe-stamper/dist/index.d.ts:135 Function to inject an export bundle into the iframe The bundle should be encrypted to the iframe’s initial public key Encryption should be performed with HPKE (RFC 9180). This is used during the wallet export flow.bundle
,organizationId
):Promise
<boolean
>
string
string
Promise
<boolean
>
onMessageHandler(Defined in: iframe-stamper/dist/index.d.ts:77event
):void
MessageEvent
void
publicKey():Defined in: iframe-stamper/dist/index.d.ts:90 Returns the public key, ornull
|string
null
if the underlying iframe isn’t properly initialized.
null
| string
stamp(Defined in: iframe-stamper/dist/index.d.ts:164 Function to sign a payload with the underlying iframepayload
):Promise
<TStamp
>
string
Promise
<TStamp
>