Skip to content

Commit 898449b

Browse files
authored
Merge pull request #52 from gelatodigital/chore/add-abstract
chore: add abstract
2 parents 8b0dff0 + dc9416c commit 898449b

File tree

8 files changed

+69
-18
lines changed

8 files changed

+69
-18
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@gelatonetwork/relay-sdk",
3-
"version": "5.5.6",
3+
"version": "5.6.0",
44
"description": "SDK to integrate with Gelato Relay",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
@@ -40,10 +40,10 @@
4040
"typescript": "5.0.4"
4141
},
4242
"dependencies": {
43-
"axios": "0.27.2",
43+
"axios": "0.29.0",
4444
"ethers": "6.7.0",
4545
"isomorphic-ws": "^5.0.0",
46-
"ws": "^8.5.0"
46+
"ws": "^8.18.0"
4747
},
4848
"lint-staged": {
4949
"*.{js,json,md,ts}": "yarn format",

src/constants/index.ts

+10
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ export const GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS =
1919
export const GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS =
2020
"0x97015cD4C3d456997DD1C40e2a18c79108FCc412";
2121

22+
export const GELATO_RELAY_ERC2771_ABSTRACT_ADDRESS =
23+
"0xACeD988c5B5Fe3f11848c728D9a5f66Cf34c9e73";
24+
export const GELATO_RELAY_1BALANCE_ERC2771_ABSTRACT_ADDRESS =
25+
"0xD4bb348BD06877F52b0033f444048459108Fd9A0";
26+
2227
export const GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS =
2328
"0x8598806401A63Ddf52473F1B3C55bC9E33e2d73b";
2429
export const GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ADDRESS =
@@ -28,3 +33,8 @@ export const GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS =
2833
"0xBa4082F4961c8Fb76231995C967CD9aa40f321b5";
2934
export const GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS =
3035
"0xB8828e4c662D1a7e4f3d1f622EfAE6B63D852ED8";
36+
37+
export const GELATO_RELAY_CONCURRENT_ERC2771_ABSTRACT_ADDRESS =
38+
"0xbbCe89ACdD86D0130BDc3f1fe37C3aEDd79fc1F4";
39+
export const GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ABSTRACT_ADDRESS =
40+
"0x0BdB9f40DCD2a56b2c5233D9d8d6FD49b5eeadA7";

src/index.ts

+16
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ import {
2828
GELATO_RELAY_URL,
2929
GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,
3030
GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,
31+
GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ABSTRACT_ADDRESS,
32+
GELATO_RELAY_1BALANCE_ERC2771_ABSTRACT_ADDRESS,
33+
GELATO_RELAY_CONCURRENT_ERC2771_ABSTRACT_ADDRESS,
34+
GELATO_RELAY_ERC2771_ABSTRACT_ADDRESS,
3135
} from "./constants";
3236
import { WebsocketHandler } from "./utils/index.js";
3337

@@ -80,9 +84,15 @@ export class GelatoRelay {
8084
relayERC2771zkSync:
8185
config?.contract?.relayERC2771zkSync ??
8286
GELATO_RELAY_ERC2771_ZKSYNC_ADDRESS,
87+
relayERC2771Abstract:
88+
config?.contract?.relayERC2771Abstract ??
89+
GELATO_RELAY_ERC2771_ABSTRACT_ADDRESS,
8390
relay1BalanceERC2771zkSync:
8491
config?.contract?.relay1BalanceERC2771zkSync ??
8592
GELATO_RELAY_1BALANCE_ERC2771_ZKSYNC_ADDRESS,
93+
relay1BalanceERC2771Abstract:
94+
config?.contract?.relay1BalanceERC2771Abstract ??
95+
GELATO_RELAY_1BALANCE_ERC2771_ABSTRACT_ADDRESS,
8696
relayConcurrentERC2771:
8797
config?.contract?.relayConcurrentERC2771 ??
8898
GELATO_RELAY_CONCURRENT_ERC2771_ADDRESS,
@@ -92,9 +102,15 @@ export class GelatoRelay {
92102
relayConcurrentERC2771zkSync:
93103
config?.contract?.relayConcurrentERC2771zkSync ??
94104
GELATO_RELAY_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,
105+
relayConcurrentERC2771Abstract:
106+
config?.contract?.relayConcurrentERC2771Abstract ??
107+
GELATO_RELAY_CONCURRENT_ERC2771_ABSTRACT_ADDRESS,
95108
relay1BalanceConcurrentERC2771zkSync:
96109
config?.contract?.relay1BalanceConcurrentERC2771zkSync ??
97110
GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ZKSYNC_ADDRESS,
111+
relay1BalanceConcurrentERC2771Abstract:
112+
config?.contract?.relay1BalanceConcurrentERC2771Abstract ??
113+
GELATO_RELAY_1BALANCE_CONCURRENT_ERC2771_ABSTRACT_ADDRESS,
98114
},
99115
};
100116
};

src/lib/types/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,15 @@ export type Config = {
6060
relayERC2771: string;
6161
relay1BalanceERC2771: string;
6262
relayERC2771zkSync: string;
63+
relayERC2771Abstract: string;
6364
relay1BalanceERC2771zkSync: string;
65+
relay1BalanceERC2771Abstract: string;
6466
relayConcurrentERC2771: string;
6567
relay1BalanceConcurrentERC2771: string;
6668
relayConcurrentERC2771zkSync: string;
69+
relayConcurrentERC2771Abstract: string;
6770
relay1BalanceConcurrentERC2771zkSync: string;
71+
relay1BalanceConcurrentERC2771Abstract: string;
6872
};
6973
};
7074

src/utils/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export * from "./post";
88
export * from "./isSigner";
99
export * from "./relayAddress";
1010
export * from "./isZkSync";
11+
export * from "./isAbstract";
1112
export * from "./getProviderChainId";
1213
export * from "./axios";
1314
export * from "./isConcurrentStruct";

src/utils/isAbstract.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export const isAbstract = (chainId: bigint): boolean => {
2+
return chainId === BigInt(2741);
3+
};

src/utils/relayAddress.ts

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ERC2771Type } from "../lib/erc2771/types";
44
import { Config } from "../lib/types";
55

66
import { isZkSync } from "./isZkSync";
7+
import { isAbstract } from "./isAbstract";
78

89
export const getGelatoRelayERC2771Address = (
910
payload: {
@@ -17,18 +18,26 @@ export const getGelatoRelayERC2771Address = (
1718
case ERC2771Type.CallWithSyncFee:
1819
return isZkSync(chainId)
1920
? getAddress(config.contract.relayERC2771zkSync)
21+
: isAbstract(chainId)
22+
? getAddress(config.contract.relayERC2771Abstract)
2023
: getAddress(config.contract.relayERC2771);
2124
case ERC2771Type.SponsoredCall:
2225
return isZkSync(chainId)
2326
? getAddress(config.contract.relay1BalanceERC2771zkSync)
27+
: isAbstract(chainId)
28+
? getAddress(config.contract.relay1BalanceERC2771Abstract)
2429
: getAddress(config.contract.relay1BalanceERC2771);
2530
case ERC2771Type.ConcurrentCallWithSyncFee:
2631
return isZkSync(chainId)
2732
? getAddress(config.contract.relayConcurrentERC2771zkSync)
33+
: isAbstract(chainId)
34+
? getAddress(config.contract.relayConcurrentERC2771Abstract)
2835
: getAddress(config.contract.relayConcurrentERC2771);
2936
case ERC2771Type.ConcurrentSponsoredCall:
3037
return isZkSync(chainId)
3138
? getAddress(config.contract.relay1BalanceConcurrentERC2771zkSync)
39+
: isAbstract(chainId)
40+
? getAddress(config.contract.relay1BalanceConcurrentERC2771Abstract)
3241
: getAddress(config.contract.relay1BalanceConcurrentERC2771);
3342
default:
3443
// eslint-disable-next-line no-case-declarations

yarn.lock

+23-15
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ __metadata:
496496
"@types/node": "npm:16.18.25"
497497
"@typescript-eslint/eslint-plugin": "npm:^5.59.1"
498498
"@typescript-eslint/parser": "npm:^5.59.1"
499-
axios: "npm:0.27.2"
499+
axios: "npm:0.29.0"
500500
dotenv: "npm:^16.0.3"
501501
eslint: "npm:^8.39.0"
502502
eslint-config-prettier: "npm:^8.8.0"
@@ -510,7 +510,7 @@ __metadata:
510510
minimize-js: "npm:^1.3.1"
511511
prettier: "npm:^2.8.8"
512512
typescript: "npm:5.0.4"
513-
ws: "npm:^8.5.0"
513+
ws: "npm:^8.18.0"
514514
languageName: unknown
515515
linkType: soft
516516

@@ -1085,13 +1085,14 @@ __metadata:
10851085
languageName: node
10861086
linkType: hard
10871087

1088-
"axios@npm:0.27.2":
1089-
version: 0.27.2
1090-
resolution: "axios@npm:0.27.2"
1088+
"axios@npm:0.29.0":
1089+
version: 0.29.0
1090+
resolution: "axios@npm:0.29.0"
10911091
dependencies:
1092-
follow-redirects: "npm:^1.14.9"
1092+
follow-redirects: "npm:^1.15.4"
10931093
form-data: "npm:^4.0.0"
1094-
checksum: 10c0/76d673d2a90629944b44d6f345f01e58e9174690f635115d5ffd4aca495d99bcd8f95c590d5ccb473513f5ebc1d1a6e8934580d0c57cdd0498c3a101313ef771
1094+
proxy-from-env: "npm:^1.1.0"
1095+
checksum: 10c0/53763099fe46d8a43700401e18db112d53f1fa9fe6beb6909742644e388d31928fba920c9a218334684b1a4b587112c7819671e372395bd66120adae8c014736
10951096
languageName: node
10961097
linkType: hard
10971098

@@ -2336,13 +2337,13 @@ __metadata:
23362337
languageName: node
23372338
linkType: hard
23382339

2339-
"follow-redirects@npm:^1.14.9":
2340-
version: 1.15.2
2341-
resolution: "follow-redirects@npm:1.15.2"
2340+
"follow-redirects@npm:^1.15.4":
2341+
version: 1.15.9
2342+
resolution: "follow-redirects@npm:1.15.9"
23422343
peerDependenciesMeta:
23432344
debug:
23442345
optional: true
2345-
checksum: 10c0/da5932b70e63944d38eecaa16954bac4347036f08303c913d166eda74809d8797d38386e3a0eb1d2fe37d2aaff2764cce8e9dbd99459d860cf2cdfa237923b5f
2346+
checksum: 10c0/5829165bd112c3c0e82be6c15b1a58fa9dcfaede3b3c54697a82fe4a62dd5ae5e8222956b448d2f98e331525f05d00404aba7d696de9e761ef6e42fdc780244f
23462347
languageName: node
23472348
linkType: hard
23482349

@@ -3991,6 +3992,13 @@ __metadata:
39913992
languageName: node
39923993
linkType: hard
39933994

3995+
"proxy-from-env@npm:^1.1.0":
3996+
version: 1.1.0
3997+
resolution: "proxy-from-env@npm:1.1.0"
3998+
checksum: 10c0/fe7dd8b1bdbbbea18d1459107729c3e4a2243ca870d26d34c2c1bcd3e4425b7bcc5112362df2d93cc7fb9746f6142b5e272fd1cc5c86ddf8580175186f6ad42b
3999+
languageName: node
4000+
linkType: hard
4001+
39944002
"pseudomap@npm:^1.0.2":
39954003
version: 1.0.2
39964004
resolution: "pseudomap@npm:1.0.2"
@@ -5212,9 +5220,9 @@ __metadata:
52125220
languageName: node
52135221
linkType: hard
52145222

5215-
"ws@npm:^8.5.0":
5216-
version: 8.14.2
5217-
resolution: "ws@npm:8.14.2"
5223+
"ws@npm:^8.18.0":
5224+
version: 8.18.0
5225+
resolution: "ws@npm:8.18.0"
52185226
peerDependencies:
52195227
bufferutil: ^4.0.1
52205228
utf-8-validate: ">=5.0.2"
@@ -5223,7 +5231,7 @@ __metadata:
52235231
optional: true
52245232
utf-8-validate:
52255233
optional: true
5226-
checksum: 10c0/35b4c2da048b8015c797fd14bcb5a5766216ce65c8a5965616a5440ca7b6c3681ee3cbd0ea0c184a59975556e9d58f2002abf8485a14d11d3371770811050a16
5234+
checksum: 10c0/25eb33aff17edcb90721ed6b0eb250976328533ad3cd1a28a274bd263682e7296a6591ff1436d6cbc50fa67463158b062f9d1122013b361cec99a05f84680e06
52275235
languageName: node
52285236
linkType: hard
52295237

0 commit comments

Comments
 (0)