@trufnetwork/sdk-js 0.5.10 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/dist/cjs/client/client.cjs +11 -0
- package/dist/cjs/client/client.cjs.map +2 -2
- package/dist/cjs/contracts-api/orderbookAction.cjs +880 -0
- package/dist/cjs/contracts-api/orderbookAction.cjs.map +7 -0
- package/dist/cjs/internal.cjs +9 -0
- package/dist/cjs/internal.cjs.map +2 -2
- package/dist/cjs/types/orderbook.cjs +19 -0
- package/dist/cjs/types/orderbook.cjs.map +7 -0
- package/dist/cjs/util/AttestationEncoding.cjs +3 -2
- package/dist/cjs/util/AttestationEncoding.cjs.map +2 -2
- package/dist/cjs/util/orderbookHelpers.cjs +194 -0
- package/dist/cjs/util/orderbookHelpers.cjs.map +7 -0
- package/dist/cjs/util/orderbookHelpers.test.cjs +217 -0
- package/dist/cjs/util/orderbookHelpers.test.cjs.map +7 -0
- package/dist/esm/client/client.mjs +11 -0
- package/dist/esm/client/client.mjs.map +2 -2
- package/dist/esm/contracts-api/orderbookAction.mjs +875 -0
- package/dist/esm/contracts-api/orderbookAction.mjs.map +7 -0
- package/dist/esm/internal.mjs +16 -0
- package/dist/esm/internal.mjs.map +2 -2
- package/dist/esm/types/orderbook.mjs +1 -0
- package/dist/esm/types/orderbook.mjs.map +7 -0
- package/dist/esm/util/AttestationEncoding.mjs +3 -2
- package/dist/esm/util/AttestationEncoding.mjs.map +2 -2
- package/dist/esm/util/orderbookHelpers.mjs +173 -0
- package/dist/esm/util/orderbookHelpers.mjs.map +7 -0
- package/dist/esm/util/orderbookHelpers.test.mjs +229 -0
- package/dist/esm/util/orderbookHelpers.test.mjs.map +7 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/client/client.d.ts +6 -0
- package/dist/types/client/client.d.ts.map +1 -1
- package/dist/types/contracts-api/orderbookAction.d.ts +303 -0
- package/dist/types/contracts-api/orderbookAction.d.ts.map +1 -0
- package/dist/types/internal.d.ts +3 -0
- package/dist/types/internal.d.ts.map +1 -1
- package/dist/types/types/orderbook.d.ts +376 -0
- package/dist/types/types/orderbook.d.ts.map +1 -0
- package/dist/types/util/AttestationEncoding.d.ts +9 -1
- package/dist/types/util/AttestationEncoding.d.ts.map +1 -1
- package/dist/types/util/orderbookHelpers.d.ts +161 -0
- package/dist/types/util/orderbookHelpers.d.ts.map +1 -0
- package/dist/types/util/orderbookHelpers.test.d.ts +2 -0
- package/dist/types/util/orderbookHelpers.test.d.ts.map +1 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -396,6 +396,46 @@ await primitiveAction.insertRecord({
|
|
|
396
396
|
- ⚡ **High-throughput data insertion** (independent records)
|
|
397
397
|
- ⚡ **Fire-and-forget operations** (with proper error handling)
|
|
398
398
|
|
|
399
|
+
### Prediction Markets (Order Book)
|
|
400
|
+
|
|
401
|
+
The SDK supports binary prediction markets through the Order Book API. Markets are settled automatically based on real-world data from trusted data providers.
|
|
402
|
+
|
|
403
|
+
```typescript
|
|
404
|
+
// Load the order book action
|
|
405
|
+
const orderbook = client.loadOrderbookAction();
|
|
406
|
+
|
|
407
|
+
// Get market info
|
|
408
|
+
const market = await orderbook.getMarketInfo(queryId);
|
|
409
|
+
console.log(`Settles at: ${new Date(market.settleTime * 1000)}`);
|
|
410
|
+
|
|
411
|
+
// Place a buy order for YES shares at 55 cents
|
|
412
|
+
const result = await orderbook.placeBuyOrder({
|
|
413
|
+
queryId: market.id,
|
|
414
|
+
outcome: true, // YES
|
|
415
|
+
price: 55, // 55 cents = 55% implied probability
|
|
416
|
+
amount: 100, // 100 shares
|
|
417
|
+
});
|
|
418
|
+
await client.waitForTx(result.data!.tx_hash);
|
|
419
|
+
|
|
420
|
+
// Get best prices
|
|
421
|
+
const prices = await orderbook.getBestPrices(market.id, true);
|
|
422
|
+
console.log(`YES: Bid=${prices.bestBid}c, Ask=${prices.bestAsk}c`);
|
|
423
|
+
```
|
|
424
|
+
|
|
425
|
+
#### Market Making with Split Limit Orders
|
|
426
|
+
|
|
427
|
+
```typescript
|
|
428
|
+
// Create YES/NO pairs and provide liquidity
|
|
429
|
+
await orderbook.placeSplitLimitOrder({
|
|
430
|
+
queryId: market.id,
|
|
431
|
+
truePrice: 55, // YES at 55c, NO at 45c
|
|
432
|
+
amount: 100, // 100 pairs
|
|
433
|
+
});
|
|
434
|
+
// Result: 100 YES holdings + 100 NO sell orders at 45c
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
**📖 For complete documentation including market creation, order types, settlement, and examples, see the [Order Book Operations](./docs/api-reference.md#order-book-operations) section in the API Reference and [examples/orderbook](./examples/orderbook).**
|
|
438
|
+
|
|
399
439
|
### Using the SDK with Your Local Node
|
|
400
440
|
|
|
401
441
|
If you are running your own TRUF.NETWORK node, you can configure the SDK to interact with your local instance by changing the `endpoint` in the client configuration, as shown in the [Basic Client Initialization](#basic-client-initialization) section. This is useful for development, testing, or when operating within a private network.
|
|
@@ -488,6 +528,11 @@ For other bundlers or serverless platforms, consult their documentation on modul
|
|
|
488
528
|
| List attestations | `attestationAction.listAttestations({requester, limit, offset, orderBy})` |
|
|
489
529
|
| Get transaction event | `transactionAction.getTransactionEvent({txId})` |
|
|
490
530
|
| List transaction fees | `transactionAction.listTransactionFees({wallet, mode, limit, offset})` |
|
|
531
|
+
| Create prediction market | `orderbook.createMarket({bridge, queryComponents, settleTime, ...})` |
|
|
532
|
+
| Place buy order | `orderbook.placeBuyOrder({queryId, outcome, price, amount})` |
|
|
533
|
+
| Place split limit order | `orderbook.placeSplitLimitOrder({queryId, truePrice, amount})` |
|
|
534
|
+
| Get order book | `orderbook.getOrderBook(queryId, outcome)` |
|
|
535
|
+
| Get best prices | `orderbook.getBestPrices(queryId, outcome)` |
|
|
491
536
|
| Destroy stream | `client.destroyStream(streamLocator)` |
|
|
492
537
|
|
|
493
538
|
**Safe Operation Pattern:**
|
|
@@ -35,6 +35,7 @@ var import_getLastTransactions = require("./getLastTransactions.cjs");
|
|
|
35
35
|
var import_roleManagement = require("../contracts-api/roleManagement.cjs");
|
|
36
36
|
var import_attestationAction = require("../contracts-api/attestationAction.cjs");
|
|
37
37
|
var import_transactionAction = require("../contracts-api/transactionAction.cjs");
|
|
38
|
+
var import_orderbookAction = require("../contracts-api/orderbookAction.cjs");
|
|
38
39
|
var BaseTNClient = class {
|
|
39
40
|
kwilClient;
|
|
40
41
|
signerInfo;
|
|
@@ -184,6 +185,16 @@ var BaseTNClient = class {
|
|
|
184
185
|
this.getKwilSigner()
|
|
185
186
|
);
|
|
186
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Loads the order book action API, permitting prediction market operations.
|
|
190
|
+
* @returns An instance of OrderbookAction.
|
|
191
|
+
*/
|
|
192
|
+
loadOrderbookAction() {
|
|
193
|
+
return new import_orderbookAction.OrderbookAction(
|
|
194
|
+
this.getKwilClient(),
|
|
195
|
+
this.getKwilSigner()
|
|
196
|
+
);
|
|
197
|
+
}
|
|
187
198
|
/**
|
|
188
199
|
* Creates a new stream locator.
|
|
189
200
|
* @param streamId - The ID of the stream.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/client/client.ts"],
|
|
4
|
-
"sourcesContent": ["import { Client, KwilSigner, NodeKwil, WebKwil, Types, EnvironmentType } from \"@trufnetwork/kwil-js\";\nimport { ComposedAction, ListTaxonomiesByHeightParams, GetTaxonomiesForStreamsParams, TaxonomyQueryResult } from \"../contracts-api/composedAction\";\nimport { deployStream } from \"../contracts-api/deployStream\";\nimport { deleteStream } from \"../contracts-api/deleteStream\";\nimport { PrimitiveAction } from \"../contracts-api/primitiveAction\";\nimport { Action, ListMetadataByHeightParams, MetadataQueryResult } from \"../contracts-api/action\";\nimport { StreamType } from \"../contracts-api/contractValues\";\nimport { WithdrawalProof } from \"../types/bridge\";\nimport { StreamLocator, TNStream } from \"../types/stream\";\nimport { EthereumAddress } from \"../util/EthereumAddress\";\nimport { StreamId } from \"../util/StreamId\";\nimport { listStreams } from \"./listStreams\";\nimport { getLastTransactions } from \"./getLastTransactions\";\nimport { RoleManagement } from \"../contracts-api/roleManagement\";\nimport { AttestationAction } from \"../contracts-api/attestationAction\";\nimport { TransactionAction } from \"../contracts-api/transactionAction\";\nimport { OwnerIdentifier } from \"../types/role\";\n\nexport interface SignerInfo {\n // we need to have the address upfront to create the KwilSigner, instead of relying on the signer to return it asynchronously\n address: string;\n signer: Types.EthSigner;\n}\n\nexport type TNClientOptions = {\n endpoint: string;\n signerInfo: SignerInfo;\n} & Omit<Types.KwilConfig, \"kwilProvider\">;\n\nexport interface ListStreamsInput {\n dataProvider?: string;\n limit?: number;\n offset?: number;\n orderBy?: string;\n blockHeight?: number;\n}\n\n/**\n * @param dataProvider optional address; when omitted or null, returns for all providers\n * @param limitSize max rows to return (default 6, max 100)\n */\nexport interface GetLastTransactionsInput {\n dataProvider?: string;\n limitSize?: number;\n}\n\nexport abstract class BaseTNClient<T extends EnvironmentType> {\n protected kwilClient: Types.Kwil<T> | undefined;\n protected signerInfo: SignerInfo;\n\n protected constructor(options: TNClientOptions) {\n this.signerInfo = options.signerInfo;\n }\n\n /**\n * Waits for a transaction to be mined by TN.\n * @param txHash - The transaction hash to wait for.\n * @param timeout - The timeout in milliseconds.\n * @returns A promise that resolves to the transaction info receipt.\n */\n async waitForTx(txHash: string, timeout = 12000): Promise<Types.TxInfoReceipt> {\n return new Promise<Types.TxInfoReceipt>(async (resolve, reject) => {\n const interval = setInterval(async () => {\n const receipt = await this.getKwilClient()\n [\"txInfoClient\"](txHash)\n .catch(() => ({ data: undefined, status: undefined }));\n switch (receipt.status) {\n case 200:\n if (receipt.data?.tx_result?.log !== undefined && receipt.data?.tx_result?.log.includes(\"ERROR\")) {\n reject(\n new Error(\n `Transaction failed: status ${receipt.status} : log message ${receipt.data?.tx_result.log}`,\n ))\n } else {\n resolve(receipt.data!);\n }\n break;\n case undefined:\n break;\n default:\n reject(\n new Error(\n `Transaction failed: status ${receipt.status} : log message ${receipt.data?.tx_result.log}`,\n ),\n );\n }\n }, 1000);\n setTimeout(() => {\n clearInterval(interval);\n reject(new Error(\"Transaction failed: Timeout\"));\n }, timeout);\n });\n }\n\n /**\n * Returns the Kwil signer used by the client.\n * @returns An instance of KwilSigner.\n */\n getKwilSigner(): KwilSigner {\n return new KwilSigner(\n this.signerInfo.signer,\n this.address().getAddress(),\n );\n }\n\n /**\n * Returns the Kwil client used by the client.\n * @returns An instance of Kwil.\n * @throws If the Kwil client is not initialized.\n */\n getKwilClient(): Types.Kwil<EnvironmentType> {\n if (!this.kwilClient) {\n throw new Error(\"Kwil client not initialized\");\n }\n return this.kwilClient;\n }\n\n /**\n * Deploys a new stream.\n * @param streamId - The ID of the stream to deploy.\n * @param streamType - The type of the stream.\n * @param synchronous - Whether the deployment should be synchronous.\n * @param contractVersion\n * @returns A promise that resolves to a generic response containing the transaction receipt.\n */\n async deployStream(\n streamId: StreamId,\n streamType: StreamType,\n synchronous?: boolean,\n ): Promise<Types.GenericResponse<Types.TxReceipt>> {\n return await deployStream({\n streamId,\n streamType,\n synchronous,\n kwilClient: this.getKwilClient(),\n kwilSigner: this.getKwilSigner(),\n });\n }\n\n /**\n * Destroys a stream.\n * @param stream - The StreamLocator of the stream to destroy.\n * @param synchronous - Whether the destruction should be synchronous.\n * @returns A promise that resolves to a generic response containing the transaction receipt.\n */\n async destroyStream(\n stream: StreamLocator,\n synchronous?: boolean,\n ): Promise<Types.GenericResponse<Types.TxReceipt>> {\n return await deleteStream({\n stream,\n synchronous,\n kwilClient: this.getKwilClient(),\n kwilSigner: this.getKwilSigner(),\n });\n }\n\n /**\n * Loads an already deployed stream, permitting its API usage.\n * @returns An instance of IStream.\n */\n loadAction(): Action {\n return new Action(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads a primitive stream.\n * @returns An instance of IPrimitiveStream.\n */\n loadPrimitiveAction(): PrimitiveAction {\n return PrimitiveAction.fromStream(this.loadAction());\n }\n\n /**\n * Loads a composed stream.\n * @returns An instance of IComposedStream.\n */\n loadComposedAction(): ComposedAction {\n return ComposedAction.fromStream(this.loadAction());\n }\n\n /**\n * Loads the role management contract API, permitting its RBAC usage.\n */\n loadRoleManagementAction(): RoleManagement {\n return RoleManagement.fromClient(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads the attestation action API, permitting attestation operations.\n * @returns An instance of AttestationAction.\n */\n loadAttestationAction(): AttestationAction {\n return new AttestationAction(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads the transaction action API, permitting transaction ledger queries.\n * @returns An instance of TransactionAction.\n */\n loadTransactionAction(): TransactionAction {\n return new TransactionAction(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Creates a new stream locator.\n * @param streamId - The ID of the stream.\n * @returns A StreamLocator object.\n */\n ownStreamLocator(streamId: StreamId): StreamLocator {\n return {\n streamId,\n dataProvider: this.address(),\n };\n }\n\n /**\n * Returns the address of the signer used by the client.\n * @returns An instance of EthereumAddress.\n */\n address(): EthereumAddress {\n return new EthereumAddress(this.signerInfo.address);\n }\n\n /**\n * Returns all streams from the TN network.\n * @param input - The input parameters for listing streams.\n * @returns A promise that resolves to a list of stream locators.\n */\n async getListStreams(input: ListStreamsInput): Promise<TNStream[]> {\n return listStreams(this.getKwilClient() as WebKwil | NodeKwil,this.getKwilSigner(),input);\n }\n\n /**\n * Returns the last write activity across streams.\n * @param input - The input parameters for getting last transactions.\n * @returns A promise that resolves to a list of last transactions.\n */\n async getLastTransactions(input: GetLastTransactionsInput): Promise<any[]> {\n return getLastTransactions(this.getKwilClient() as WebKwil | NodeKwil,this.getKwilSigner(),input);\n }\n\n /**\n * Lists taxonomies by height range for incremental synchronization.\n * High-level wrapper for ComposedAction.listTaxonomiesByHeight()\n * \n * @param params Height range and pagination parameters \n * @returns Promise resolving to taxonomy query results\n * \n * @example\n * ```typescript\n * const taxonomies = await client.listTaxonomiesByHeight({\n * fromHeight: 1000,\n * toHeight: 2000,\n * limit: 100,\n * latestOnly: true\n * });\n * ```\n */\n async listTaxonomiesByHeight(params: ListTaxonomiesByHeightParams = {}): Promise<TaxonomyQueryResult[]> {\n const composedAction = this.loadComposedAction();\n return composedAction.listTaxonomiesByHeight(params);\n }\n\n async listMetadataByHeight(params: ListMetadataByHeightParams = {}): Promise<MetadataQueryResult[]> {\n const action = this.loadAction();\n return action.listMetadataByHeight(params);\n }\n\n /**\n * Gets the wallet balance for a specific bridge instance\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\", \"ethereum\")\n * @param walletAddress The wallet address to check balance for\n * @returns Promise that resolves to the balance as a string (in wei)\n */\n async getWalletBalance(bridgeIdentifier: string, walletAddress: string) {\n const action = this.loadAction();\n return action.getWalletBalance(bridgeIdentifier, walletAddress);\n }\n\n /**\n * Performs a withdrawal operation by bridging tokens from TN to a destination chain\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\")\n * @param amount The amount to withdraw (in wei)\n * @param recipient The recipient address on the destination chain\n * @returns Promise that resolves to the transaction hash, or throws on error\n */\n async withdraw(bridgeIdentifier: string, amount: string, recipient: string): Promise<string> {\n const action = this.loadAction();\n\n // Bridge tokens in a single operation\n const bridgeResult = await action.bridgeTokens(bridgeIdentifier, amount, recipient);\n if (!bridgeResult.data?.tx_hash) {\n throw new Error(\"Bridge tokens operation failed: no transaction hash returned\");\n }\n\n // Wait for bridge transaction to be mined - let waitForTx errors bubble up\n try {\n await this.waitForTx(bridgeResult.data.tx_hash);\n } catch (error) {\n throw new Error(`Bridge tokens transaction failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n\n // Return the transaction hash\n return bridgeResult.data.tx_hash;\n }\n\n /**\n * Lists wallet rewards for a specific bridge instance\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\")\n * @param wallet The wallet address to list rewards for\n * @param withPending Whether to include pending rewards\n * @returns Promise that resolves to an array of rewards data\n * @deprecated This method uses the extension namespace directly. Most users should use getWithdrawalProof instead.\n */\n async listWalletRewards(bridgeIdentifier: string, wallet: string, withPending: boolean): Promise<any[]> {\n const action = this.loadAction();\n return action.listWalletRewards(bridgeIdentifier, wallet, withPending);\n }\n\n /**\n * Gets withdrawal proof for a specific bridge instance\n * Returns merkle proofs and validator signatures needed for claiming withdrawals on the destination chain\n *\n * This method is used for non-custodial bridge withdrawals where users need to\n * manually claim their withdrawals by submitting proofs to the destination chain contract.\n * The proof includes validator signatures, merkle root, block hash, and amount.\n *\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"hoodi_tt\", \"sepolia\", \"ethereum\")\n * @param walletAddress The wallet address to get withdrawal proof for\n * @returns Promise that resolves to an array of withdrawal proof data (empty array if no unclaimed withdrawals)\n *\n * @example\n * ```typescript\n * // Get withdrawal proofs for Hoodi Test Token bridge\n * const proofs = await client.getWithdrawalProof(\"hoodi_tt\", \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\");\n *\n * // Proofs will be an array like:\n * // [{\n * // chain: \"hoodi\",\n * // chain_id: \"3639\",\n * // contract: \"0x878D6aaeB6e746033f50B8dC268d54B4631554E7\",\n * // created_at: 3080,\n * // recipient: \"0x...\",\n * // amount: \"100000000000000000000\",\n * // block_hash: <base64-encoded>,\n * // root: <base64-encoded>,\n * // proofs: [],\n * // signatures: [<base64-encoded-signatures>]\n * // }]\n *\n * // Use the proofs to claim withdrawal on destination chain\n * if (proofs.length > 0) {\n * const proof = proofs[0];\n * await bridgeContract.claimWithdrawal(proof.recipient, proof.amount, proof.root, proof.proofs, proof.signatures);\n * }\n * ```\n *\n * @note This method has been tested via integration tests in the node repository.\n * See: https://github.com/trufnetwork/kwil-db/blob/main/node/exts/erc20-bridge/erc20/meta_extension_withdrawal_test.go\n */\n async getWithdrawalProof(bridgeIdentifier: string, walletAddress: string): Promise<WithdrawalProof[]> {\n const action = this.loadAction();\n return action.getWithdrawalProof(bridgeIdentifier, walletAddress);\n }\n\n /**\n * Gets taxonomies for specific streams in batch.\n * High-level wrapper for ComposedAction.getTaxonomiesForStreams()\n * \n * @param params Stream locators and options\n * @returns Promise resolving to taxonomy query results\n * \n * @example\n * ```typescript\n * const streams = [\n * { dataProvider: provider1, streamId: streamId1 },\n * { dataProvider: provider2, streamId: streamId2 }\n * ];\n * const taxonomies = await client.getTaxonomiesForStreams({\n * streams,\n * latestOnly: true\n * });\n * ```\n */\n async getTaxonomiesForStreams(params: GetTaxonomiesForStreamsParams): Promise<TaxonomyQueryResult[]> {\n const composedAction = this.loadComposedAction();\n return composedAction.getTaxonomiesForStreams(params);\n }\n\n /**\n * Get the default chain id for a provider. Use with caution, as this decreases the security of the TN.\n * @param provider - The provider URL.\n * @returns A promise that resolves to the chain ID.\n */\n public static async getDefaultChainId(provider: string) {\n const kwilClient = new Client({\n kwilProvider: provider,\n });\n const chainInfo = await kwilClient[\"chainInfoClient\"]();\n return chainInfo.data?.chain_id;\n }\n\n /*\n * High-level role-management helpers. These wrap the lower-level\n * RoleManagement contract calls and expose a simpler API on the\n * TN client.\n */\n\n /** Grants a role to one or more wallets. */\n async grantRole(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallets: EthereumAddress | EthereumAddress[];\n synchronous?: boolean;\n }): Promise<string> {\n const rm = this.loadRoleManagementAction();\n const walletsArr: EthereumAddress[] = Array.isArray(input.wallets)\n ? input.wallets\n : [input.wallets];\n const tx = await rm.grantRole(\n {\n owner: input.owner,\n roleName: input.roleName,\n wallets: walletsArr,\n },\n input.synchronous,\n );\n return tx.data?.tx_hash as unknown as string;\n }\n\n /** Revokes a role from one or more wallets. */\n async revokeRole(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallets: EthereumAddress | EthereumAddress[];\n synchronous?: boolean;\n }): Promise<string> {\n const rm = this.loadRoleManagementAction();\n const walletsArr: EthereumAddress[] = Array.isArray(input.wallets)\n ? input.wallets\n : [input.wallets];\n const tx = await rm.revokeRole(\n {\n owner: input.owner,\n roleName: input.roleName,\n wallets: walletsArr,\n },\n input.synchronous,\n );\n return tx.data?.tx_hash as unknown as string;\n }\n\n /**\n * Checks if a wallet is member of a role.\n * Returns true if the wallet is a member.\n */\n async isMemberOf(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallet: EthereumAddress;\n }): Promise<boolean> {\n const rm = this.loadRoleManagementAction();\n const res = await rm.areMembersOf({\n owner: input.owner,\n roleName: input.roleName,\n wallets: [input.wallet],\n });\n return res.length > 0 && res[0].isMember;\n }\n\n /**\n * Lists role members \u2013 currently unsupported in the\n * smart-contract layer.\n */\n async listRoleMembers(input: {\n owner: OwnerIdentifier;\n roleName: string;\n limit?: number;\n offset?: number;\n }): Promise<import(\"../types/role\").RoleMember[]> {\n const rm = this.loadRoleManagementAction();\n return rm.listRoleMembers({\n owner: input.owner,\n roleName: input.roleName,\n limit: input.limit,\n offset: input.offset,\n });\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8E;AAC9E,4BAAiH;AACjH,0BAA6B;AAC7B,0BAA6B;AAC7B,6BAAgC;AAChC,oBAAwE;AAIxE,6BAAgC;AAEhC,yBAA4B;AAC5B,iCAAoC;AACpC,4BAA+B;AAC/B,+BAAkC;AAClC,+BAAkC;AA+
|
|
4
|
+
"sourcesContent": ["import { Client, KwilSigner, NodeKwil, WebKwil, Types, EnvironmentType } from \"@trufnetwork/kwil-js\";\nimport { ComposedAction, ListTaxonomiesByHeightParams, GetTaxonomiesForStreamsParams, TaxonomyQueryResult } from \"../contracts-api/composedAction\";\nimport { deployStream } from \"../contracts-api/deployStream\";\nimport { deleteStream } from \"../contracts-api/deleteStream\";\nimport { PrimitiveAction } from \"../contracts-api/primitiveAction\";\nimport { Action, ListMetadataByHeightParams, MetadataQueryResult } from \"../contracts-api/action\";\nimport { StreamType } from \"../contracts-api/contractValues\";\nimport { WithdrawalProof } from \"../types/bridge\";\nimport { StreamLocator, TNStream } from \"../types/stream\";\nimport { EthereumAddress } from \"../util/EthereumAddress\";\nimport { StreamId } from \"../util/StreamId\";\nimport { listStreams } from \"./listStreams\";\nimport { getLastTransactions } from \"./getLastTransactions\";\nimport { RoleManagement } from \"../contracts-api/roleManagement\";\nimport { AttestationAction } from \"../contracts-api/attestationAction\";\nimport { TransactionAction } from \"../contracts-api/transactionAction\";\nimport { OrderbookAction } from \"../contracts-api/orderbookAction\";\nimport { OwnerIdentifier } from \"../types/role\";\n\nexport interface SignerInfo {\n // we need to have the address upfront to create the KwilSigner, instead of relying on the signer to return it asynchronously\n address: string;\n signer: Types.EthSigner;\n}\n\nexport type TNClientOptions = {\n endpoint: string;\n signerInfo: SignerInfo;\n} & Omit<Types.KwilConfig, \"kwilProvider\">;\n\nexport interface ListStreamsInput {\n dataProvider?: string;\n limit?: number;\n offset?: number;\n orderBy?: string;\n blockHeight?: number;\n}\n\n/**\n * @param dataProvider optional address; when omitted or null, returns for all providers\n * @param limitSize max rows to return (default 6, max 100)\n */\nexport interface GetLastTransactionsInput {\n dataProvider?: string;\n limitSize?: number;\n}\n\nexport abstract class BaseTNClient<T extends EnvironmentType> {\n protected kwilClient: Types.Kwil<T> | undefined;\n protected signerInfo: SignerInfo;\n\n protected constructor(options: TNClientOptions) {\n this.signerInfo = options.signerInfo;\n }\n\n /**\n * Waits for a transaction to be mined by TN.\n * @param txHash - The transaction hash to wait for.\n * @param timeout - The timeout in milliseconds.\n * @returns A promise that resolves to the transaction info receipt.\n */\n async waitForTx(txHash: string, timeout = 12000): Promise<Types.TxInfoReceipt> {\n return new Promise<Types.TxInfoReceipt>(async (resolve, reject) => {\n const interval = setInterval(async () => {\n const receipt = await this.getKwilClient()\n [\"txInfoClient\"](txHash)\n .catch(() => ({ data: undefined, status: undefined }));\n switch (receipt.status) {\n case 200:\n if (receipt.data?.tx_result?.log !== undefined && receipt.data?.tx_result?.log.includes(\"ERROR\")) {\n reject(\n new Error(\n `Transaction failed: status ${receipt.status} : log message ${receipt.data?.tx_result.log}`,\n ))\n } else {\n resolve(receipt.data!);\n }\n break;\n case undefined:\n break;\n default:\n reject(\n new Error(\n `Transaction failed: status ${receipt.status} : log message ${receipt.data?.tx_result.log}`,\n ),\n );\n }\n }, 1000);\n setTimeout(() => {\n clearInterval(interval);\n reject(new Error(\"Transaction failed: Timeout\"));\n }, timeout);\n });\n }\n\n /**\n * Returns the Kwil signer used by the client.\n * @returns An instance of KwilSigner.\n */\n getKwilSigner(): KwilSigner {\n return new KwilSigner(\n this.signerInfo.signer,\n this.address().getAddress(),\n );\n }\n\n /**\n * Returns the Kwil client used by the client.\n * @returns An instance of Kwil.\n * @throws If the Kwil client is not initialized.\n */\n getKwilClient(): Types.Kwil<EnvironmentType> {\n if (!this.kwilClient) {\n throw new Error(\"Kwil client not initialized\");\n }\n return this.kwilClient;\n }\n\n /**\n * Deploys a new stream.\n * @param streamId - The ID of the stream to deploy.\n * @param streamType - The type of the stream.\n * @param synchronous - Whether the deployment should be synchronous.\n * @param contractVersion\n * @returns A promise that resolves to a generic response containing the transaction receipt.\n */\n async deployStream(\n streamId: StreamId,\n streamType: StreamType,\n synchronous?: boolean,\n ): Promise<Types.GenericResponse<Types.TxReceipt>> {\n return await deployStream({\n streamId,\n streamType,\n synchronous,\n kwilClient: this.getKwilClient(),\n kwilSigner: this.getKwilSigner(),\n });\n }\n\n /**\n * Destroys a stream.\n * @param stream - The StreamLocator of the stream to destroy.\n * @param synchronous - Whether the destruction should be synchronous.\n * @returns A promise that resolves to a generic response containing the transaction receipt.\n */\n async destroyStream(\n stream: StreamLocator,\n synchronous?: boolean,\n ): Promise<Types.GenericResponse<Types.TxReceipt>> {\n return await deleteStream({\n stream,\n synchronous,\n kwilClient: this.getKwilClient(),\n kwilSigner: this.getKwilSigner(),\n });\n }\n\n /**\n * Loads an already deployed stream, permitting its API usage.\n * @returns An instance of IStream.\n */\n loadAction(): Action {\n return new Action(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads a primitive stream.\n * @returns An instance of IPrimitiveStream.\n */\n loadPrimitiveAction(): PrimitiveAction {\n return PrimitiveAction.fromStream(this.loadAction());\n }\n\n /**\n * Loads a composed stream.\n * @returns An instance of IComposedStream.\n */\n loadComposedAction(): ComposedAction {\n return ComposedAction.fromStream(this.loadAction());\n }\n\n /**\n * Loads the role management contract API, permitting its RBAC usage.\n */\n loadRoleManagementAction(): RoleManagement {\n return RoleManagement.fromClient(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads the attestation action API, permitting attestation operations.\n * @returns An instance of AttestationAction.\n */\n loadAttestationAction(): AttestationAction {\n return new AttestationAction(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads the transaction action API, permitting transaction ledger queries.\n * @returns An instance of TransactionAction.\n */\n loadTransactionAction(): TransactionAction {\n return new TransactionAction(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Loads the order book action API, permitting prediction market operations.\n * @returns An instance of OrderbookAction.\n */\n loadOrderbookAction(): OrderbookAction {\n return new OrderbookAction(\n this.getKwilClient() as WebKwil | NodeKwil,\n this.getKwilSigner(),\n );\n }\n\n /**\n * Creates a new stream locator.\n * @param streamId - The ID of the stream.\n * @returns A StreamLocator object.\n */\n ownStreamLocator(streamId: StreamId): StreamLocator {\n return {\n streamId,\n dataProvider: this.address(),\n };\n }\n\n /**\n * Returns the address of the signer used by the client.\n * @returns An instance of EthereumAddress.\n */\n address(): EthereumAddress {\n return new EthereumAddress(this.signerInfo.address);\n }\n\n /**\n * Returns all streams from the TN network.\n * @param input - The input parameters for listing streams.\n * @returns A promise that resolves to a list of stream locators.\n */\n async getListStreams(input: ListStreamsInput): Promise<TNStream[]> {\n return listStreams(this.getKwilClient() as WebKwil | NodeKwil,this.getKwilSigner(),input);\n }\n\n /**\n * Returns the last write activity across streams.\n * @param input - The input parameters for getting last transactions.\n * @returns A promise that resolves to a list of last transactions.\n */\n async getLastTransactions(input: GetLastTransactionsInput): Promise<any[]> {\n return getLastTransactions(this.getKwilClient() as WebKwil | NodeKwil,this.getKwilSigner(),input);\n }\n\n /**\n * Lists taxonomies by height range for incremental synchronization.\n * High-level wrapper for ComposedAction.listTaxonomiesByHeight()\n * \n * @param params Height range and pagination parameters \n * @returns Promise resolving to taxonomy query results\n * \n * @example\n * ```typescript\n * const taxonomies = await client.listTaxonomiesByHeight({\n * fromHeight: 1000,\n * toHeight: 2000,\n * limit: 100,\n * latestOnly: true\n * });\n * ```\n */\n async listTaxonomiesByHeight(params: ListTaxonomiesByHeightParams = {}): Promise<TaxonomyQueryResult[]> {\n const composedAction = this.loadComposedAction();\n return composedAction.listTaxonomiesByHeight(params);\n }\n\n async listMetadataByHeight(params: ListMetadataByHeightParams = {}): Promise<MetadataQueryResult[]> {\n const action = this.loadAction();\n return action.listMetadataByHeight(params);\n }\n\n /**\n * Gets the wallet balance for a specific bridge instance\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\", \"ethereum\")\n * @param walletAddress The wallet address to check balance for\n * @returns Promise that resolves to the balance as a string (in wei)\n */\n async getWalletBalance(bridgeIdentifier: string, walletAddress: string) {\n const action = this.loadAction();\n return action.getWalletBalance(bridgeIdentifier, walletAddress);\n }\n\n /**\n * Performs a withdrawal operation by bridging tokens from TN to a destination chain\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\")\n * @param amount The amount to withdraw (in wei)\n * @param recipient The recipient address on the destination chain\n * @returns Promise that resolves to the transaction hash, or throws on error\n */\n async withdraw(bridgeIdentifier: string, amount: string, recipient: string): Promise<string> {\n const action = this.loadAction();\n\n // Bridge tokens in a single operation\n const bridgeResult = await action.bridgeTokens(bridgeIdentifier, amount, recipient);\n if (!bridgeResult.data?.tx_hash) {\n throw new Error(\"Bridge tokens operation failed: no transaction hash returned\");\n }\n\n // Wait for bridge transaction to be mined - let waitForTx errors bubble up\n try {\n await this.waitForTx(bridgeResult.data.tx_hash);\n } catch (error) {\n throw new Error(`Bridge tokens transaction failed: ${error instanceof Error ? error.message : String(error)}`);\n }\n\n // Return the transaction hash\n return bridgeResult.data.tx_hash;\n }\n\n /**\n * Lists wallet rewards for a specific bridge instance\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"sepolia\", \"hoodi_tt\")\n * @param wallet The wallet address to list rewards for\n * @param withPending Whether to include pending rewards\n * @returns Promise that resolves to an array of rewards data\n * @deprecated This method uses the extension namespace directly. Most users should use getWithdrawalProof instead.\n */\n async listWalletRewards(bridgeIdentifier: string, wallet: string, withPending: boolean): Promise<any[]> {\n const action = this.loadAction();\n return action.listWalletRewards(bridgeIdentifier, wallet, withPending);\n }\n\n /**\n * Gets withdrawal proof for a specific bridge instance\n * Returns merkle proofs and validator signatures needed for claiming withdrawals on the destination chain\n *\n * This method is used for non-custodial bridge withdrawals where users need to\n * manually claim their withdrawals by submitting proofs to the destination chain contract.\n * The proof includes validator signatures, merkle root, block hash, and amount.\n *\n * @param bridgeIdentifier The bridge instance identifier (e.g., \"hoodi_tt\", \"sepolia\", \"ethereum\")\n * @param walletAddress The wallet address to get withdrawal proof for\n * @returns Promise that resolves to an array of withdrawal proof data (empty array if no unclaimed withdrawals)\n *\n * @example\n * ```typescript\n * // Get withdrawal proofs for Hoodi Test Token bridge\n * const proofs = await client.getWithdrawalProof(\"hoodi_tt\", \"0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb\");\n *\n * // Proofs will be an array like:\n * // [{\n * // chain: \"hoodi\",\n * // chain_id: \"3639\",\n * // contract: \"0x878D6aaeB6e746033f50B8dC268d54B4631554E7\",\n * // created_at: 3080,\n * // recipient: \"0x...\",\n * // amount: \"100000000000000000000\",\n * // block_hash: <base64-encoded>,\n * // root: <base64-encoded>,\n * // proofs: [],\n * // signatures: [<base64-encoded-signatures>]\n * // }]\n *\n * // Use the proofs to claim withdrawal on destination chain\n * if (proofs.length > 0) {\n * const proof = proofs[0];\n * await bridgeContract.claimWithdrawal(proof.recipient, proof.amount, proof.root, proof.proofs, proof.signatures);\n * }\n * ```\n *\n * @note This method has been tested via integration tests in the node repository.\n * See: https://github.com/trufnetwork/kwil-db/blob/main/node/exts/erc20-bridge/erc20/meta_extension_withdrawal_test.go\n */\n async getWithdrawalProof(bridgeIdentifier: string, walletAddress: string): Promise<WithdrawalProof[]> {\n const action = this.loadAction();\n return action.getWithdrawalProof(bridgeIdentifier, walletAddress);\n }\n\n /**\n * Gets taxonomies for specific streams in batch.\n * High-level wrapper for ComposedAction.getTaxonomiesForStreams()\n * \n * @param params Stream locators and options\n * @returns Promise resolving to taxonomy query results\n * \n * @example\n * ```typescript\n * const streams = [\n * { dataProvider: provider1, streamId: streamId1 },\n * { dataProvider: provider2, streamId: streamId2 }\n * ];\n * const taxonomies = await client.getTaxonomiesForStreams({\n * streams,\n * latestOnly: true\n * });\n * ```\n */\n async getTaxonomiesForStreams(params: GetTaxonomiesForStreamsParams): Promise<TaxonomyQueryResult[]> {\n const composedAction = this.loadComposedAction();\n return composedAction.getTaxonomiesForStreams(params);\n }\n\n /**\n * Get the default chain id for a provider. Use with caution, as this decreases the security of the TN.\n * @param provider - The provider URL.\n * @returns A promise that resolves to the chain ID.\n */\n public static async getDefaultChainId(provider: string) {\n const kwilClient = new Client({\n kwilProvider: provider,\n });\n const chainInfo = await kwilClient[\"chainInfoClient\"]();\n return chainInfo.data?.chain_id;\n }\n\n /*\n * High-level role-management helpers. These wrap the lower-level\n * RoleManagement contract calls and expose a simpler API on the\n * TN client.\n */\n\n /** Grants a role to one or more wallets. */\n async grantRole(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallets: EthereumAddress | EthereumAddress[];\n synchronous?: boolean;\n }): Promise<string> {\n const rm = this.loadRoleManagementAction();\n const walletsArr: EthereumAddress[] = Array.isArray(input.wallets)\n ? input.wallets\n : [input.wallets];\n const tx = await rm.grantRole(\n {\n owner: input.owner,\n roleName: input.roleName,\n wallets: walletsArr,\n },\n input.synchronous,\n );\n return tx.data?.tx_hash as unknown as string;\n }\n\n /** Revokes a role from one or more wallets. */\n async revokeRole(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallets: EthereumAddress | EthereumAddress[];\n synchronous?: boolean;\n }): Promise<string> {\n const rm = this.loadRoleManagementAction();\n const walletsArr: EthereumAddress[] = Array.isArray(input.wallets)\n ? input.wallets\n : [input.wallets];\n const tx = await rm.revokeRole(\n {\n owner: input.owner,\n roleName: input.roleName,\n wallets: walletsArr,\n },\n input.synchronous,\n );\n return tx.data?.tx_hash as unknown as string;\n }\n\n /**\n * Checks if a wallet is member of a role.\n * Returns true if the wallet is a member.\n */\n async isMemberOf(input: {\n owner: OwnerIdentifier;\n roleName: string;\n wallet: EthereumAddress;\n }): Promise<boolean> {\n const rm = this.loadRoleManagementAction();\n const res = await rm.areMembersOf({\n owner: input.owner,\n roleName: input.roleName,\n wallets: [input.wallet],\n });\n return res.length > 0 && res[0].isMember;\n }\n\n /**\n * Lists role members \u2013 currently unsupported in the\n * smart-contract layer.\n */\n async listRoleMembers(input: {\n owner: OwnerIdentifier;\n roleName: string;\n limit?: number;\n offset?: number;\n }): Promise<import(\"../types/role\").RoleMember[]> {\n const rm = this.loadRoleManagementAction();\n return rm.listRoleMembers({\n owner: input.owner,\n roleName: input.roleName,\n limit: input.limit,\n offset: input.offset,\n });\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA8E;AAC9E,4BAAiH;AACjH,0BAA6B;AAC7B,0BAA6B;AAC7B,6BAAgC;AAChC,oBAAwE;AAIxE,6BAAgC;AAEhC,yBAA4B;AAC5B,iCAAoC;AACpC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