Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update old references to the new organization #16

Merged
merged 2 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
name: Bug Report
description: Something with tsn-sdk-js is not working as expected.
description: Something with sdk-js is not working as expected.
title: "Bug: "
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to report an issue. This form is for reporting **bugs in tsn-sdk-js**.
Thank you for taking the time to report an issue. This form is for reporting **bugs in sdk-js**.

When submitting logs, please submit them as text and not as a screenshot.
- type: input
id: version
attributes:
label: Version / Commit
description: Please include the release version or commit hash of tsn-sdk-js you are using. Write `unknown` if you are unsure.
description: Please include the release version or commit hash of sdk-js you are using. Write `unknown` if you are unsure.
placeholder: e.g. v0.1.0 or 1234567890abcdef
validations:
required: true
Expand All @@ -38,15 +38,15 @@ body:
attributes:
label: Expected Behavior
description: Please describe what you expected to happen.
placeholder: e.g. I expected tsn-sdk-js to do X when I did Y
placeholder: e.g. I expected sdk-js to do X when I did Y
validations:
required: true
- type: textarea
id: actual_behavior
attributes:
label: Actual Behavior
description: Please describe what actually happened.
placeholder: e.g. tsn-sdk-js did Z instead of X when I did Y
placeholder: e.g. sdk-js did Z instead of X when I did Y
validations:
required: true
- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Ask a question
url: https://github.com/truflation/tsn-sdk-js/discussions
url: https://github.com/trufnetwork/sdk-js/discussions
about: Please ask and answer questions here
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature-request.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Feature Request
description: Suggest a new feature or change for tsn-sdk-js.
description: Suggest a new feature or change for sdk-js.
title: "Feature Request: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thank you for taking the time to suggest a feature or change. This form is for suggesting **features or changes to tsn-sdk-js**.
Thank you for taking the time to suggest a feature or change. This form is for suggesting **features or changes to sdk-js**.

Feel free to discuss or mull over potential features.
- type: textarea
Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# TSN SDK JS
# TN SDK JS

The TSN SDK provides developers with tools to interact with the Truflation Stream Network, a decentralized platform for publishing, composing, and consuming economic data streams.
The TN SDK provides developers with tools to interact with the Truf Network, a decentralized platform for publishing, composing, and consuming economic data streams.

## Quick Start

Expand All @@ -9,33 +9,33 @@ The TSN SDK provides developers with tools to interact with the Truflation Strea

### Installation
```bash
npm install @truflation/tsn-sdk-js
npm install @trufnetwork/sdk-js
# or your preferred package manager
```

### Environment-specific Usage

```ts
// For Node.js applications
import { NodeTSNClient } from "@truflation/tsn-sdk-js";
import { NodeTNClient } from "@trufnetwork/sdk-js";

// For browser applications
import { BrowserTSNClient } from "@truflation/tsn-sdk-js";
import { BrowserTNClient } from "@trufnetwork/sdk-js";
```

### Example Usage

```ts
import { NodeTSNClient, StreamId } from "@truflation/tsn-sdk-js";
import { NodeTNClient, StreamId } from "@trufnetwork/sdk-js";

// Initialize client
const client = new NodeTSNClient({
const client = new NodeTNClient({
endpoint: "https://staging.tsn.truflation.com",
signerInfo: {
address: wallet.address,
signer: wallet, // Any object that implements signMessage
},
chainId: "tsn-1", // or use NodeTSNClient.getDefaultChainId()
chainId: "tsn-1", // or use NodeTNClient.getDefaultChainId()
});

// Deploy and initialize a stream
Expand Down Expand Up @@ -63,18 +63,18 @@ const data = await stream.getRecord({
```

For a complete working example:
- Check our [TSN SDK Demo Repository](https://github.com/truflation/tsn-sdk-demo)
- Check our [TN SDK Demo Repository](https://github.com/truflation/tsn-sdk-demo)
- Try the [Live Demo on CodeSandbox](https://codesandbox.io/p/devbox/m2r3tt?file=%2Fsrc%2Froutes%2F%2Bpage.svelte)
- Try reading from [a Truflation Stream on CodeSandbox with NodeJS](https://codesandbox.io/p/devbox/rtm7mn?file=%2Findex.ts%3A22%2C11)

## Stream Types

TSN supports two main types of streams:
TN supports two main types of streams:

- **Primitive Streams**: Direct data sources from providers
- **Composed Streams**: Aggregate data from multiple streams using weights

More information about TSN components can be found in the [Go TSN-SDK Documentation](https://github.com/truflation/tsn-sdk/blob/main/docs/readme.md).
More information about TN components can be found in the [Js TN-SDK Documentation](https://github.com/trufnetwork/sdk-js/blob/main/docs/api-reference.md).

## Documentation

Expand All @@ -88,7 +88,7 @@ A staging network is available at https://staging.tsn.truflation.com for testing

## Support

For support, please [open an issue](https://github.com/truflation/tsn-sdk-js/issues).
For support, please [open an issue](https://github.com/trufnetwork/sdk-js/issues).

## License

Expand Down
8 changes: 4 additions & 4 deletions docs/api-reference.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# API Reference

For detailed information about TSN concepts and operations, please refer to the [Go SDK Documentation](https://github.com/truflation/tsn-sdk/blob/main/docs/readme.md).
For detailed information about TN concepts and operations, please refer to the [Js SDK Documentation](https://github.com/trufnetwork/sdk-js/blob/main/docs/api-reference.md).

## Client Initialization

```typescript
import { NodeTSNClient, BrowserTSNClient } from "@truflation/tsn-sdk-js";
import { NodeTNClient, BrowserTNClient } from "@trufnetwork/sdk-js";

const client = new NodeTSNClient({
const client = new NodeTNClient({
endpoint: "https://staging.tsn.truflation.com",
signerInfo: {
address: wallet.address,
Expand All @@ -17,7 +17,7 @@ const client = new NodeTSNClient({
});

// Get chain ID automatically
const chainId = await NodeTSNClient.getDefaultChainId(endpoint);
const chainId = await NodeTNClient.getDefaultChainId(endpoint);
```

## Stream Operations
Expand Down
10 changes: 5 additions & 5 deletions docs/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

## Stream Types

TSN supports two types of streams:
TN supports two types of streams:

- **Primitive Streams**: Single data source streams that store raw values
- **Composed Streams**: Aggregate multiple streams with configurable weights

```typescript
import { StreamType } from "@truflation/tsn-sdk-js";
import { StreamType } from "@trufnetwork/sdk-js";

// Available stream types
StreamType.Primitive // Single data source
StreamType.Composed // Aggregates multiple streams with weights
```

For detailed information about stream types and their use cases, see the [Go SDK Documentation](https://github.com/truflation/tsn-sdk/blob/main/docs/readme.md).
For detailed information about stream types and their use cases, see the [Js SDK Documentation](https://github.com/trufnetwork/sdk-js/blob/main/README.md).

## Error Handling

Expand Down Expand Up @@ -52,7 +52,7 @@ const streamId = await StreamId.generate("my-unique-name");
Streams support granular permissions for both reading and composing:

```typescript
import { visibility } from "@truflation/tsn-sdk-js";
import { visibility } from "@trufnetwork/sdk-js";

// Set visibility
await stream.setReadVisibility(visibility.private);
Expand Down Expand Up @@ -81,5 +81,5 @@ if (tx.data?.tx_hash) {
## Further Reading

- [Integration Tests](../tests/integration) - Usage examples
- [Go SDK Documentation](https://github.com/truflation/tsn-sdk/blob/main/docs/readme.md) - Detailed TSN concepts
- [Js SDK Documentation](https://github.com/trufnetwork/sdk-js/blob/main/README.md) - Detailed TN concepts
- [monads-io Documentation](https://github.com/AlexXanderGrib/monads-io) - Error handling patterns
20 changes: 10 additions & 10 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
# Getting Started with TSN SDK JS
# Getting Started with TN SDK JS

## Prerequisites
- Node.js 18 or later

## Installation

```bash
npm install @truflation/tsn-sdk-js
npm install @trufnetwork/sdk-js
# or
pnpm install @truflation/tsn-sdk-js
pnpm install @trufnetwork/sdk-js
# or
yarn add @truflation/tsn-sdk-js
yarn add @trufnetwork/sdk-js
```

## Quick Start

```typescript
import { NodeTSNClient, StreamId } from "@truflation/tsn-sdk-js";
import { NodeTNClient, StreamId } from "@trufnetwork/sdk-js";
import { Wallet } from "ethers";

// Initialize client
const wallet = new Wallet(privateKey);
const chainId = await NodeTSNClient.getDefaultChainId("https://staging.tsn.truflation.com");
const chainId = await NodeTNClient.getDefaultChainId("https://staging.tsn.truflation.com");

const client = new NodeTSNClient({
const client = new NodeTNClient({
endpoint: "https://staging.tsn.truflation.com",
signerInfo: {
address: wallet.address,
Expand Down Expand Up @@ -61,10 +61,10 @@ The SDK provides optimized clients for different environments:

```typescript
// For Node.js
import { NodeTSNClient } from "@truflation/tsn-sdk-js";
import { NodeTNClient } from "@trufnetwork/sdk-js";

// For browsers
import { BrowserTSNClient } from "@truflation/tsn-sdk-js";
import { BrowserTNClient } from "@trufnetwork/sdk-js";
```

## Next Steps
Expand All @@ -75,4 +75,4 @@ import { BrowserTSNClient } from "@truflation/tsn-sdk-js";

## Support

For support and issues, please visit our [GitHub repository](https://github.com/truflation/tsn-sdk-js/issues).
For support and issues, please visit our [GitHub repository](https://github.com/trufnetwork/sdk-js/issues).
25 changes: 13 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "@truflation/tsn-sdk-js",
"name": "@trufnetwork/sdk-js",
"version": "0.1.0",
"description": "Truflation Stream Network SDK for JavaScript",
"description": "Truf Network SDK for JavaScript",
"type": "module",
"keywords": [
"tsn",
"truf",
"truflation",
"sdk",
"javascript",
Expand Down Expand Up @@ -43,29 +43,30 @@
"prepublishOnly": "npm run build"
},
"dependencies": {
"monads-io": "^4.0.2",
"@kwilteam/kwil-js": "^0.7.3",
"@truflation/tsn-sdk-js": "github:trufnetwork/sdk-js",
"crypto-hash": "^3.1.0",
"lodash": "^4.17.21",
"@kwilteam/kwil-js": "^0.7.3"
"monads-io": "^4.0.2"
},
"devDependencies": {
"@types/lodash": "4.17.12",
"@types/node": "18.18.1",
"glob": "11.0.0",
"@typescript-eslint/eslint-plugin": "8.11.0",
"@typescript-eslint/parser": "8.11.0",
"@types/lodash": "4.17.12",
"disposablestack": "1.1.6",
"esbuild": "0.24.0",
"eslint": "9.13.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jest": "28.8.3",
"eslint-plugin-prettier": "5.2.1",
"eslint-plugin-simple-import-sort": "12.1.1",
"eslint-plugin-unused-imports": "4.1.4",
"disposablestack": "1.1.6",
"esbuild": "0.24.0",
"eslint-import-resolver-alias": "1.1.2",
"eslint-plugin-prettier": "5.2.1",
"eslint": "9.13.0",
"ethers": "6.13.4",
"glob": "11.0.0",
"prettier": "3.3.3",
"tsx": "^4.19.1",
"typescript": "^5.6.3",
Expand Down
8 changes: 4 additions & 4 deletions src/client/browserClient.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { EnvironmentType } from "@kwilteam/kwil-js/dist/core/enums";
import { WebKwil } from "@kwilteam/kwil-js";
import { BaseTSNClient, TSNClientOptions } from "./client";
import { BaseTNClient, TNClientOptions } from "./client";

export class BrowserTSNClient extends BaseTSNClient<EnvironmentType.BROWSER> {
constructor(options: TSNClientOptions) {
export class BrowserTNClient extends BaseTNClient<EnvironmentType.BROWSER> {
constructor(options: TNClientOptions) {
super(options);
this.kwilClient = new WebKwil({
...options,
Expand All @@ -12,4 +12,4 @@ export class BrowserTSNClient extends BaseTSNClient<EnvironmentType.BROWSER> {
}
}

export default BrowserTSNClient;
export default BrowserTNClient;
6 changes: 3 additions & 3 deletions src/client/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { describe, expect, it } from "vitest";
import { ethers } from "ethers";
import { NodeTSNClient } from "./nodeClient";
import { NodeTNClient } from "./nodeClient";

describe.sequential("Client", { timeout: 30000 }, () => {
// Skip in CI, because it needs a local node
Expand All @@ -10,13 +10,13 @@ describe.sequential("Client", { timeout: 30000 }, () => {
"0x0000000000000000000000000000000000000000000000000000000000000001",
);
it("should create a client", async () => {
const chainId = await NodeTSNClient.getDefaultChainId(
const chainId = await NodeTNClient.getDefaultChainId(
"http://localhost:8484",
);
if (!chainId) {
throw new Error("Chain id not found");
}
const client = new NodeTSNClient({
const client = new NodeTNClient({
endpoint: "http://localhost:8484",
signerInfo: {
address: wallet.address,
Expand Down
Loading