Current implementation: shambhala.client.js
Example usage: shambhala.testing.js
-
Class definition.
interface Options: { token?: string; } class Shambhala { constructor (url: string, opts?: Options) }
-
Invocation.
let shambhala = new Shambhala("https://secrets.example.com/", { token: "jwt.io.token" })
-
Generate account. Returns a
string
with anaccount id
(G_PUBLIC
).async function generateAddress (): Promise<string>
-
Associate account. Returns a
string
with anaccount id
(G_PUBLIC
).async function associateAddress (accountId: string): Promise<string>
-
Generate set of signing keys for a given
account id
. Returns object withC_PUBLIC
andS_PUBLIC
.async function generateSigningKeys (accountId: string): Promise<object>
-
Generate signed key association transaction, ready to be submitted to the stellar network. If such transaction can't be generated an exception is thrown. This operation can be invoked maximum once.
async function generateSignedKeyAssocTX ( accountId: string, sequence: string, networkPassphrase: string ): Promise<string> // b64-encoded TransactionEnvelope XDR
-
Generate key association transaction. This transaction has to be signed with an appropriate
SECRET
before it can be sent to the stellar network.async function generateKeyAssocTX ( accountId: string, sequence: string, networkPassphrase: string ): Promise<string> // b64-encoded TransactionEnvelope XDR
-
Returns
true
if transaction can be signed on behalf of anaccount id
,false
otherwise.async function canSignFor (accountId: string): Promise<boolean>
-
On behalf of an
account id
sign a giventransaction
(provided asStellarSDK.xdr.TransactionSignaturePayload
). Returns array of base64-encodedStellarSDK.xdr.Signature
.async function signTransaction ( accountId: string, tspXDR: Uint8Array ): Promise<Array>
-
Asks for an encrypted backup for a given
account id
. Returns base64-encoded, encrypted contents of the shambhala-web-storage structures.async function backup (accountId: string): Promise<string>
-
Request restoring of shambhala-web-storage structures contents from a given
payload
for a givenaccount id
.async function restore ( accountId: string, backup: string ): Promise<object>
-
Get shambhala library version.
async function getLibVersion (): Promise<string>
-
Get shambhala instance version.
async function getVersion (): Promise<string>
-
Get associated
public keys
for a givenaccount id
. Returnsobject
with fieldsG_PUBLIC
,C_PUBLIC
,S_PUBLIC
or throws an error.async function getPublicKeys (accountId: string): Promise<object>
-
Open shambhala window.
async function open (): Promise<object>
-
Close shambhala window. Also destroy shambhala instance. After this call no operation can be performed on a current instance - in such case constructor call is necessary.
async function close (): Promise<boolean>
-
Cancel current operation.
async function cancel (): Promise<boolean>
-
Check if shambhala is up-and-running. Open its window if necessary.
async function ping (): Promise<boolean>