Skip to content
Integra Protocol
API

@integraledger/lcp/tempo

The exports of @integraledger/lcp/tempo.

Interfaces

KeyAuthorizationUnsigned

Properties

PropertyTypeDescription
requestobjectdigest is keccak256(rlp(authorization)); the root key signs it.
request.authorizationTempoKeyAuthorization-
request.digest`0x${string}`-
request.kind"tempo-key-authorization"-

Methods

complete()

complete(rootSignature): Refusal | MppCredential

Parameters
ParameterType
rootSignature`0x${string}`
Returns

Refusal | MppCredential


TempoCall

Properties

PropertyType
inputUint8Array
to`0x${string}` | null
valuebigint

TempoDescriptor

Properties

PropertyType
authorizedSigner`0x${string}`
expiringNonceHash`0x${string}`
operator`0x${string}`
payee`0x${string}`
payer`0x${string}`
salt`0x${string}`
token`0x${string}`

TempoKeyAuthorization

Properties

PropertyType
allowedCallsobject[]
chainIdbigint
expirybigint
keyId`0x${string}`
keyType0 | 1 | 2
limitsobject[]
witness`0x${string}`

Variables

ACCESS_KEY_SPEND_TOPIC

const ACCESS_KEY_SPEND_TOPIC: "0xe0815e3aaadddf4dd75bde97fc060f0c38afe18e87a169be86a3f5c28247f192"

AccessKeySpend(address,address,address,uint256,uint256): the account, the key id and the token are topics 1 to 3; the keychain emits it for each spend an access key with enforced limits makes against its limit.


ACCOUNT_KEYCHAIN

const ACCOUNT_KEYCHAIN: "0xaaaaaaaa00000000000000000000000000000000"

The account keychain precompile.


CHANNEL_CLOSED_V1_TOPIC

const CHANNEL_CLOSED_V1_TOPIC: "0x92ed5fe0fe56b3f4185e688efb342e92a4492b9df29ad5de596c44e64d097b51"

ChannelClosed(bytes32,address,address,uint256,uint256), the v1 escrow's event.


CHANNEL_CLOSED_V2_TOPIC

const CHANNEL_CLOSED_V2_TOPIC: "0x5613aed96d5bf39f928408dbe1d4143490b9bb5957eac2dd8e69b5dc4b2206e6"

ChannelClosed(bytes32,address,address,uint96,uint96)


CHANNEL_OPENED_V1_TOPIC

const CHANNEL_OPENED_V1_TOPIC: "0x4516edb7b2ea29d92a0dbb5ff857203558b677157f4115d582b66e07b90ac8a8"

ChannelOpened(bytes32,address,address,address,address,uint256)


CHANNEL_OPENED_V2_TOPIC

const CHANNEL_OPENED_V2_TOPIC: "0xdebaba36f0e9c7978f536fed432d9360b1f9646d7ca88531c34c3eae43f154a7"

ChannelOpened(bytes32,address,address,address,address,address,bytes32,bytes32,uint96)


KEY_AUTHORIZATION_WITNESS_TOPIC

const KEY_AUTHORIZATION_WITNESS_TOPIC: "0x1f09d8956d18ea185372a3f7f40aca24bb45f303920c37c5f0605f4871da41f6"

KeyAuthorizationWitness(address,bytes32)


KEY_AUTHORIZED_TOPIC

const KEY_AUTHORIZED_TOPIC: "0x7c46af0758d3eca5e8195833bff1e5153f6249fc0f2968a878fd28544315a03c"

KeyAuthorized(address,address,uint8,uint64): the account and the key id are topics 1 and 2.


KEY_REVOKED_TOPIC

const KEY_REVOKED_TOPIC: "0x14ce4f0c8c12936436b733974fb13d10fc13e8c41c06dc8e19d82001c93d7989"

KeyRevoked(address,address)


OPEN_V1_SELECTOR

const OPEN_V1_SELECTOR: "0xc79ea485"

open(address,address,uint128,bytes32,address)


OPEN_V2_SELECTOR

const OPEN_V2_SELECTOR: "0xedc53b00"

open(address,address,address,uint96,bytes32,address)


TIP20_CHANNEL_RESERVE

const TIP20_CHANNEL_RESERVE: "0x4d50500000000000000000000000000000000000"

The TIP-20 channel reserve precompile.


TRANSFER_WITH_MEMO_SELECTOR

const TRANSFER_WITH_MEMO_SELECTOR: "0x95777d59"

The first four bytes of keccak256("transferWithMemo(address,uint256,bytes32)").


TRANSFER_WITH_MEMO_TOPIC

const TRANSFER_WITH_MEMO_TOPIC: "0x57bc7354aa85aed339e000bccffabbc529466af35f0772c8f8ee1145927de7f0"

keccak256("TransferWithMemo(address,address,uint256,bytes32)")

Functions

decodeKeyAuthorization()

decodeKeyAuthorization(signed): Refusal | { digest: `0x${string}`; keyId: `0x${string}`; witness?: `0x${string}`; }

Reads a signed key authorization: an RLP list of the authorization (3 to 9 items) and a byte-string signature. The digest is keccak256 over the authorization's bytes as received. The witness is item 6, 32 bytes, when present.

Parameters

ParameterType
signed`0x${string}`

Returns

Refusal | { digest: `0x${string}`; keyId: `0x${string}`; witness?: `0x${string}`; }


decodeTempoTx()

decodeTempoTx(wire): Refusal | { calls: TempoCall[]; chainId: bigint; validBefore: bigint | null; }

The chain id, the calls and valid_before of a signed 0x76 transaction. Each call is rlp([to, value, input]), with an empty to read as null. valid_before written empty is null.

Parameters

ParameterType
wireUint8Array

Returns

Refusal | { calls: TempoCall[]; chainId: bigint; validBefore: bigint | null; }


encodeKeyAuthorization()

encodeKeyAuthorization(a, signature?): Uint8Array<ArrayBufferLike> | Refusal

rlp([chain_id, key_type, key_id, expiry, limits, allowed_calls, witness]); with a signature, rlp([that list, signature]). At most 16 limits and 16 scopes, 16 selector rules each and 16 recipients each.

Parameters

ParameterType
aTempoKeyAuthorization
signature?`0x${string}`

Returns

Uint8Array<ArrayBufferLike> | Refusal


expiringNonceHash()

expiringNonceHash(signedTx, sender): `0x${string}` | Refusal

keccak256(0x76 ‖ rlp(every envelope field before the sender's signature) ‖ sender). When a fee payer has signed, fee_token is written as 0x80 and the fee payer's signature as 0x00, as the sender signed them.

Parameters

ParameterType
signedTxUint8Array
sender`0x${string}`

Returns

`0x${string}` | Refusal


keyAccount()

keyAccount(receipt, h, keyId): `0x${string}` | Refusal

The account for which a receipt's key authorization carried witness h and registered keyId: topic 1 of the account keychain's KeyAuthorizationWitness logs whose topic 2 is h, when the keychain's KeyAuthorized log in the same receipt names that account and keyId. The receipt's status is not read: the authorization is applied before the transaction's calls run.

Parameters

ParameterType
receiptEvmReceipt
h`0x${string}`
keyId`0x${string}`

Returns

`0x${string}` | Refusal


memoCalldata()

memoCalldata(to, amount, memo): `0x${string}` | Refusal

transferWithMemo(to, amount, memo) calldata: the selector, then the three 32-byte words.

Parameters

ParameterType
to`0x${string}`
amountbigint
memo`0x${string}`

Returns

`0x${string}` | Refusal


tempoChannelId()

tempoChannelId(d): `0x${string}` | Refusal

The TIP-20 channel reserve's channel id: keccak256(abi.encode(payer, payee, operator, token, salt, authorizedSigner, expiringNonceHash, escrow, chainId)).

Parameters

ParameterType
dTempoDescriptor & object

Returns

`0x${string}` | Refusal


witnessRecover()

witnessRecover(ref, reader): Promise<`0x${string}` | Refusal>

Reads the transaction's receipt and returns topic 2 of its one KeyAuthorizationWitness log from the account keychain. One call.

Parameters

ParameterType
ref{ network: string; transaction: `0x${string}`; }
ref.networkstring
ref.transaction`0x${string}`
readerEvmReader

Returns

Promise<`0x${string}` | Refusal>

References

RECEIVE_POLICY_GUARD

Re-exports RECEIVE_POLICY_GUARD

Last updated on

On this page