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

SDK Version 0.0.1-beta.5 #34

Merged
merged 20 commits into from
Nov 27, 2023
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
5 changes: 5 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
PRIVATE_KEY=
RPC_URL=
API_KEY=
SDK_DEBUG=
GELATO_API_KEY=
24 changes: 0 additions & 24 deletions .eslintrc.js

This file was deleted.

23 changes: 23 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"env": {
"browser": true,
"es2021": true
},
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint/eslint-plugin"
],
"extends": [
"plugin:@typescript-eslint/recommended"
],
"parserOptions": {
"ecmaVersion": 12,
"sourceType": "module"
},
"rules": {
"@typescript-eslint/interface-name-prefix": "off",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "error"
}
}
9 changes: 9 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint
npm run format
npm run test
npm run execute:nongasless
npm run execute:gasless

1 change: 0 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@ src
tests
.github
jest.config.*
```
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,20 @@ npm install ethers@5.7.2 aarc-sdk

## Get the API Key

To use Aarc SDK, an API key is required. Fill out [this form](https://rebrand.ly/aarc-dashboard) to get the API Key on your email instantly!
To use Aarc SDK, an API key is required. Fill out [this form](https://rebrand.ly/aarc-api) to get the API Key on your email instantly!

## Initialise the SDK

Import and initialise the Aarc SDK in your project.

```typescript
import { ethers } from "ethers";
import { AarcSDK } from "aarc-sdk";

let aarcSDK = new AarcSDK({
rpcUrl: rpcUrl,
chainId: chainId,
apiKey: "YOUR_API_KEY",
});

await aarcSDK.init();
```

# Usage
Expand Down Expand Up @@ -94,7 +91,7 @@ Output:
Transfer tokens from EOA to any receiver wallet address without gas fees. Please note that we use Gelato Relayer to provide the gasless functionality. Please get the Gelato [API Key](https://docs.gelato.network/developer-services/relay/payment-and-fees/1balance-and-relay) to use the gasless functionality.

```typescript
await aarcSDK.executeMigration({
await aarcSDK.executeMigrationGasless({
senderSigner: signer, // ethers.signer object
receiverAddress:RECEIVER_WALLET_ADDRESS,
transferTokenDetails: // Optional. If not passed, the SDK will migrate all the tokens of the wallet
Expand All @@ -106,7 +103,7 @@ await aarcSDK.executeMigration({
},
...
],
GELATO_RELAYER_API_KEY // Use the link above to get the gelato relayer key
gelatoApiKey: GELATO_RELAYER_API_KEY // Use the link above to get the gelato relayer key
})
// Returns the response given below
```
Expand Down Expand Up @@ -151,7 +148,7 @@ const newSafeAddress = await aarcSDK.generateSafeSCW(

### Biconomy Smart Wallet

Fetching Existing Safes:
Fetching Biconomy Smart Wallets:

Retrieve a list of all Biconomy smart wallets associated with the user's EOA:
```typescript
Expand Down
16 changes: 8 additions & 8 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// jest.config.js
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
};
preset: 'ts-jest',
testEnvironment: 'node',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest'
},
setupFiles: ['./tests/EthersMock.ts']
}
Loading
Loading