interface WalletApi { address.get: (() => Promise<`ak_${string}`[]>); address.subscribe: ((p) => Promise<{ address: Accounts; subscription: ("connected" | "current")[]; }>); connection.close: ((p) => void); connection.open: ((p) => Promise<WalletInfo & { node?: Node; }>); data.unsafeSign: ((p) => Promise<{ signature: `sg_${string}`; }>); delegation.sign: ((p) => Promise<{ signature: `sg_${string}`; }>); delegationToContract.sign: ((p) => Promise<{ signature: `sg_${string}`; }>); message.sign: ((p) => Promise<{ signature: string; }>); transaction.sign: ((p) => Promise<{ signedTransaction?: `tx_${string}`; transactionHash?: Partial<{ blockHash: string; blockHeight: number; encodedTx?: string; hash: string; signatures: string[]; tx: { abiVersion?: string; accountId?: string; amount?: bigint; authData?: string; authFun?: string; callData?: string; callerId?: string; channelId?: string; channelReserve?: bigint; clientTtl?: number; code?: string; commitmentId?: string; contractId?: string; delegateIds?: { initiator?: (...
) | (...
); responder?: (...
) | (...
); }; deposit?: bigint; fee: bigint; fromId?: string; gaId?: string; gas?: number; gasPrice?: bigint; initiatorAmount?: bigint; initiatorAmountFinal?: bigint; initiatorDelegateIds?: string[]; initiatorId?: string; lockPeriod?: string; name?: string; nameFee?: bigint; nameId?: string; nameSalt?: number; nameTtl?: number; nonce?: number; offchainTrees?: string; oracleId?: string; oracleTtl?: { type: "delta"; value: string; }; ownerId?: string; payerId?: string; payload?: string; poi?: string; pointers?: { id: ...
; key: ...
; }[]; query?: string; queryFee?: bigint; queryFormat?: string; queryId?: string; queryTtl?: { type: TTLType; value: string; }; recipientId?: string; responderAmount?: bigint; responderAmountFinal?: bigint; responderDelegateIds?: string[]; responderId?: string; response?: string; responseFormat?: string; responseTtl?: { type: "delta"; value: string; }; round?: number; senderId?: string; stateHash?: string; toId?: string; ttl?: number; tx?: { tx: { recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 54 more ...; type: TxType; }; ... 4 more ...; signatures: string[]; }
; type: TxType; update?: { op: (...
) | (...
) | (...
) | (...
) | (...
); } | { amount: bigint; from: string; op: "OffChainTransfer"; to: string; } | { amount: bigint; op: "OffChainWithdrawal"; to: string; } | { amount: bigint; from: string; op: "OffChainDeposit"; } | { abiVersion: string; callData: string; code: { bytecode: ...
; }; deposit: bigint; op: "OffChainNewContract"; owner: string; vmVersion: string; } | { abiVersion: string; amount: bigint; callData: string; caller: string; contract: string; gas: number; gasPrice: bigint; op: "OffChainCallContract"; }; version: number; vmVersion?: string; }; }> & { hash: `th_${string}`; rawTx: `tx_${string}`; }; }>); typedData.sign: ((p) => Promise<{ signature: `sg_${string}`; }>); } Properties
address.get
address.get: (() => Promise<`ak_${string}`[]>)
Type declaration
- (): Promise<`ak_${string}`[]>
Returns Promise<`ak_${string}`[]>
address.subscribe
address.subscribe: ((p) => Promise<{ address: Accounts; subscription: ("connected" | "current")[]; }>) Type declaration
- (p): Promise<{
address: Accounts;
subscription: ("connected" | "current")[];
}> Parameters
- p: {
type: SUBSCRIPTION_TYPES;
value: "connected" | "current";
}value: "connected" | "current"
Returns Promise<{
address: Accounts;
subscription: ("connected" | "current")[];
}>
connection.close
connection.close: ((p) => void)
connection.open
Type declaration
- (p): Promise<WalletInfo & {
node?: Node;
}> Parameters
- p: {
connectNode: boolean;
icons?: Icons;
name: string;
version: 1;
}connectNode: boolean
Optional
icons?: Icons
name: string
version: 1
Returns Promise<WalletInfo & {
node?: Node;
}>
data.unsafeSign
data.unsafeSign: ((p) => Promise<{
signature: `sg_${string}`;
}>)
Type declaration
- (p): Promise<{
signature: `sg_${string}`;
}> Parameters
- p: {
data: `ba_${string}`;
onAccount: `ak_${string}`;
}data: `ba_${string}`
onAccount: `ak_${string}`
Returns Promise<{
signature: `sg_${string}`;
}>
delegation.sign
delegation.sign: ((p) => Promise<{
signature: `sg_${string}`;
}>)
Type declaration
- (p): Promise<{
signature: `sg_${string}`;
}> Parameters
- p: {
delegation: `ba_${string}`;
onAccount: `ak_${string}`;
}delegation: `ba_${string}`
onAccount: `ak_${string}`
Returns Promise<{
signature: `sg_${string}`;
}>
delegationToContract.sign
delegationToContract.sign: ((p) => Promise<{
signature: `sg_${string}`;
}>)
Type declaration
- (p): Promise<{
signature: `sg_${string}`;
}> Parameters
- p: {
allNames?: boolean;
contractAddress: `ct_${string}`;
isOracle?: boolean;
name?: `${string}.chain`;
onAccount: `ak_${string}`;
oracleQueryId?: `oq_${string}`;
}Optional
allNames?: boolean
contractAddress: `ct_${string}`
Optional
isOracle?: boolean
Optional
name?: `${string}.chain`
onAccount: `ak_${string}`
Optional
oracleQueryId?: `oq_${string}`
Returns Promise<{
signature: `sg_${string}`;
}>
message.sign
message.sign: ((p) => Promise<{
signature: string;
}>)
Type declaration
- (p): Promise<{
signature: string;
}> Parameters
- p: {
message: string;
onAccount: `ak_${string}`;
}message: string
onAccount: `ak_${string}`
Returns Promise<{
signature: string;
}>
transaction.sign
transaction.sign: ((p) => Promise<{ signedTransaction?: `tx_${string}`; transactionHash?: Partial<{ blockHash: string; blockHeight: number; encodedTx?: string; hash: string; signatures: string[]; tx: { abiVersion?: string; accountId?: string; amount?: bigint; authData?: string; authFun?: string; callData?: string; callerId?: string; channelId?: string; channelReserve?: bigint; clientTtl?: number; code?: string; commitmentId?: string; contractId?: string; delegateIds?: { initiator?: (...
) | (...
); responder?: (...
) | (...
); }; deposit?: bigint; fee: bigint; fromId?: string; gaId?: string; gas?: number; gasPrice?: bigint; initiatorAmount?: bigint; initiatorAmountFinal?: bigint; initiatorDelegateIds?: string[]; initiatorId?: string; lockPeriod?: string; name?: string; nameFee?: bigint; nameId?: string; nameSalt?: number; nameTtl?: number; nonce?: number; offchainTrees?: string; oracleId?: string; oracleTtl?: { type: "delta"; value: string; }; ownerId?: string; payerId?: string; payload?: string; poi?: string; pointers?: { id: ...
; key: ...
; }[]; query?: string; queryFee?: bigint; queryFormat?: string; queryId?: string; queryTtl?: { type: TTLType; value: string; }; recipientId?: string; responderAmount?: bigint; responderAmountFinal?: bigint; responderDelegateIds?: string[]; responderId?: string; response?: string; responseFormat?: string; responseTtl?: { type: "delta"; value: string; }; round?: number; senderId?: string; stateHash?: string; toId?: string; ttl?: number; tx?: { tx: { recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 54 more ...; type: TxType; }; ... 4 more ...; signatures: string[]; }
; type: TxType; update?: { op: (...
) | (...
) | (...
) | (...
) | (...
); } | { amount: bigint; from: string; op: "OffChainTransfer"; to: string; } | { amount: bigint; op: "OffChainWithdrawal"; to: string; } | { amount: bigint; from: string; op: "OffChainDeposit"; } | { abiVersion: string; callData: string; code: { bytecode: ...
; }; deposit: bigint; op: "OffChainNewContract"; owner: string; vmVersion: string; } | { abiVersion: string; amount: bigint; callData: string; caller: string; contract: string; gas: number; gasPrice: bigint; op: "OffChainCallContract"; }; version: number; vmVersion?: string; }; }> & { hash: `th_${string}`; rawTx: `tx_${string}`; }; }>) Type declaration
- (p): Promise<{
signedTransaction?: `tx_${string}`;
transactionHash?: Partial<{
blockHash: string;
blockHeight: number;
encodedTx?: string;
hash: string;
signatures: string[];
tx: {
abiVersion?: string;
accountId?: string;
amount?: bigint;
authData?: string;
authFun?: string;
callData?: string;
callerId?: string;
channelId?: string;
channelReserve?: bigint;
clientTtl?: number;
code?: string;
commitmentId?: string;
contractId?: string;
delegateIds?: {
initiator?: (...) | (...);
responder?: (...) | (...);
};
deposit?: bigint;
fee: bigint;
fromId?: string;
gaId?: string;
gas?: number;
gasPrice?: bigint;
initiatorAmount?: bigint;
initiatorAmountFinal?: bigint;
initiatorDelegateIds?: string[];
initiatorId?: string;
lockPeriod?: string;
name?: string;
nameFee?: bigint;
nameId?: string;
nameSalt?: number;
nameTtl?: number;
nonce?: number;
offchainTrees?: string;
oracleId?: string;
oracleTtl?: {
type: "delta";
value: string;
};
ownerId?: string;
payerId?: string;
payload?: string;
poi?: string;
pointers?: {
id: ...;
key: ...;
}[];
query?: string;
queryFee?: bigint;
queryFormat?: string;
queryId?: string;
queryTtl?: {
type: TTLType;
value: string;
};
recipientId?: string;
responderAmount?: bigint;
responderAmountFinal?: bigint;
responderDelegateIds?: string[];
responderId?: string;
response?: string;
responseFormat?: string;
responseTtl?: {
type: "delta";
value: string;
};
round?: number;
senderId?: string;
stateHash?: string;
toId?: string;
ttl?: number;
tx?: { tx: { recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 54 more ...; type: TxType; }; ... 4 more ...; signatures: string[]; };
type: TxType;
update?: {
op: (...) | (...) | (...) | (...) | (...);
} | {
amount: bigint;
from: string;
op: "OffChainTransfer";
to: string;
} | {
amount: bigint;
op: "OffChainWithdrawal";
to: string;
} | {
amount: bigint;
from: string;
op: "OffChainDeposit";
} | {
abiVersion: string;
callData: string;
code: {
bytecode: ...;
};
deposit: bigint;
op: "OffChainNewContract";
owner: string;
vmVersion: string;
} | {
abiVersion: string;
amount: bigint;
callData: string;
caller: string;
contract: string;
gas: number;
gasPrice: bigint;
op: "OffChainCallContract";
};
version: number;
vmVersion?: string;
};
}> & {
hash: `th_${string}`;
rawTx: `tx_${string}`;
};
}> Parameters
- p: {
innerTx?: boolean;
networkId: string;
onAccount: `ak_${string}`;
returnSigned: boolean;
tx: `tx_${string}`;
}Optional
innerTx?: boolean
networkId: string
onAccount: `ak_${string}`
returnSigned: boolean
tx: `tx_${string}`
Returns Promise<{
signedTransaction?: `tx_${string}`;
transactionHash?: Partial<{
blockHash: string;
blockHeight: number;
encodedTx?: string;
hash: string;
signatures: string[];
tx: {
abiVersion?: string;
accountId?: string;
amount?: bigint;
authData?: string;
authFun?: string;
callData?: string;
callerId?: string;
channelId?: string;
channelReserve?: bigint;
clientTtl?: number;
code?: string;
commitmentId?: string;
contractId?: string;
delegateIds?: {
initiator?: (...) | (...);
responder?: (...) | (...);
};
deposit?: bigint;
fee: bigint;
fromId?: string;
gaId?: string;
gas?: number;
gasPrice?: bigint;
initiatorAmount?: bigint;
initiatorAmountFinal?: bigint;
initiatorDelegateIds?: string[];
initiatorId?: string;
lockPeriod?: string;
name?: string;
nameFee?: bigint;
nameId?: string;
nameSalt?: number;
nameTtl?: number;
nonce?: number;
offchainTrees?: string;
oracleId?: string;
oracleTtl?: {
type: "delta";
value: string;
};
ownerId?: string;
payerId?: string;
payload?: string;
poi?: string;
pointers?: {
id: ...;
key: ...;
}[];
query?: string;
queryFee?: bigint;
queryFormat?: string;
queryId?: string;
queryTtl?: {
type: TTLType;
value: string;
};
recipientId?: string;
responderAmount?: bigint;
responderAmountFinal?: bigint;
responderDelegateIds?: string[];
responderId?: string;
response?: string;
responseFormat?: string;
responseTtl?: {
type: "delta";
value: string;
};
round?: number;
senderId?: string;
stateHash?: string;
toId?: string;
ttl?: number;
tx?: { tx: { recipientId?: string | undefined; amount?: bigint | undefined; fee: bigint; ttl?: number | undefined; senderId?: string | undefined; nonce?: number | undefined; payload?: string | undefined; ... 54 more ...; type: TxType; }; ... 4 more ...; signatures: string[]; };
type: TxType;
update?: {
op: (...) | (...) | (...) | (...) | (...);
} | {
amount: bigint;
from: string;
op: "OffChainTransfer";
to: string;
} | {
amount: bigint;
op: "OffChainWithdrawal";
to: string;
} | {
amount: bigint;
from: string;
op: "OffChainDeposit";
} | {
abiVersion: string;
callData: string;
code: {
bytecode: ...;
};
deposit: bigint;
op: "OffChainNewContract";
owner: string;
vmVersion: string;
} | {
abiVersion: string;
amount: bigint;
callData: string;
caller: string;
contract: string;
gas: number;
gasPrice: bigint;
op: "OffChainCallContract";
};
version: number;
vmVersion?: string;
};
}> & {
hash: `th_${string}`;
rawTx: `tx_${string}`;
};
}>
typedData.sign
typedData.sign: ((p) => Promise<{
signature: `sg_${string}`;
}>)
Type declaration
- (p): Promise<{
signature: `sg_${string}`;
}> Parameters
- p: {
aci: AciValue;
data: `cb_${string}`;
domain: Domain;
onAccount: `ak_${string}`;
}data: `cb_${string}`
onAccount: `ak_${string}`
Returns Promise<{
signature: `sg_${string}`;
}>
Deprecated
Wallet provided networkId will be used (current network) required to maintain backward compatibility with wallets using SDK v11.0.1 and below
See
https://github.com/aeternity/aepp-sdk-js/commit/153fd89a52c4eab39fcd659b356b36d32129c1ba