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

Beta #84

Merged
merged 6 commits into from
May 28, 2024
Merged

Beta #84

Changes from 1 commit
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
Prev Previous commit
fix(docs): update
  • Loading branch information
AntonKozAllB committed May 28, 2024
commit ab514e895a065c03bf37c7610e91af4387de7b72
18 changes: 3 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -19,23 +19,21 @@ Provides an easy integration with the Allbridge Core ChainBridgeService for DApp

- [Installing](#installing)
- [How to use](#how-to-use)
- [1. Initialize SDK instance](#1-initialize-sdk-instance)
- [1. Initialize SDK instance](#1-initialize-sdk)
- [2. Get the list of supported tokens](#2-get-the-list-of-supported-tokens)
- [3.1 Approve the transfer of tokens](#31-approve-the-transfer-of-tokens)
- [3.1 Approve the transfer of tokens](#31-approve-the-transfer-of-tokens-only-for-evm-tron)
- [3.2 Send Tokens](#32-send-tokens)
- [Full example](#full-example)
- [Other operations](#other-operations)
- [Liquidity Pools operations](#liquidity-pools-operations)
- [Transaction builder](#transaction-builder)
- [Approve Transaction](#approve-transaction)
- [Send Transaction](#send-transaction)
- [Solana Blockchain](#solana-blockchain)
- [Get information about sent transaction](#get-information-about-sent-transaction)
- [Calculating amount of tokens to be received after fee](#calculating-amount-of-tokens-to-be-received-after-fee)
- [Calculating amount of tokens to send](#calculating-amount-of-tokens-to-send)
- [Getting the amount of gas fee](#getting-the-amount-of-gas-fee)
- [Getting the average transfer time](#getting-the-average-transfer-time)
- [Semver](#semver)

## Installing

@@ -70,8 +68,6 @@ const rawTx = await sdk.bridge.rawTxBuilder.send(sendParams);

#### 2) Initialize SDK instance (using passed provider for blockchains connections)

@Deprecated use the approach described above

```ts
import {AllbridgeCoreSdk, nodeRpcUrlsDefault} from "@allbridge/bridge-core-sdk";

@@ -80,7 +76,7 @@ const sdk = new AllbridgeCoreSdk(nodeRpcUrlsDefault);
const rawTx = await sdk.bridge.rawTxBuilder.send(sendParams, provider);
```

***TIP:*** Use 1.1 in case your provider differs from required by the SDK (Web3:v1.9.0, tronweb:v4.4.0)
***TIP:*** tested and developed for (Web3:v1.9.0, tronweb:v4.4.0), in other case use approach 1)

### 2. Get the list of supported tokens

@@ -215,14 +211,6 @@ SDK method `bridge.rawTxBuilder.send` can be used to create send Transaction.
const rawTransactionSend = await sdk.bridge.rawTxBuilder.send(sendParams);
```

**TIP:** </br>
To interact with the **Solana** blockchain: </br>
do not pass provider param </p>

```ts
const transaction = await sdk.bridge.rawTxBuilder.send(sendParams);
```

***TIP:***
For more details, see [***Example
***](https://github.com/allbridge-io/allbridge-core-js-sdk/blob/main/examples/src/examples/bridge/solana/sol-build-send-tx.js)
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -45,7 +45,7 @@ export interface AllbridgeCoreSdkOptions {
sorobanNetworkPassphrase: string;
/**
* Optional. Will be used in methods</br>
* {@link AllbridgeCoreSdk.pool.getPoolInfoFromChain} and {@link AllbridgeCoreSdk.pool.getAmountToBeWithdrawn}</br>
* {@link LiquidityPoolService.getPoolInfoFromChain} and {@link LiquidityPoolService.getAmountToBeWithdrawn}</br>
* to fetch information from the blockchain with fewer HTTP requests using JSON-RPC API
*/
tronJsonRpc?: string;
2 changes: 1 addition & 1 deletion src/services/models/sol/index.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ import { CctpBridge as CctpBridgeType } from "./types/cctp_bridge";

export type SolanaTxFee = PricePerUnitInMicroLamports | ExtraFeeInLamports | typeof SolanaAutoTxFee;
/**
* Priority Fee will be calculated based on {@link Connection#getRecentPrioritizationFees}
* Priority Fee will be calculated based on {@link @solana/web3.js:Connection.getRecentPrioritizationFees}
*/
export const SolanaAutoTxFee = "AUTO" as const;

Loading