Skip to content

Commit

Permalink
Version 0.2.0-beta.4 bigNumber removed (#60)
Browse files Browse the repository at this point in the history
* tests and safe deploy fun

* internal functions mocking

* tests updated

* Signer fix and biconomy get wallets function (#20)

* signer constructor requirement removed

* biconomy get all wallets function added

* types added for multiple params

* testing workflow added

* Sdk bug fixes (#21)

* nft tokenId added

* types file name change

* readme update

* nft transfer gasless updated

* package version changes

* Update README.md

* Update README.md - CRITICAL (#26)

Updated the rebranded form link

* Update README.md (#24)

* Update README.md

Fixed typo

* relayer key added

---------

Co-authored-by: Anshul Yadav <55681256+anshulforyou@users.noreply.github.com>

* estimation implementation for both non gasless and gasless flow (#25)

* gas estimation addition

* fixes

* fixes and tests update

* sig transfer file removed

* insufficient balance unit test added

---------

Co-authored-by: Anshul Yadav <55681256+anshulforyou@users.noreply.github.com>

* Nft edge cases fix (#29)

* duplicate entry bug fix

* amount edge case fix

* optimised and refactored the code

* nft tests updated for gas estimation

* types check added (#30)

* Feat/linting enabled (#31)

* types check added

* linting enabled fix

* pre hook commit

* Cosmetic/code refactoring (#33)

* code division

* native token refactor

* Permit2 transactions refactor

* test fix for not a function issue and some lint rule

* test failed fix added

* minor fixes

---------

Co-authored-by: talhamalik883 <talhamalik883@gmail.com>

* readme bugfix

* test script for both gasless and non gasless and bug fixes (#32)

* test script for both gasless and non gasless and bug fixes

* test fixes

* only balances flag addition

* added scripts as pre-commit hook

* merge changes

* fixes and scripts update

* url fix

---------

Co-authored-by: Anshul Yadav <55681256+anshulforyou@users.noreply.github.com>

* Update README.md (#37)

Updated the booking link with the new team Calendly link.

* Fix/gasless bug (#36)

* gasless bug

* test update

* transaction messages

* formatting

* bug fix

* test fixes

* single permit2 unit test added

* lint changes

* POLYGON fix for USDC permit

* permitToken wait bug fix

* error fix

---------

Co-authored-by: Anshul Yadav <55681256+anshulforyou@users.noreply.github.com>

* arbitrum goerli support added (#38)

* arbitrum goerli support added

* arbitrum goerli scripts added and tested

* version update

* minor changes

* Feat/wallet deployment (#41)

* walelt deployment and native transfer

* formatting

* safe bug fix

* bug fixes

* permit bug fix (#42)

* permit bug fix

* transfer available tokens

---------

Co-authored-by: talhamalik883 <talhamalik883@gmail.com>

* package version update

* readme updated (#45)

* readme updated

* wallet deploy bug fixes

* formatting changes

---------

Co-authored-by: Anshul Yadav <55681256+anshulforyou@users.noreply.github.com>

* minor fixes

* Feat/gasless gelato (#46)

* readme updated

* gasless endpoint integration

* tokenInfo changed to array

* url updated

* test fixes

* gasless updates in sdk

* forward implementation (#48)

* foward implementation

* fixes

* fixes added

* test fix and gasPrice endpoint consumption

* Feat/forward (#51)

* readme updated

* gasless endpoint integration

* tokenInfo changed to array

* url updated

* test fixes

* gasless updates in sdk

* foward implementation

* fixes

* fixes added

* test fix and gasPrice endpoint consumption

* final fixes

* url update

* sepolia support

* msg fix

* package release changes

* minor change

* publish cmd added

* Fix/ux error messages (#54)

* bug fix for ux

* fixes

* gelato package removed (#57)

* BigNumber fixes (#59)

* BigNumber fixes

* BigNumber fixes

* package version update

---------

Co-authored-by: talhamalik883 <talhamalik883@gmail.com>
Co-authored-by: Ari <52634803+theblackmace@users.noreply.github.com>
  • Loading branch information
3 people committed Jan 12, 2024
1 parent 0cb737a commit 09cf1b8
Show file tree
Hide file tree
Showing 15 changed files with 461 additions and 285 deletions.
137 changes: 4 additions & 133 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aarc-sdk",
"version": "0.2.0-beta.3",
"version": "0.2.0-beta.4",
"description": "The Aarc SDK is a TypeScript library that makes it easy for developers to transfer assets from Externally Owned Accounts (EOA) to any destination address. It simplifies the asset transfer process by supporting various token standards, such as ERC20 and ERC721, and offering custom flows like batched transactions, gasless transactions, and paying gas fees with the same asset being moved. Additionally, it enables custom contract interaction within the same transaction using permit2(), allowing for direct swaps and bridge functionality.",
"main": "dist/index.js",
"scripts": {
Expand Down Expand Up @@ -70,7 +70,6 @@
"@biconomy/modules": "^3.1.0",
"@biconomy/node-client": "^3.1.0",
"@ethersproject/hash": "^5.7.0",
"@gelatonetwork/relay-sdk": "^5.5.2",
"@safe-global/api-kit": "^1.3.1",
"@safe-global/protocol-kit": "^1.3.0",
"@safe-global/safe-deployments": "^1.28.0",
Expand Down
2 changes: 0 additions & 2 deletions scripts/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ dotenv.config();
export const PRIVATE_KEY = process.env.PRIVATE_KEY || "";
export const RPC_URL = process.env.RPC_URL || "";
export const API_KEY = process.env.API_KEY || "";
export const GELATO_API_KEY = process.env.GELATO_API_KEY || "";
export const DAPP_API_KEY = process.env.DAPP_API_KEY || ""


Expand Down Expand Up @@ -85,7 +84,6 @@ export const validateEnvironmentVariables = () => {
if (!PRIVATE_KEY) missingVariables.push('PRIVATE_KEY');
if (!RPC_URL) missingVariables.push('RPC_URL');
if (!API_KEY) missingVariables.push('API_KEY');
if (!GELATO_API_KEY) missingVariables.push('GELATO_API_KEY');

if (missingVariables.length > 0) {
throw new Error(`Missing environment variables: ${missingVariables.join(', ')}`);
Expand Down
8 changes: 4 additions & 4 deletions scripts/Forward.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export const mintAndTransferErc20Tokens = async () => {
senderSigner: signer,
receiverAddress: "0x786E6045eacb96cAe0259cd761e151b68B85bdA7",
transferTokenDetails: [
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000") },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("300000") },
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("300000")._hex },
]
})
console.log('ResultSet ', resultSet);
Expand Down
16 changes: 10 additions & 6 deletions scripts/Gasless.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ export const mintAndTransferErc20Tokens = async () => {
for (const tokenName in tokenAddresses[chainId]) {
console.log(' tokenName ', tokenName);
const { address, decimals } = tokenAddresses[chainId][tokenName as keyof typeof TokenName];

if (!address)
continue

const token = balances.data.find(token => {
return token.token_address.toLowerCase() === address.toLowerCase()
})
Expand All @@ -87,10 +91,10 @@ export const mintAndTransferErc20Tokens = async () => {
senderSigner: signer,
receiverAddress: "0x786E6045eacb96cAe0259cd761e151b68B85bdA7",
transferTokenDetails: [
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000") },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("30000") },
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("30000")._hex },
]
})
console.log('ResultSet ', resultSet);
Expand Down Expand Up @@ -146,7 +150,7 @@ export const transferErc20Tokens = async () => {


if (token) {
transferTokenDetails.push({ tokenAddress: address, amount: token.balance })
transferTokenDetails.push({ tokenAddress: address, amount: (token.balance)._hex })
}

}
Expand Down Expand Up @@ -209,7 +213,7 @@ export const transferFullNativeOnly = async () => {
const resultSet = await aarcSDK.executeMigrationGasless({
senderSigner: signer,
receiverAddress: '0x786E6045eacb96cAe0259cd761e151b68B85bdA7',
transferTokenDetails: [{ tokenAddress: '0x0000000000000000000000000000000000001010', amount: BigNumber.from(1000) }]
transferTokenDetails: [{ tokenAddress: '0x0000000000000000000000000000000000001010', amount: BigNumber.from(1000)._hex }]
})
console.log('ResultSet ', resultSet);

Expand Down
12 changes: 6 additions & 6 deletions scripts/NonGasless.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { BigNumber, ethers } from "ethers";
import { AarcSDK } from '../src';
import { RPC_URL, PRIVATE_KEY, API_KEY, GELATO_API_KEY, nativeTokenAddress, tokenAddresses, TokenName, ChainID, nativeTokenAddresses, MUMBAI_NFT_ADDRESS, validateEnvironmentVariables } from "./Constants";
import { RPC_URL, PRIVATE_KEY, API_KEY, tokenAddresses, TokenName, ChainID, nativeTokenAddresses, MUMBAI_NFT_ADDRESS, validateEnvironmentVariables } from "./Constants";
import { ERC20_ABI } from '../src/utils/abis/ERC20.abi';
import { ERC721_ABI } from "../src/utils/abis/ERC721.abi";
import { delay } from "../src/helpers";
Expand Down Expand Up @@ -65,10 +65,10 @@ export const transferErc20Tokens = async () => {
senderSigner: signer,
receiverAddress: "0x786E6045eacb96cAe0259cd761e151b68B85bdA7",
transferTokenDetails: [
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000") },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000") },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("30000000000000000") },
{ tokenAddress: tokenAddresses[chainId].USDA1.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDB.address, amount: BigNumber.from("100000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDA2.address, amount: BigNumber.from("500000000")._hex },
{ tokenAddress: tokenAddresses[chainId].USDC.address, amount: BigNumber.from("30000000000000000")._hex },
],
})
console.log('ResultSet ', resultSet);
Expand Down Expand Up @@ -126,7 +126,7 @@ export const transferFullNativeOnly = async () => {
const resultSet = await aarcSDK.executeMigration({
senderSigner: signer,
receiverAddress: '0x786E6045eacb96cAe0259cd761e151b68B85bdA7',
transferTokenDetails: [{tokenAddress: '0x0000000000000000000000000000000000001010', amount: BigNumber.from(1000)}],
transferTokenDetails: [{tokenAddress: '0x0000000000000000000000000000000000001010', amount: BigNumber.from(1000)._hex}],
})
console.log('ResultSet ', resultSet);

Expand Down
Loading

0 comments on commit 09cf1b8

Please sign in to comment.