Skip to content

Commit 21142d8

Browse files
committed
feat: support BN params, return BN instead of strings and signers rework
1 parent f7229f8 commit 21142d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2768
-14086
lines changed

README.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ import { Gasp } from 'gasp-sdk';
5252

5353
const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/', {
5454
debug: true,
55-
// Optionally, pass a signer so it's not required in every call
56-
signer,
5755
// Optionally, pass a custom logger instance if needed
5856
logger,
5957
}).catch((e) => {
@@ -65,20 +63,19 @@ const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/', {
6563

6664
#### Signer
6765

68-
The SDK allows you to pass a signer instance during initialization. This is useful if you want to avoid passing the signer for every call. The signer should implement the necessary methods for signing transactions.
66+
The SDK allows you to pass a signer instance after the initialization. This is useful if you want to avoid passing the signer for every call. The signer should implement the necessary methods for signing transactions.
6967

7068
To use signer provided by the SDK, you can initialize it as follows:
7169

7270
```ts
7371
import { Gasp } from 'gasp-sdk';
7472

7573
const pk = '...';
76-
const signer = Gasp.defaultSigner.create(pk);
77-
78-
const sdk = await Gasp.create('...', { signer });
74+
const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/');
75+
sdk.setSigner(sdk.signers.ethers.create(pk))
7976
```
8077

81-
In case you want to use your own signer, you can implement the `Signer` interface and pass it to the SDK. Example implementation can be found [here](./packages/sdk/src/modules/core/EthersSigner.ts).
78+
In case you want to use your own signer, you can implement the `Signer` interface and pass it to the SDK. Example implementation can be found [here](./packages/sdk/src/modules/signer/EthersSigner.ts).
8279

8380
#### Logger
8481

@@ -130,9 +127,9 @@ The Pool module enables operations related to liquidity pools
130127
```ts
131128
import { Gasp, PoolType } from 'gasp-sdk';
132129

133-
const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/', {
134-
signer: Gasp.defaultSigner.create('...'),
135-
});
130+
const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/');
131+
132+
sdk.setSigner(sdk.signers.ethers.create('...'));
136133

137134
// Retrieve pools information
138135
const pools = await sdk.pool.getPools();
@@ -166,7 +163,7 @@ import { Gasp, PoolType } from 'gasp-sdk';
166163

167164
const sdk = await Gasp.create('wss://rollup-prod-rpc.gasp.xyz/');
168165

169-
const signer = Gasp.defaultSigner.create('...');
166+
const signer = sdk.signers.ethers.create('...');
170167

171168
// Create a new pool
172169
const result = await sdk.rewards

0 commit comments

Comments
 (0)