Skip to content

Commit

Permalink
Merge branch 'refs/heads/docs/typedoc-v2' into docs/typedoc
Browse files Browse the repository at this point in the history
  • Loading branch information
david weil committed Sep 4, 2024
2 parents 6146a46 + fea3502 commit 994e7dd
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .config/typedoc.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import pkgInfo from "../package.json" assert { type: "json" }
import path from "node:path"

const entryPoints = Object.keys(pkgInfo.exports).map(i => {
const exportEndpoint = i === "." ? "./XLinkSDK" : i
const exportEndpoint = i === "." ? "./index" : i
const exportEndpointFilePath = path.join("../src", exportEndpoint) + ".ts"
return exportEndpointFilePath
})
Expand Down
39 changes: 23 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Ensure you have the following installed:
### Installation
To install the XLink SDK, use the following command:
```bash
pnpm install @xlink-project/xlink-sdk
pnpm install @xlink-network/xlink-sdk
```

## XLink SDK API
Expand Down Expand Up @@ -58,31 +58,32 @@ The `KnownTokenId` namespace manages the token IDs of supported cryptocurrencies

Note: Users can transfer between different coins/tokens, not just the same token on different blockchains. For example, it's possible to convert BTC to WBTC when moving from Bitcoin to an EVM network.


### XLink SDK
The `XLinkSDK` object contains the most important functions of this library, all grouped together. To create it:
The [`XLinkSDK`](https://releases-latest.xlink-sdk.pages.dev/modules/XLinkSDK) object contains the most important functions of this library, all grouped together. To create it:

```typescript
const theSdk = new XLinkSDK();
```

For detailed API documentation, including a full list of available methods and their usage, please refer to:

[SDK API Documentation](https://docs-typedoc.xlink-sdk.pages.dev/classes/XLinkSDK.XLinkSDK)
[SDK API Documentation](https://releases-latest.xlink-sdk.pages.dev)

### USE CASES
### Use Cases

Create an instance of the SDK with default options
```typescript
import{ XLinkSDK } from '@xlink-project/xlink-sdk/src';

import{ XLinkSDK } from '@xlink-network/xlink-sdk';
const xlinkSdk = new XLinkSDK();
```
1. Bridge from Stacks
```typescript
import { BridgeInfoFromStacksInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeInfoFromStacks';
import { BridgeFromStacksInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeFromStacks';
import { KnownChainId, KnownTokenId } from '@xlink-project/xlink-sdk/src/utils/types/knownIds';
import{
BridgeInfoFromStacksInput,
BridgeFromStacksInput,
KnownChainId,
KnownTokenId,
} from '@xlink-network/xlink-sdk';

// Get bridge info
const bridgeInfo = await xlinkSdk.bridgeInfoFromStacks({
Expand Down Expand Up @@ -124,9 +125,12 @@ console.log("Transaction ID:", result.txid);

2. Bridge from EVM
```typescript
import { BridgeInfoFromEVMInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeInfoFromEVM';
import { BridgeFromEVMInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeFromEVM';
import { KnownChainId, KnownTokenId } from '@xlink-project/xlink-sdk/src/utils/types/knownIds';
import {
BridgeInfoFromEVMInput,
BridgeFromEVMInput,
KnownChainId,
KnownTokenId,
} from '@xlink-network/xlink-sdk';

// Get bridge info
const bridgeInfo = await xlinkSdk.bridgeInfoFromEVM({
Expand All @@ -153,9 +157,12 @@ console.log("Transaction ID:", result.txHash);

3. Bridge from Bitcoin
```typescript
import { BridgeInfoFromBitcoinInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeInfoFromBitcoin';
import { BridgeFromBitcoinInput } from '@xlink-project/xlink-sdk/src/xlinkSdkUtils/bridgeFromBitcoin';
import { KnownChainId, KnownTokenId } from '@xlink-project/xlink-sdk/src/utils/types/knownIds';
import {
BridgeInfoFromBitcoinInput,
BridgeFromBitcoinInput,
KnownChainId,
KnownTokenId,
} from '@xlink-network/xlink-sdk';

// Get bridge info
const bridgeInfo = await xlinkSdk.bridgeInfoFromBitcoin({
Expand Down
40 changes: 40 additions & 0 deletions docs/project-branch-model.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Project Branch Model

## Branch Structure

- `master`
- `snapshots/*` (including `feature/*`, `fix/*`, etc.)
- `releases/latest`
- `releases/v*`

## Branch Descriptions

### Main Branch

The `master` branch is our blessed branch, has the latest code and documentation.

### Working Branches

`snapshots/*`, `feature/*`, `fix/*`, and other similar branches are used as working branches for ongoing development.

### Release Branches

- `releases/v*`: Specific version release branches
- `releases/latest`: Always points to the latest release branch

## Workflow

1. Development occurs in working branches (`snapshots/*`, `feature/*`, `fix/*`, etc.).

2. Periodic pull requests are created from working branches to `master`, allowing team members to review changes and update corresponding documents.

3. After `master` is updated, working branches are rebased onto `master` to continue development.

4. For public releases:
- Version number is bumped
- Changes are merged into `releases/v*` branches

5. Cloudflare tracks all `releases/*` branches, building and hosting documentation for each version.

6. The `releases/latest` branch is updated to reference the most recent release, ensuring the latest documentation is always available.

0 comments on commit 994e7dd

Please sign in to comment.