new TxBuilder()
A transaction builder.
Methods
add(e, a, v) → {TxBuilder}
Add a fact to the transaction.
Parameters:
Name | Type | Description |
---|---|---|
e |
String | Number | shared.BigInt | Array | The entity. |
a |
String | The attribute. |
v |
* | The value. |
Returns:
This instance.
- Type
- TxBuilder
build() → {Array}
Build the transaction.
Returns:
The transaction data.
- Type
- Array
cas(e, a, expVal, newVal) → {TxBuilder}
Add a compare-and-set operation.
Parameters:
Name | Type | Description |
---|---|---|
e |
String | Number | shared.BigInt | Array | The entity. |
a |
String | The attribute. |
expVal |
* | The expected value (to swap out). |
newVal |
* | The new value (to swap in). |
Returns:
This instance.
- Type
- TxBuilder
retract(e, a, v) → {TxBuilder}
Retract a fact from the transaction.
Parameters:
Name | Type | Description |
---|---|---|
e |
String | Number | shared.BigInt | Array | The entity. |
a |
String | The attribute. |
v |
* | The value. |
Returns:
This instance.
- Type
- TxBuilder
retractEntity(e) → {TxBuilder}
Retract an entity.
Parameters:
Name | Type | Description |
---|---|---|
e |
String | Number | shared.BigInt | Array | The entity. |
Returns:
This instance.
- Type
- TxBuilder
txData(objs) → {TxBuilder}
Append map transaction data to this transaction.
Parameters:
Name | Type | Description |
---|---|---|
objs |
Objects that contain the transaction data. |
Returns:
This instance.
- Type
- TxBuilder
txFunction(functionName, args) → {TxBuilder}
Add an arbitrary transaction function call.
Note that if you intend to pass symbols or keywords to your transaction
function, you must convert those arguments to that type before you pass
those arguments to this function.
Parameters:
Name | Type | Description |
---|---|---|
functionName |
String | The function name. |
args |
* | The arguments. |
Returns:
This instance.
- Type
- TxBuilder