From 7ee2e961a14094c948fbe0cc6b89ce3b3b82b6f5 Mon Sep 17 00:00:00 2001
From: HoangVD2 <102846781+HoangVD2@users.noreply.github.com>
Date: Tue, 16 Apr 2024 14:26:40 +0700
Subject: [PATCH 1/5] feat: add Chatbase.co (#35)
* feat: add Chatbase.co
* chore: update Chatbot ID
---
.vitepress/config.ts | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/.vitepress/config.ts b/.vitepress/config.ts
index ba77dae9e..d8dcf64b8 100644
--- a/.vitepress/config.ts
+++ b/.vitepress/config.ts
@@ -87,8 +87,9 @@ export default {
"script",
{},
`
- window.chatbaseConfig = {
- chatbotId: "",
+ window.embeddedChatbotConfig = {
+ chatbotId: "EQaK-bS8IoS60vEkoYKQm",
+ domain: "www.chatbase.co"
}
`,
],
@@ -96,6 +97,7 @@ export default {
"script",
{
src: "https://www.chatbase.co/embed.min.js",
+ chatbotId: "EQaK-bS8IoS60vEkoYKQm",
id: "",
defer: true,
},
From 25cb1573ce8f77bacab23c240a4c9ccfedd80680 Mon Sep 17 00:00:00 2001
From: dp <25910069+davidp94@users.noreply.github.com>
Date: Tue, 16 Apr 2024 11:05:20 +0300
Subject: [PATCH 2/5] chore: remove get Transactions indexers API
---
indexers/indexers-api.md | 165 ---------------------------------------
1 file changed, 165 deletions(-)
diff --git a/indexers/indexers-api.md b/indexers/indexers-api.md
index b4dcbcd74..fd1638594 100644
--- a/indexers/indexers-api.md
+++ b/indexers/indexers-api.md
@@ -152,171 +152,6 @@ await fetch(GRAPHQL_ENDPOINT, {
-## Get Activity History
-
-::: code-group
-
-```javascript [EVM Chain]
-const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql";
-const query = `query GetTransactions($address: String!, $first: Int, $after: String) {
- ${chain.key} { // [!code highlight]
- transactions(address: $address, first: $first, after: $after) {
- edges {
- node {
- blockNumber
- hash
- status
- timestamp
- transfers {
- amount {
- value
- }
- fromAddress
- toAddress
- }
- }
- }
- pageInfo {
- hasNextPage
- hasPreviousPage
- }
- }
- }
-}`;
-
-await fetch(GRAPHQL_ENDPOINT, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- "apollographql-client-name": "docs-indexers-api",
- "apollographql-client-version": "v1.0",
- },
- body: JSON.stringify({
- query,
- variables: {
- address: address // Input address // [!code highlight]
- first: 1,
- after: null,
- },
- }),
-})
- .then((response) => response.json())
- .then((result) => {
- console.log(result);
- // Do something with the result
- });
-```
-
-```javascript [CosmosChain]
-const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql";
-const query = `query GetTransactions($address: String!, $first: Int, $after: String) {
- ${chain.key} { // [!code highlight]
- transactions(address: $address, first: $first, after: $after) {
- edges {
- node {
- blockHeight
- hash
- signers
- status
- timestamp
- transfers {
- amount {
- value
- }
- fromAddress
- toAddress
- }
- }
- }
- pageInfo {
- hasPreviousPage
- hasNextPage
- }
- }
- }
-}`;
-
-await fetch(GRAPHQL_ENDPOINT, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- "apollographql-client-name": "docs-indexers-api",
- "apollographql-client-version": "v1.0",
- },
- body: JSON.stringify({
- query,
- variables: {
- address: address // Input address // [!code highlight]
- first: 1,
- after: null,
- },
- }),
-})
- .then((response) => response.json())
- .then((result) => {
- console.log(result);
- // Do something with the result
- });
-```
-
-```javascript [Other Chain]
-const GRAPHQL_ENDPOINT = "https://gql-router.xdefi.services/graphql";
-const query = `query GetTransactions($address: String!, $first: Int!, $after: String) {
- ${chain.key} { // [!code highlight]
- transactionsV3(address: $address, first: $first, after: $after) {
- edges {
- node {
- blockNumber
- hash
- status
- timestamp
- inputs {
- amount {
- value
- }
- address
- }
- outputs {
- amount {
- value
- }
- address
- }
- }
- }
- pageInfo {
- hasNextPage
- hasPreviousPage
- }
- }
- }
-}`;
-
-await fetch(GRAPHQL_ENDPOINT, {
- method: "POST",
- headers: {
- "Content-Type": "application/json",
- },
- body: JSON.stringify({
- query,
- variables: {
- address: address // Input address // [!code highlight]
- first: 1,
- after: null,
- },
- }),
-})
- .then((response) => response.json())
- .then((result) => {
- console.log(result);
- // Do something with the result
- });
-```
-
-:::
-
-
-
## Get Gas Fee
::: code-group
From 0b17fb11d15fad209033096b91a95b517174b65e Mon Sep 17 00:00:00 2001
From: "Justin (HoangVD2)"
Date: Wed, 10 Apr 2024 15:39:31 +0700
Subject: [PATCH 3/5] docs: add content for Chains Lib Documentation
---
chains-lib/chains-lib.md | 130 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 128 insertions(+), 2 deletions(-)
diff --git a/chains-lib/chains-lib.md b/chains-lib/chains-lib.md
index c3771f810..7953f78a4 100644
--- a/chains-lib/chains-lib.md
+++ b/chains-lib/chains-lib.md
@@ -1,3 +1,129 @@
-# Chains Lib
+# Chains Lib Documentation
-Coming soon...
+[Chainslib](https://github.com/XDeFi-tech/chains) is a TypeScript library is designed to provide a unified interface for working with multiple blockchain networks, allowing developers to interact with various blockchain chains seamlessly. It supports a wide range of features and blockchain networks, making it a versatile tool for blockchain development.
+
+## Features
+
+Chainslib offers the following key features:
+
+- **Hardware Wallet Support:** It provides integration with Ledger and Trezor hardware wallets for enhanced security in blockchain transactions.
+- **Wallet Types:** You can work with both seed phrase and private key wallets for managing your blockchain assets.
+- **Standardized RPC Interface:** The library offers a consistent RPC interface for fetching blockchain information and broadcasting transactions across different supported chains.
+
+## Supported Chains
+
+
+Chainslib currently supports the following blockchain networks:
+
+- Bitcoin
+- Bitcoin Cash
+- Litecoin
+- Dogecoin
+- Ethereum
+- BNB Smart Chain
+- Avalanche
+- Polygon
+- Optimism
+- Arbitrum
+- Fantom
+- Other EVM-compatible chains
+- Cosmos
+- Osmosis
+- Juno
+- Other IBC-Compatible Chains
+- THORChain
+- BNB Beacon Chain
+- Solana
+
+
+
+## Installation
+
+To use Chainslib in your TypeScript project, you can install it via npm or yarn:
+
+```bash
+npm install @xdefi-tech/chains
+# or
+yarn add @xdefi-tech/chains
+```
+
+## Usage
+
+Here's a basic example of how to use this library in your TypeScript application:
+
+### 1. Import Required Modules
+
+```typescript
+import { BitcoinProvider } from "./chain.provider";
+import LedgerSigner from "./ledger.signer";
+import { MsgBody, Msg } from "../msg";
+```
+
+### 2. Initialize Bitcoin Provider
+
+Initialize the Bitcoin provider with the necessary configurations:
+
+```typescript
+const provider = new BitcoinProvider(new IndexerDataSource(BITCOIN_MANIFEST));
+```
+
+### 3. Create Transaction Input
+
+Define the transaction input data, including the sender (from), recipient (to), and the amount to send.
+
+```typescript
+const txInput: MsgBody = {
+ from: "FROM ADDRESS",
+ to: "TO ADDRESS",
+ amount: 0.000001,
+};
+```
+
+### 4. Create a Transaction Message
+
+Create a transaction message using the provider:
+
+```typescript
+const message: Msg = provider.createMsg(txInput);
+```
+
+### 5. Sign the Transaction with Ledger
+
+Use the LedgerSigner to sign the transaction. Provide the message and the derivation path:
+
+```typescript
+const transport = await Transport.create();
+const signer = new LedgerSigner(transport);
+const derivationPath = "m/84'/0'/0'/0/0";
+
+await signer.sign(message, derivationPath);
+// finally close
+transport.close();
+```
+
+### 6. Broadcast the Transaction
+
+Now that the transaction is signed, you can broadcast it to the Bitcoin network using the BitcoinProvider. This step assumes that the transaction is already signed within the `message`.
+
+```typescript
+await provider.broadcast([message]);
+```
+
+## Retrieving a Transaction
+
+### 1. Get Transaction Hash
+
+If you have a transaction hash, you can retrieve the transaction details. Use the `getTransaction` method of the BitcoinProvider:
+
+```typescript
+const txHash = "TX HAS";
+const txData = await provider.getTransaction(txHash);
+```
+
+The `txData` object will contain transaction details, including the transaction hash.
+
+## Disclaimer
+
+This library is provided as-is, and we make no warranties or guarantees regarding its functionality or security. Always exercise caution and proper security practices when working with blockchain assets.
+
+Happy blockchain development! 🚀🔗
From 699a705edc9dceaada702eae3742d82f93c4e777 Mon Sep 17 00:00:00 2001
From: "Justin (HoangVD2)"
Date: Wed, 10 Apr 2024 22:31:36 +0700
Subject: [PATCH 4/5] chore
---
components/GetBalance.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/components/GetBalance.jsx b/components/GetBalance.jsx
index 20a94baec..b237942ec 100644
--- a/components/GetBalance.jsx
+++ b/components/GetBalance.jsx
@@ -202,7 +202,7 @@ const GetBalance = () => {
id="address"
name="Address"
value={address}
- className="max-sm:w-300px] bg-gray-50 text-gray-900 px-2 py-1 dark:bg-gray-700 dark:placeholder-gray-400 dark:text-white"
+ className="max-sm:w-[300px] bg-gray-50 text-gray-900 px-2 py-1 dark:bg-gray-700 dark:placeholder-gray-400 dark:text-white"
placeholder="Enter an address"
onChange={(e) => setAddress(e.target.value)}
/>
From b39020502e61ecf3dee41227e7913ecc163148e8 Mon Sep 17 00:00:00 2001
From: dp <25910069+davidp94@users.noreply.github.com>
Date: Tue, 16 Apr 2024 10:27:06 +0300
Subject: [PATCH 5/5] Update chains-lib.md
---
chains-lib/chains-lib.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/chains-lib/chains-lib.md b/chains-lib/chains-lib.md
index 7953f78a4..60d61e03b 100644
--- a/chains-lib/chains-lib.md
+++ b/chains-lib/chains-lib.md
@@ -1,6 +1,6 @@
# Chains Lib Documentation
-[Chainslib](https://github.com/XDeFi-tech/chains) is a TypeScript library is designed to provide a unified interface for working with multiple blockchain networks, allowing developers to interact with various blockchain chains seamlessly. It supports a wide range of features and blockchain networks, making it a versatile tool for blockchain development.
+[Chainslib](https://github.com/XDeFi-tech/chains-lib) is a TypeScript library is designed to provide a unified interface for working with multiple blockchain networks, allowing developers to interact with various blockchain chains seamlessly. It supports a wide range of features and blockchain networks, making it a versatile tool for blockchain development.
## Features