@rabbitholegg/questdk-plugin-arbitrum
Advanced tools
Comparing version 1.0.0-alpha.14 to 1.0.0-alpha.15
# @rabbitholegg/questdk-plugin-arbitrum | ||
## 1.0.0-alpha.15 | ||
### Minor Changes | ||
- [#296](https://github.com/rabbitholegg/questdk-plugins/pull/296) [`756ca6c0`](https://github.com/rabbitholegg/questdk-plugins/commit/756ca6c0ba08c2c7649a946af54c9186169a9c0e) Thanks [@Quazia](https://github.com/Quazia)! - Revise build and lint strategies | ||
## 1.0.0-alpha.14 | ||
@@ -4,0 +10,0 @@ |
@@ -7,3 +7,3 @@ {"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/Arbitrum.ts": {"path":"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/Arbitrum.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":69}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":77}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":30}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":24}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":25}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":30}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":29}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":30}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":29}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":29}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":60}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":78}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":8}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":25}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":29}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":29}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":14}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":0}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":61}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":72}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":9}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":18}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":23}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":20}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":17}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":11}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":14}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":12}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":0}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":22}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":91}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":21}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":36}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":11}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":40}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":39}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":34}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":35}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":11}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":11}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":39}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":40}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":40}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":11}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":0}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":20}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":36}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":68}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":70}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":0}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":25}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":29}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":22}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":11}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":23}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":8}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":14}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":23}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":8}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":6}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":3}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":0}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":60}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":0}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":24}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":26}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":24}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":70}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":0}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":41}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":27}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":34}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":31}},"76":{"start":{"line":77,"column":0},"end":{"line":77,"column":26}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":26}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":13}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":77}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":14}},"81":{"start":{"line":82,"column":0},"end":{"line":82,"column":16}},"82":{"start":{"line":83,"column":0},"end":{"line":83,"column":43}},"83":{"start":{"line":84,"column":0},"end":{"line":84,"column":25}},"84":{"start":{"line":85,"column":0},"end":{"line":85,"column":26}},"85":{"start":{"line":86,"column":0},"end":{"line":86,"column":56}},"86":{"start":{"line":87,"column":0},"end":{"line":87,"column":10}},"87":{"start":{"line":88,"column":0},"end":{"line":88,"column":8}},"88":{"start":{"line":89,"column":0},"end":{"line":89,"column":5}},"89":{"start":{"line":90,"column":0},"end":{"line":90,"column":0}},"90":{"start":{"line":91,"column":0},"end":{"line":91,"column":30}},"91":{"start":{"line":92,"column":0},"end":{"line":92,"column":25}},"92":{"start":{"line":93,"column":0},"end":{"line":93,"column":29}},"93":{"start":{"line":94,"column":0},"end":{"line":94,"column":24}},"94":{"start":{"line":95,"column":0},"end":{"line":95,"column":24}},"95":{"start":{"line":96,"column":0},"end":{"line":96,"column":11}},"96":{"start":{"line":97,"column":0},"end":{"line":97,"column":75}},"97":{"start":{"line":98,"column":0},"end":{"line":98,"column":12}},"98":{"start":{"line":99,"column":0},"end":{"line":99,"column":14}},"99":{"start":{"line":100,"column":0},"end":{"line":100,"column":41}},"100":{"start":{"line":101,"column":0},"end":{"line":101,"column":23}},"101":{"start":{"line":102,"column":0},"end":{"line":102,"column":24}},"102":{"start":{"line":103,"column":0},"end":{"line":103,"column":29}},"103":{"start":{"line":104,"column":0},"end":{"line":104,"column":8}},"104":{"start":{"line":105,"column":0},"end":{"line":105,"column":6}},"105":{"start":{"line":106,"column":0},"end":{"line":106,"column":3}},"106":{"start":{"line":107,"column":0},"end":{"line":107,"column":0}},"107":{"start":{"line":108,"column":0},"end":{"line":108,"column":39}},"108":{"start":{"line":109,"column":0},"end":{"line":109,"column":41}},"109":{"start":{"line":110,"column":0},"end":{"line":110,"column":29}},"110":{"start":{"line":111,"column":0},"end":{"line":111,"column":20}},"111":{"start":{"line":112,"column":0},"end":{"line":112,"column":48}},"112":{"start":{"line":113,"column":0},"end":{"line":113,"column":34}},"113":{"start":{"line":114,"column":0},"end":{"line":114,"column":33}},"114":{"start":{"line":115,"column":0},"end":{"line":115,"column":5}},"115":{"start":{"line":116,"column":0},"end":{"line":116,"column":0}},"116":{"start":{"line":117,"column":0},"end":{"line":117,"column":28}},"117":{"start":{"line":118,"column":0},"end":{"line":118,"column":25}},"118":{"start":{"line":119,"column":0},"end":{"line":119,"column":29}},"119":{"start":{"line":120,"column":0},"end":{"line":120,"column":42}},"120":{"start":{"line":121,"column":0},"end":{"line":121,"column":22}},"121":{"start":{"line":122,"column":0},"end":{"line":122,"column":20}},"122":{"start":{"line":123,"column":0},"end":{"line":123,"column":14}},"123":{"start":{"line":124,"column":0},"end":{"line":124,"column":37}},"124":{"start":{"line":125,"column":0},"end":{"line":125,"column":8}},"125":{"start":{"line":126,"column":0},"end":{"line":126,"column":6}},"126":{"start":{"line":127,"column":0},"end":{"line":127,"column":3}},"127":{"start":{"line":128,"column":0},"end":{"line":128,"column":26}},"128":{"start":{"line":129,"column":0},"end":{"line":129,"column":23}},"129":{"start":{"line":130,"column":0},"end":{"line":130,"column":27}},"130":{"start":{"line":131,"column":0},"end":{"line":131,"column":18}},"131":{"start":{"line":132,"column":0},"end":{"line":132,"column":55}},"132":{"start":{"line":133,"column":0},"end":{"line":133,"column":12}},"133":{"start":{"line":134,"column":0},"end":{"line":134,"column":37}},"134":{"start":{"line":135,"column":0},"end":{"line":135,"column":29}},"135":{"start":{"line":136,"column":0},"end":{"line":136,"column":6}},"136":{"start":{"line":137,"column":0},"end":{"line":137,"column":4}},"137":{"start":{"line":138,"column":0},"end":{"line":138,"column":1}},"138":{"start":{"line":139,"column":0},"end":{"line":139,"column":0}},"139":{"start":{"line":140,"column":0},"end":{"line":140,"column":71}},"140":{"start":{"line":141,"column":0},"end":{"line":141,"column":46}},"141":{"start":{"line":142,"column":0},"end":{"line":142,"column":1}},"142":{"start":{"line":143,"column":0},"end":{"line":143,"column":0}},"143":{"start":{"line":144,"column":0},"end":{"line":144,"column":49}},"144":{"start":{"line":145,"column":0},"end":{"line":145,"column":35}},"145":{"start":{"line":146,"column":0},"end":{"line":146,"column":1}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":12,"23":12,"24":12,"25":12,"26":12,"27":12,"28":12,"29":12,"30":12,"31":12,"32":12,"33":2,"34":2,"35":2,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":2,"43":2,"44":2,"45":2,"46":2,"47":2,"48":2,"49":2,"50":0,"51":2,"52":2,"53":2,"54":2,"55":2,"56":2,"57":2,"58":2,"59":2,"60":2,"61":2,"62":2,"63":2,"64":10,"65":10,"66":10,"67":12,"68":7,"69":7,"70":7,"71":7,"72":7,"73":1,"74":1,"75":1,"76":1,"77":1,"78":0,"79":0,"80":0,"81":1,"82":1,"83":1,"84":1,"85":1,"86":1,"87":1,"88":1,"89":6,"90":6,"91":6,"92":6,"93":6,"94":6,"95":0,"96":0,"97":0,"98":7,"99":7,"100":7,"101":7,"102":7,"103":7,"104":7,"105":7,"106":3,"107":12,"108":2,"109":2,"110":2,"111":2,"112":1,"113":1,"114":2,"115":2,"116":2,"117":2,"118":2,"119":2,"120":2,"121":2,"122":2,"123":2,"124":2,"125":2,"126":2,"127":1,"128":1,"129":1,"130":1,"131":12,"132":12,"133":12,"134":12,"135":12,"136":12,"137":12,"138":1,"139":1,"140":0,"141":0,"142":1,"143":1,"144":0,"145":0},"branchMap":{"0":{"type":"branch","line":22,"loc":{"start":{"line":22,"column":22},"end":{"line":138,"column":1}},"locations":[{"start":{"line":22,"column":22},"end":{"line":138,"column":1}}]},"1":{"type":"branch","line":33,"loc":{"start":{"line":33,"column":21},"end":{"line":64,"column":3}},"locations":[{"start":{"line":33,"column":21},"end":{"line":64,"column":3}}]},"2":{"type":"branch","line":36,"loc":{"start":{"line":36,"column":24},"end":{"line":42,"column":11}},"locations":[{"start":{"line":36,"column":24},"end":{"line":42,"column":11}}]},"3":{"type":"branch","line":50,"loc":{"start":{"line":50,"column":24},"end":{"line":51,"column":68}},"locations":[{"start":{"line":50,"column":24},"end":{"line":51,"column":68}}]},"4":{"type":"branch","line":64,"loc":{"start":{"line":64,"column":2},"end":{"line":68,"column":23}},"locations":[{"start":{"line":64,"column":2},"end":{"line":68,"column":23}}]},"5":{"type":"branch","line":68,"loc":{"start":{"line":68,"column":23},"end":{"line":106,"column":3}},"locations":[{"start":{"line":68,"column":23},"end":{"line":106,"column":3}}]},"6":{"type":"branch","line":73,"loc":{"start":{"line":73,"column":40},"end":{"line":89,"column":5}},"locations":[{"start":{"line":73,"column":40},"end":{"line":89,"column":5}}]},"7":{"type":"branch","line":78,"loc":{"start":{"line":78,"column":12},"end":{"line":81,"column":14}},"locations":[{"start":{"line":78,"column":12},"end":{"line":81,"column":14}}]},"8":{"type":"branch","line":89,"loc":{"start":{"line":89,"column":4},"end":{"line":95,"column":24}},"locations":[{"start":{"line":89,"column":4},"end":{"line":95,"column":24}}]},"9":{"type":"branch","line":95,"loc":{"start":{"line":95,"column":10},"end":{"line":98,"column":12}},"locations":[{"start":{"line":95,"column":10},"end":{"line":98,"column":12}}]},"10":{"type":"branch","line":106,"loc":{"start":{"line":106,"column":2},"end":{"line":108,"column":38}},"locations":[{"start":{"line":106,"column":2},"end":{"line":108,"column":38}}]},"11":{"type":"branch","line":108,"loc":{"start":{"line":108,"column":38},"end":{"line":127,"column":3}},"locations":[{"start":{"line":108,"column":38},"end":{"line":127,"column":3}}]},"12":{"type":"branch","line":112,"loc":{"start":{"line":112,"column":31},"end":{"line":113,"column":34}},"locations":[{"start":{"line":112,"column":31},"end":{"line":113,"column":34}}]},"13":{"type":"branch","line":113,"loc":{"start":{"line":113,"column":12},"end":{"line":114,"column":33}},"locations":[{"start":{"line":113,"column":12},"end":{"line":114,"column":33}}]},"14":{"type":"branch","line":127,"loc":{"start":{"line":127,"column":2},"end":{"line":132,"column":27}},"locations":[{"start":{"line":127,"column":2},"end":{"line":132,"column":27}}]},"15":{"type":"branch","line":132,"loc":{"start":{"line":132,"column":8},"end":{"line":132,"column":55}},"locations":[{"start":{"line":132,"column":8},"end":{"line":132,"column":55}}]}},"b":{"0":[12],"1":[2],"2":[0],"3":[0],"4":[10],"5":[7],"6":[1],"7":[0],"8":[6],"9":[0],"10":[3],"11":[2],"12":[1],"13":[1],"14":[1],"15":[0]},"fnMap":{"0":{"name":"bridge","decl":{"start":{"line":22,"column":22},"end":{"line":138,"column":1}},"loc":{"start":{"line":22,"column":22},"end":{"line":138,"column":1}},"line":22},"1":{"name":"getSupportedTokenAddresses","decl":{"start":{"line":140,"column":42},"end":{"line":142,"column":1}},"loc":{"start":{"line":140,"column":42},"end":{"line":142,"column":1}},"line":140},"2":{"name":"getSupportedChainIds","decl":{"start":{"line":144,"column":36},"end":{"line":146,"column":1}},"loc":{"start":{"line":144,"column":36},"end":{"line":146,"column":1}},"line":144}},"f":{"0":12,"1":0,"2":0}} | ||
,"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/test-transactions.ts": {"path":"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/test-transactions.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":32}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":53}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":51}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":77}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":8}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":657}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":27}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":10}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":0}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":33}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":13}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":53}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":51}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":77}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":8}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":657}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":27}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":10}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":0}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":30}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":13}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":53}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":51}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":77}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":22}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":31}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":10}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":0}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":31}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":13}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":53}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":51}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":77}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":22}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":30}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":10}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":0}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":29}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":17}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":53}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":51}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":77}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":8}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":81}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":28}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":10}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":0}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":31}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":17}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":53}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":51}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":77}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":8}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":337}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":13}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":10}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1},"branchMap":{},"b":{},"fnMap":{},"f":{}} | ||
,"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/utils.ts": {"path":"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/utils.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":79}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":30}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":29}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":30}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":29}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":29}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":0}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":40}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":3}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":11}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":20}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":58}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":59}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":7}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":61}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":4}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":3}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":10}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":20}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":58}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":59}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":7}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":61}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":4}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":3}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":11}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":20}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":58}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":59}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":7}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":61}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":4}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":3}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":11}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":20}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":58}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":59}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":7}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":61}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":4}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":3}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":10}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":79}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":61}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":4}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":1}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":0}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":63}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":0}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":38}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":38}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":24}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":23}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":53}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":59}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":67}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":20}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":7}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":5}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":3}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":18}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":1}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":0}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":46}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":24}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":41}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":27}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":77}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":56}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":77}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":75}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":39}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":49}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":40}},"76":{"start":{"line":77,"column":0},"end":{"line":77,"column":48}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":39}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":3}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":14}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":1}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1,"60":1,"61":0,"62":0,"63":0,"64":1,"65":1,"66":7,"67":7,"68":7,"69":7,"70":7,"71":7,"72":7,"73":6,"74":6,"75":6,"76":5,"77":5,"78":6,"79":0,"80":0},"branchMap":{"0":{"type":"branch","line":52,"loc":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"locations":[{"start":{"line":52,"column":7},"end":{"line":64,"column":1}}]},"1":{"type":"branch","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":64,"column":1}},"locations":[{"start":{"line":61,"column":4},"end":{"line":64,"column":1}}]},"2":{"type":"branch","line":66,"loc":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"locations":[{"start":{"line":66,"column":45},"end":{"line":81,"column":1}}]},"3":{"type":"branch","line":71,"loc":{"start":{"line":71,"column":40},"end":{"line":71,"column":56}},"locations":[{"start":{"line":71,"column":40},"end":{"line":71,"column":56}}]},"4":{"type":"branch","line":72,"loc":{"start":{"line":72,"column":43},"end":{"line":72,"column":77}},"locations":[{"start":{"line":72,"column":43},"end":{"line":72,"column":77}}]},"5":{"type":"branch","line":73,"loc":{"start":{"line":73,"column":42},"end":{"line":73,"column":75}},"locations":[{"start":{"line":73,"column":42},"end":{"line":73,"column":75}}]},"6":{"type":"branch","line":73,"loc":{"start":{"line":73,"column":49},"end":{"line":79,"column":3}},"locations":[{"start":{"line":73,"column":49},"end":{"line":79,"column":3}}]},"7":{"type":"branch","line":76,"loc":{"start":{"line":76,"column":6},"end":{"line":76,"column":40}},"locations":[{"start":{"line":76,"column":6},"end":{"line":76,"column":40}}]},"8":{"type":"branch","line":76,"loc":{"start":{"line":76,"column":13},"end":{"line":78,"column":39}},"locations":[{"start":{"line":76,"column":13},"end":{"line":78,"column":39}}]},"9":{"type":"branch","line":79,"loc":{"start":{"line":79,"column":2},"end":{"line":81,"column":1}},"locations":[{"start":{"line":79,"column":2},"end":{"line":81,"column":1}}]}},"b":{"0":[1],"1":[0],"2":[7],"3":[0],"4":[0],"5":[1],"6":[6],"7":[1],"8":[5],"9":[0]},"fnMap":{"0":{"name":"findL1TokenForL2Token","decl":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"loc":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"line":52},"1":{"name":"getContractAddressFromChainId","decl":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"loc":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"line":66}},"f":{"0":1,"1":7}} | ||
,"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/utils.ts": {"path":"/home/runner/work/questdk-plugins/questdk-plugins/packages/arbitrum/src/utils.ts","all":false,"statementMap":{"0":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}},"1":{"start":{"line":2,"column":0},"end":{"line":2,"column":79}},"2":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}},"3":{"start":{"line":4,"column":0},"end":{"line":4,"column":30}},"4":{"start":{"line":5,"column":0},"end":{"line":5,"column":29}},"5":{"start":{"line":6,"column":0},"end":{"line":6,"column":30}},"6":{"start":{"line":7,"column":0},"end":{"line":7,"column":29}},"7":{"start":{"line":8,"column":0},"end":{"line":8,"column":29}},"8":{"start":{"line":9,"column":0},"end":{"line":9,"column":0}},"9":{"start":{"line":10,"column":0},"end":{"line":10,"column":45}},"10":{"start":{"line":11,"column":0},"end":{"line":11,"column":3}},"11":{"start":{"line":12,"column":0},"end":{"line":12,"column":11}},"12":{"start":{"line":13,"column":0},"end":{"line":13,"column":20}},"13":{"start":{"line":14,"column":0},"end":{"line":14,"column":58}},"14":{"start":{"line":15,"column":0},"end":{"line":15,"column":59}},"15":{"start":{"line":16,"column":0},"end":{"line":16,"column":7}},"16":{"start":{"line":17,"column":0},"end":{"line":17,"column":61}},"17":{"start":{"line":18,"column":0},"end":{"line":18,"column":4}},"18":{"start":{"line":19,"column":0},"end":{"line":19,"column":3}},"19":{"start":{"line":20,"column":0},"end":{"line":20,"column":10}},"20":{"start":{"line":21,"column":0},"end":{"line":21,"column":20}},"21":{"start":{"line":22,"column":0},"end":{"line":22,"column":58}},"22":{"start":{"line":23,"column":0},"end":{"line":23,"column":59}},"23":{"start":{"line":24,"column":0},"end":{"line":24,"column":7}},"24":{"start":{"line":25,"column":0},"end":{"line":25,"column":61}},"25":{"start":{"line":26,"column":0},"end":{"line":26,"column":4}},"26":{"start":{"line":27,"column":0},"end":{"line":27,"column":3}},"27":{"start":{"line":28,"column":0},"end":{"line":28,"column":11}},"28":{"start":{"line":29,"column":0},"end":{"line":29,"column":20}},"29":{"start":{"line":30,"column":0},"end":{"line":30,"column":58}},"30":{"start":{"line":31,"column":0},"end":{"line":31,"column":59}},"31":{"start":{"line":32,"column":0},"end":{"line":32,"column":7}},"32":{"start":{"line":33,"column":0},"end":{"line":33,"column":61}},"33":{"start":{"line":34,"column":0},"end":{"line":34,"column":4}},"34":{"start":{"line":35,"column":0},"end":{"line":35,"column":3}},"35":{"start":{"line":36,"column":0},"end":{"line":36,"column":11}},"36":{"start":{"line":37,"column":0},"end":{"line":37,"column":20}},"37":{"start":{"line":38,"column":0},"end":{"line":38,"column":58}},"38":{"start":{"line":39,"column":0},"end":{"line":39,"column":59}},"39":{"start":{"line":40,"column":0},"end":{"line":40,"column":7}},"40":{"start":{"line":41,"column":0},"end":{"line":41,"column":61}},"41":{"start":{"line":42,"column":0},"end":{"line":42,"column":4}},"42":{"start":{"line":43,"column":0},"end":{"line":43,"column":3}},"43":{"start":{"line":44,"column":0},"end":{"line":44,"column":10}},"44":{"start":{"line":45,"column":0},"end":{"line":45,"column":79}},"45":{"start":{"line":46,"column":0},"end":{"line":46,"column":61}},"46":{"start":{"line":47,"column":0},"end":{"line":47,"column":4}},"47":{"start":{"line":48,"column":0},"end":{"line":48,"column":1}},"48":{"start":{"line":49,"column":0},"end":{"line":49,"column":0}},"49":{"start":{"line":50,"column":0},"end":{"line":50,"column":63}},"50":{"start":{"line":51,"column":0},"end":{"line":51,"column":0}},"51":{"start":{"line":52,"column":0},"end":{"line":52,"column":38}},"52":{"start":{"line":53,"column":0},"end":{"line":53,"column":38}},"53":{"start":{"line":54,"column":0},"end":{"line":54,"column":24}},"54":{"start":{"line":55,"column":0},"end":{"line":55,"column":23}},"55":{"start":{"line":56,"column":0},"end":{"line":56,"column":53}},"56":{"start":{"line":57,"column":0},"end":{"line":57,"column":59}},"57":{"start":{"line":58,"column":0},"end":{"line":58,"column":67}},"58":{"start":{"line":59,"column":0},"end":{"line":59,"column":20}},"59":{"start":{"line":60,"column":0},"end":{"line":60,"column":7}},"60":{"start":{"line":61,"column":0},"end":{"line":61,"column":5}},"61":{"start":{"line":62,"column":0},"end":{"line":62,"column":3}},"62":{"start":{"line":63,"column":0},"end":{"line":63,"column":18}},"63":{"start":{"line":64,"column":0},"end":{"line":64,"column":1}},"64":{"start":{"line":65,"column":0},"end":{"line":65,"column":0}},"65":{"start":{"line":66,"column":0},"end":{"line":66,"column":46}},"66":{"start":{"line":67,"column":0},"end":{"line":67,"column":24}},"67":{"start":{"line":68,"column":0},"end":{"line":68,"column":41}},"68":{"start":{"line":69,"column":0},"end":{"line":69,"column":27}},"69":{"start":{"line":70,"column":0},"end":{"line":70,"column":77}},"70":{"start":{"line":71,"column":0},"end":{"line":71,"column":56}},"71":{"start":{"line":72,"column":0},"end":{"line":72,"column":77}},"72":{"start":{"line":73,"column":0},"end":{"line":73,"column":75}},"73":{"start":{"line":74,"column":0},"end":{"line":74,"column":39}},"74":{"start":{"line":75,"column":0},"end":{"line":75,"column":49}},"75":{"start":{"line":76,"column":0},"end":{"line":76,"column":40}},"76":{"start":{"line":77,"column":0},"end":{"line":77,"column":48}},"77":{"start":{"line":78,"column":0},"end":{"line":78,"column":39}},"78":{"start":{"line":79,"column":0},"end":{"line":79,"column":3}},"79":{"start":{"line":80,"column":0},"end":{"line":80,"column":14}},"80":{"start":{"line":81,"column":0},"end":{"line":81,"column":1}}},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1,"9":1,"10":1,"11":1,"12":1,"13":1,"14":1,"15":1,"16":1,"17":1,"18":1,"19":1,"20":1,"21":1,"22":1,"23":1,"24":1,"25":1,"26":1,"27":1,"28":1,"29":1,"30":1,"31":1,"32":1,"33":1,"34":1,"35":1,"36":1,"37":1,"38":1,"39":1,"40":1,"41":1,"42":1,"43":1,"44":1,"45":1,"46":1,"47":1,"48":1,"49":1,"50":1,"51":1,"52":1,"53":1,"54":1,"55":1,"56":1,"57":1,"58":1,"59":1,"60":1,"61":0,"62":0,"63":0,"64":1,"65":1,"66":7,"67":7,"68":7,"69":7,"70":7,"71":7,"72":7,"73":6,"74":6,"75":6,"76":5,"77":5,"78":6,"79":0,"80":0},"branchMap":{"0":{"type":"branch","line":52,"loc":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"locations":[{"start":{"line":52,"column":7},"end":{"line":64,"column":1}}]},"1":{"type":"branch","line":61,"loc":{"start":{"line":61,"column":4},"end":{"line":64,"column":1}},"locations":[{"start":{"line":61,"column":4},"end":{"line":64,"column":1}}]},"2":{"type":"branch","line":66,"loc":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"locations":[{"start":{"line":66,"column":45},"end":{"line":81,"column":1}}]},"3":{"type":"branch","line":71,"loc":{"start":{"line":71,"column":40},"end":{"line":71,"column":56}},"locations":[{"start":{"line":71,"column":40},"end":{"line":71,"column":56}}]},"4":{"type":"branch","line":72,"loc":{"start":{"line":72,"column":43},"end":{"line":72,"column":77}},"locations":[{"start":{"line":72,"column":43},"end":{"line":72,"column":77}}]},"5":{"type":"branch","line":73,"loc":{"start":{"line":73,"column":42},"end":{"line":73,"column":75}},"locations":[{"start":{"line":73,"column":42},"end":{"line":73,"column":75}}]},"6":{"type":"branch","line":73,"loc":{"start":{"line":73,"column":49},"end":{"line":79,"column":3}},"locations":[{"start":{"line":73,"column":49},"end":{"line":79,"column":3}}]},"7":{"type":"branch","line":76,"loc":{"start":{"line":76,"column":6},"end":{"line":76,"column":40}},"locations":[{"start":{"line":76,"column":6},"end":{"line":76,"column":40}}]},"8":{"type":"branch","line":76,"loc":{"start":{"line":76,"column":13},"end":{"line":78,"column":39}},"locations":[{"start":{"line":76,"column":13},"end":{"line":78,"column":39}}]},"9":{"type":"branch","line":79,"loc":{"start":{"line":79,"column":2},"end":{"line":81,"column":1}},"locations":[{"start":{"line":79,"column":2},"end":{"line":81,"column":1}}]}},"b":{"0":[1],"1":[0],"2":[7],"3":[0],"4":[0],"5":[1],"6":[6],"7":[1],"8":[5],"9":[0]},"fnMap":{"0":{"name":"findL1TokenForL2Token","decl":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"loc":{"start":{"line":52,"column":7},"end":{"line":64,"column":1}},"line":52},"1":{"name":"getContractAddressFromChainId","decl":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"loc":{"start":{"line":66,"column":45},"end":{"line":81,"column":1}},"line":66}},"f":{"0":1,"1":7}} | ||
} |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.INBOX_DEPOSIT_ETH_FRAG = exports.ARBSYS_WITHDRAW_ETH_FRAG = exports.OUTBOUND_TRANSFER_L2_TO_L1 = exports.OUTBOUND_TRANSFER_L1_TO_L2 = void 0; | ||
exports.OUTBOUND_TRANSFER_L1_TO_L2 = [ | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '_token', type: 'address' }, | ||
{ internalType: 'address', name: '_to', type: 'address' }, | ||
{ internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ internalType: 'uint256', name: '_maxGas', type: 'uint256' }, | ||
{ internalType: 'uint256', name: '_gasPriceBid', type: 'uint256' }, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'outboundTransfer', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
exports.OUTBOUND_TRANSFER_L2_TO_L1 = [ | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '_l1Token', type: 'address' }, | ||
{ internalType: 'address', name: '_to', type: 'address' }, | ||
{ internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'outboundTransfer', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
exports.ARBSYS_WITHDRAW_ETH_FRAG = [ | ||
{ | ||
inputs: [{ internalType: 'address', name: 'destination', type: 'address' }], | ||
name: 'withdrawEth', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
exports.INBOX_DEPOSIT_ETH_FRAG = [ | ||
{ | ||
inputs: [], | ||
name: 'depositEth', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.OUTBOUND_TRANSFER_L2_TO_L1 = exports.OUTBOUND_TRANSFER_L1_TO_L2 = exports.INBOX_DEPOSIT_ETH_FRAG = exports.ARBSYS_WITHDRAW_ETH_FRAG = void 0; | ||
// https://github.com/OffchainLabs/token-bridge-contracts/blob/main/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol#L229 | ||
var OUTBOUND_TRANSFER_L1_TO_L2 = exports.OUTBOUND_TRANSFER_L1_TO_L2 = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: '_token', | ||
type: 'address' | ||
}, { | ||
internalType: 'address', | ||
name: '_to', | ||
type: 'address' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_amount', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_maxGas', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_gasPriceBid', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes' | ||
}], | ||
name: 'outboundTransfer', | ||
outputs: [{ | ||
internalType: 'bytes', | ||
name: '', | ||
type: 'bytes' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
var OUTBOUND_TRANSFER_L2_TO_L1 = exports.OUTBOUND_TRANSFER_L2_TO_L1 = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: '_l1Token', | ||
type: 'address' | ||
}, { | ||
internalType: 'address', | ||
name: '_to', | ||
type: 'address' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_amount', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes' | ||
}], | ||
name: 'outboundTransfer', | ||
outputs: [{ | ||
internalType: 'bytes', | ||
name: '', | ||
type: 'bytes' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
var ARBSYS_WITHDRAW_ETH_FRAG = exports.ARBSYS_WITHDRAW_ETH_FRAG = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: 'destination', | ||
type: 'address' | ||
}], | ||
name: 'withdrawEth', | ||
outputs: [{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
var INBOX_DEPOSIT_ETH_FRAG = exports.INBOX_DEPOSIT_ETH_FRAG = [{ | ||
inputs: [], | ||
name: 'depositEth', | ||
outputs: [{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
//# sourceMappingURL=abi.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getSupportedChainIds = exports.getSupportedTokenAddresses = exports.bridge = void 0; | ||
const questdk_1 = require("@rabbitholegg/questdk"); | ||
const viem_1 = require("viem"); | ||
const chain_ids_1 = require("./chain-ids"); | ||
const contract_addresses_1 = require("./contract-addresses"); | ||
const supported_token_addresses_1 = require("./supported-token-addresses"); | ||
const utils_1 = require("./utils"); | ||
const abi_1 = require("./abi"); | ||
const bridge = async (bridge) => { | ||
const { sourceChainId, destinationChainId, contractAddress, tokenAddress, amount, recipient, } = bridge; | ||
if (!tokenAddress) { | ||
const contracts = sourceChainId === chain_ids_1.ETH_CHAIN_ID | ||
? [ | ||
contract_addresses_1.MAINNET_TO_ARB_NOVA_GATEWAY, | ||
contract_addresses_1.MAINNET_TO_ARB_ONE_GATEWAY, | ||
contract_addresses_1.ARB_ONE_DELAYED_INBOX, | ||
contract_addresses_1.ARB_NOVA_DELAYED_INBOX, | ||
] | ||
: [ | ||
contract_addresses_1.ARB_ONE_TO_MAINNET_GATEWAY, | ||
contract_addresses_1.ARB_NOVA_TO_MAINNET_GATEWAY, | ||
contract_addresses_1.UNIVERSAL_ARBSYS_PRECOMPILE, | ||
]; | ||
const abiFrags = sourceChainId === chain_ids_1.ETH_CHAIN_ID | ||
? [...abi_1.OUTBOUND_TRANSFER_L1_TO_L2, ...abi_1.INBOX_DEPOSIT_ETH_FRAG] | ||
: [...abi_1.OUTBOUND_TRANSFER_L2_TO_L1, ...abi_1.ARBSYS_WITHDRAW_ETH_FRAG]; | ||
return (0, questdk_1.compressJson)({ | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.getSupportedTokenAddresses = exports.getSupportedChainIds = exports.bridge = void 0; | ||
var _questdk = require("@rabbitholegg/questdk"); | ||
var _viem = require("viem"); | ||
var _chainIds = require("./chain-ids"); | ||
var _contractAddresses = require("./contract-addresses"); | ||
var _supportedTokenAddresses = require("./supported-token-addresses"); | ||
var _utils = require("./utils"); | ||
var _abi = require("./abi"); | ||
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||
var bridge = exports.bridge = /*#__PURE__*/function () { | ||
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_bridge) { | ||
var sourceChainId, destinationChainId, contractAddress, tokenAddress, amount, recipient, contracts, abiFrags, isBridgingToken, bridgeContract, networkInbox; | ||
return _regeneratorRuntime().wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
// This is the information we'll use to compose the Transaction object | ||
sourceChainId = _bridge.sourceChainId, destinationChainId = _bridge.destinationChainId, contractAddress = _bridge.contractAddress, tokenAddress = _bridge.tokenAddress, amount = _bridge.amount, recipient = _bridge.recipient; | ||
if (tokenAddress) { | ||
_context.next = 5; | ||
break; | ||
} | ||
// If token address is undefined, determining the exact bridge contract is not possible | ||
contracts = sourceChainId === _chainIds.ETH_CHAIN_ID ? [_contractAddresses.MAINNET_TO_ARB_NOVA_GATEWAY, _contractAddresses.MAINNET_TO_ARB_ONE_GATEWAY, _contractAddresses.ARB_ONE_DELAYED_INBOX, _contractAddresses.ARB_NOVA_DELAYED_INBOX] : [_contractAddresses.ARB_ONE_TO_MAINNET_GATEWAY, _contractAddresses.ARB_NOVA_TO_MAINNET_GATEWAY, _contractAddresses.UNIVERSAL_ARBSYS_PRECOMPILE]; | ||
abiFrags = sourceChainId === _chainIds.ETH_CHAIN_ID ? [].concat(_toConsumableArray(_abi.OUTBOUND_TRANSFER_L1_TO_L2), _toConsumableArray(_abi.INBOX_DEPOSIT_ETH_FRAG)) : [].concat(_toConsumableArray(_abi.OUTBOUND_TRANSFER_L2_TO_L1), _toConsumableArray(_abi.ARBSYS_WITHDRAW_ETH_FRAG)); | ||
return _context.abrupt("return", (0, _questdk.compressJson)({ | ||
chainId: sourceChainId, | ||
from: recipient, | ||
to: { | ||
$or: contracts, | ||
$or: contracts | ||
}, | ||
input: { | ||
$abi: abiFrags, | ||
$abi: abiFrags | ||
} | ||
})); | ||
case 5: | ||
isBridgingToken = tokenAddress !== _viem.zeroAddress; | ||
if (!isBridgingToken) { | ||
_context.next = 11; | ||
break; | ||
} | ||
bridgeContract = contractAddress || (0, _utils.getContractAddressFromChainId)(sourceChainId, destinationChainId); | ||
if (!(sourceChainId !== _chainIds.ETH_CHAIN_ID)) { | ||
_context.next = 10; | ||
break; | ||
} | ||
return _context.abrupt("return", (0, _questdk.compressJson)({ | ||
// L2 to L1 Token Transfer | ||
chainId: sourceChainId, | ||
to: bridgeContract ? bridgeContract : { | ||
$or: [_contractAddresses.ARB_ONE_TO_MAINNET_GATEWAY, _contractAddresses.ARB_NOVA_TO_MAINNET_GATEWAY] | ||
}, | ||
}); | ||
} | ||
const isBridgingToken = tokenAddress !== viem_1.zeroAddress; | ||
if (isBridgingToken) { | ||
const bridgeContract = contractAddress || | ||
(0, utils_1.getContractAddressFromChainId)(sourceChainId, destinationChainId); | ||
if (sourceChainId !== chain_ids_1.ETH_CHAIN_ID) { | ||
return (0, questdk_1.compressJson)({ | ||
chainId: sourceChainId, | ||
to: bridgeContract | ||
? bridgeContract | ||
: { | ||
$or: [contract_addresses_1.ARB_ONE_TO_MAINNET_GATEWAY, contract_addresses_1.ARB_NOVA_TO_MAINNET_GATEWAY], | ||
}, | ||
input: { | ||
$abi: abi_1.OUTBOUND_TRANSFER_L2_TO_L1, | ||
_to: recipient, | ||
_amount: amount, | ||
_l1Token: (0, utils_1.findL1TokenForL2Token)(tokenAddress), | ||
}, | ||
}); | ||
} | ||
return (0, questdk_1.compressJson)({ | ||
input: { | ||
$abi: _abi.OUTBOUND_TRANSFER_L2_TO_L1, | ||
_to: recipient, | ||
_amount: amount, | ||
_l1Token: (0, _utils.findL1TokenForL2Token)(tokenAddress) | ||
} | ||
})); | ||
case 10: | ||
return _context.abrupt("return", (0, _questdk.compressJson)({ | ||
chainId: sourceChainId, | ||
to: bridgeContract | ||
? bridgeContract | ||
: { | ||
$or: [contract_addresses_1.MAINNET_TO_ARB_NOVA_GATEWAY, contract_addresses_1.MAINNET_TO_ARB_ONE_GATEWAY], | ||
}, | ||
to: bridgeContract ? bridgeContract : { | ||
$or: [_contractAddresses.MAINNET_TO_ARB_NOVA_GATEWAY, _contractAddresses.MAINNET_TO_ARB_ONE_GATEWAY] | ||
}, | ||
input: { | ||
$abi: abi_1.OUTBOUND_TRANSFER_L1_TO_L2, | ||
_to: recipient, | ||
_amount: amount, | ||
_token: tokenAddress, | ||
}, | ||
}); | ||
} | ||
if (sourceChainId === chain_ids_1.ETH_CHAIN_ID) { | ||
let networkInbox; | ||
if (destinationChainId) { | ||
networkInbox = | ||
destinationChainId === chain_ids_1.ARB_NOVA_CHAIN_ID | ||
? contract_addresses_1.ARB_NOVA_DELAYED_INBOX | ||
: contract_addresses_1.ARB_ONE_DELAYED_INBOX; | ||
} | ||
return (0, questdk_1.compressJson)({ | ||
$abi: _abi.OUTBOUND_TRANSFER_L1_TO_L2, | ||
_to: recipient, | ||
_amount: amount, | ||
_token: tokenAddress | ||
} | ||
})); | ||
case 11: | ||
if (!(sourceChainId === _chainIds.ETH_CHAIN_ID)) { | ||
_context.next = 14; | ||
break; | ||
} | ||
if (destinationChainId) { | ||
networkInbox = destinationChainId === _chainIds.ARB_NOVA_CHAIN_ID ? _contractAddresses.ARB_NOVA_DELAYED_INBOX : _contractAddresses.ARB_ONE_DELAYED_INBOX; | ||
} | ||
// L1 to L2 ETH Transfer | ||
return _context.abrupt("return", (0, _questdk.compressJson)({ | ||
chainId: sourceChainId, | ||
@@ -89,25 +102,57 @@ to: contractAddress || networkInbox, | ||
input: { | ||
$abi: abi_1.INBOX_DEPOSIT_ETH_FRAG, | ||
}, | ||
}); | ||
} | ||
return (0, questdk_1.compressJson)({ | ||
chainId: sourceChainId, | ||
value: amount, | ||
to: contractAddress || contract_addresses_1.UNIVERSAL_ARBSYS_PRECOMPILE, | ||
input: { | ||
$abi: abi_1.ARBSYS_WITHDRAW_ETH_FRAG, | ||
destination: recipient, | ||
}, | ||
}); | ||
}; | ||
exports.bridge = bridge; | ||
const getSupportedTokenAddresses = async (_chainId) => { | ||
return supported_token_addresses_1.ArbitrumTokens[_chainId]; | ||
}; | ||
exports.getSupportedTokenAddresses = getSupportedTokenAddresses; | ||
const getSupportedChainIds = async () => { | ||
return chain_ids_1.CHAIN_ID_ARRAY; | ||
}; | ||
exports.getSupportedChainIds = getSupportedChainIds; | ||
$abi: _abi.INBOX_DEPOSIT_ETH_FRAG | ||
} | ||
})); | ||
case 14: | ||
return _context.abrupt("return", (0, _questdk.compressJson)({ | ||
chainId: sourceChainId, | ||
value: amount, | ||
to: contractAddress || _contractAddresses.UNIVERSAL_ARBSYS_PRECOMPILE, | ||
input: { | ||
$abi: _abi.ARBSYS_WITHDRAW_ETH_FRAG, | ||
destination: recipient | ||
} | ||
})); | ||
case 15: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})); | ||
return function bridge(_x) { | ||
return _ref.apply(this, arguments); | ||
}; | ||
}(); | ||
var getSupportedTokenAddresses = exports.getSupportedTokenAddresses = /*#__PURE__*/function () { | ||
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_chainId) { | ||
return _regeneratorRuntime().wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
return _context2.abrupt("return", _supportedTokenAddresses.ArbitrumTokens[_chainId]); | ||
case 1: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2); | ||
})); | ||
return function getSupportedTokenAddresses(_x2) { | ||
return _ref2.apply(this, arguments); | ||
}; | ||
}(); | ||
var getSupportedChainIds = exports.getSupportedChainIds = /*#__PURE__*/function () { | ||
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() { | ||
return _regeneratorRuntime().wrap(function _callee3$(_context3) { | ||
while (1) switch (_context3.prev = _context3.next) { | ||
case 0: | ||
return _context3.abrupt("return", _chainIds.CHAIN_ID_ARRAY); | ||
case 1: | ||
case "end": | ||
return _context3.stop(); | ||
} | ||
}, _callee3); | ||
})); | ||
return function getSupportedChainIds() { | ||
return _ref3.apply(this, arguments); | ||
}; | ||
}(); | ||
//# sourceMappingURL=Arbitrum.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.CHAIN_ID_ARRAY = exports.ARB_NOVA_CHAIN_ID = exports.ARB_ONE_CHAIN_ID = exports.ETH_CHAIN_ID = void 0; | ||
exports.ETH_CHAIN_ID = 1; | ||
exports.ARB_ONE_CHAIN_ID = 42161; | ||
exports.ARB_NOVA_CHAIN_ID = 42170; | ||
exports.CHAIN_ID_ARRAY = [ | ||
exports.ETH_CHAIN_ID, | ||
exports.ARB_ONE_CHAIN_ID, | ||
exports.ARB_NOVA_CHAIN_ID, | ||
]; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.ETH_CHAIN_ID = exports.CHAIN_ID_ARRAY = exports.ARB_ONE_CHAIN_ID = exports.ARB_NOVA_CHAIN_ID = void 0; | ||
// The arbitrum Native Bridge only supports three chains, Arbitrum, Arbitrum Nova, and Ethereum | ||
var ETH_CHAIN_ID = exports.ETH_CHAIN_ID = 1; | ||
var ARB_ONE_CHAIN_ID = exports.ARB_ONE_CHAIN_ID = 42161; | ||
var ARB_NOVA_CHAIN_ID = exports.ARB_NOVA_CHAIN_ID = 42170; | ||
var CHAIN_ID_ARRAY = exports.CHAIN_ID_ARRAY = [ETH_CHAIN_ID, ARB_ONE_CHAIN_ID, ARB_NOVA_CHAIN_ID]; | ||
//# sourceMappingURL=chain-ids.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.UNIVERSAL_ARBSYS_PRECOMPILE = exports.ARB_NOVA_DELAYED_INBOX = exports.ARB_ONE_DELAYED_INBOX = exports.ARB_ONE_TO_MAINNET_GATEWAY = exports.ARB_NOVA_TO_MAINNET_GATEWAY = exports.MAINNET_TO_ARB_ONE_GATEWAY = exports.MAINNET_TO_ARB_NOVA_GATEWAY = void 0; | ||
exports.MAINNET_TO_ARB_NOVA_GATEWAY = '0xc840838bc438d73c16c2f8b22d2ce3669963cd48'; | ||
exports.MAINNET_TO_ARB_ONE_GATEWAY = '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef'; | ||
exports.ARB_NOVA_TO_MAINNET_GATEWAY = '0x21903d3f8176b1a0c17e953cd896610be9ffdfa8'; | ||
exports.ARB_ONE_TO_MAINNET_GATEWAY = '0x5288c571fd7ad117bea99bf60fe0846c4e84f933'; | ||
exports.ARB_ONE_DELAYED_INBOX = '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f'; | ||
exports.ARB_NOVA_DELAYED_INBOX = '0xc4448b71118c9071bcb9734a0eac55d18a153949'; | ||
exports.UNIVERSAL_ARBSYS_PRECOMPILE = '0x0000000000000000000000000000000000000064'; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.UNIVERSAL_ARBSYS_PRECOMPILE = exports.MAINNET_TO_ARB_ONE_GATEWAY = exports.MAINNET_TO_ARB_NOVA_GATEWAY = exports.ARB_ONE_TO_MAINNET_GATEWAY = exports.ARB_ONE_DELAYED_INBOX = exports.ARB_NOVA_TO_MAINNET_GATEWAY = exports.ARB_NOVA_DELAYED_INBOX = void 0; | ||
// https://docs.arbitrum.io/for-devs/useful-addresses | ||
var MAINNET_TO_ARB_NOVA_GATEWAY = exports.MAINNET_TO_ARB_NOVA_GATEWAY = '0xc840838bc438d73c16c2f8b22d2ce3669963cd48'; | ||
var MAINNET_TO_ARB_ONE_GATEWAY = exports.MAINNET_TO_ARB_ONE_GATEWAY = '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef'; | ||
var ARB_NOVA_TO_MAINNET_GATEWAY = exports.ARB_NOVA_TO_MAINNET_GATEWAY = '0x21903d3f8176b1a0c17e953cd896610be9ffdfa8'; | ||
var ARB_ONE_TO_MAINNET_GATEWAY = exports.ARB_ONE_TO_MAINNET_GATEWAY = '0x5288c571fd7ad117bea99bf60fe0846c4e84f933'; | ||
var ARB_ONE_DELAYED_INBOX = exports.ARB_ONE_DELAYED_INBOX = '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f'; | ||
var ARB_NOVA_DELAYED_INBOX = exports.ARB_NOVA_DELAYED_INBOX = '0xc4448b71118c9071bcb9734a0eac55d18a153949'; | ||
var UNIVERSAL_ARBSYS_PRECOMPILE = exports.UNIVERSAL_ARBSYS_PRECOMPILE = '0x0000000000000000000000000000000000000064'; | ||
//# sourceMappingURL=contract-addresses.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.Arbitrum = void 0; | ||
const questdk_1 = require("@rabbitholegg/questdk"); | ||
const Arbitrum_1 = require("./Arbitrum"); | ||
exports.Arbitrum = { | ||
pluginId: 'arbitrum', | ||
getSupportedTokenAddresses: Arbitrum_1.getSupportedTokenAddresses, | ||
getSupportedChainIds: Arbitrum_1.getSupportedChainIds, | ||
bridge: Arbitrum_1.bridge, | ||
swap: async () => new questdk_1.PluginActionNotImplementedError(), | ||
mint: async () => new questdk_1.PluginActionNotImplementedError(), | ||
var _questdk = require("@rabbitholegg/questdk"); | ||
var _Arbitrum = require("./Arbitrum"); | ||
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } | ||
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } } | ||
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; } | ||
var Arbitrum = exports.Arbitrum = { | ||
pluginId: 'arbitrum', | ||
getSupportedTokenAddresses: _Arbitrum.getSupportedTokenAddresses, | ||
getSupportedChainIds: _Arbitrum.getSupportedChainIds, | ||
bridge: _Arbitrum.bridge, | ||
swap: function () { | ||
var _swap = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() { | ||
return _regeneratorRuntime().wrap(function _callee$(_context) { | ||
while (1) switch (_context.prev = _context.next) { | ||
case 0: | ||
return _context.abrupt("return", new _questdk.PluginActionNotImplementedError()); | ||
case 1: | ||
case "end": | ||
return _context.stop(); | ||
} | ||
}, _callee); | ||
})); | ||
function swap() { | ||
return _swap.apply(this, arguments); | ||
} | ||
return swap; | ||
}(), | ||
mint: function () { | ||
var _mint = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() { | ||
return _regeneratorRuntime().wrap(function _callee2$(_context2) { | ||
while (1) switch (_context2.prev = _context2.next) { | ||
case 0: | ||
return _context2.abrupt("return", new _questdk.PluginActionNotImplementedError()); | ||
case 1: | ||
case "end": | ||
return _context2.stop(); | ||
} | ||
}, _callee2); | ||
})); | ||
function mint() { | ||
return _mint.apply(this, arguments); | ||
} | ||
return mint; | ||
}() | ||
}; | ||
//# sourceMappingURL=index.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.ArbitrumTokens = void 0; | ||
const viem_1 = require("viem"); | ||
const chain_ids_1 = require("./chain-ids"); | ||
exports.ArbitrumTokens = { | ||
[chain_ids_1.ETH_CHAIN_ID]: [ | ||
viem_1.zeroAddress, | ||
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', | ||
'0x6B175474E89094C44Da98b954EedeAC495271d0F', | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', | ||
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', | ||
], | ||
[chain_ids_1.ARB_ONE_CHAIN_ID]: [ | ||
viem_1.zeroAddress, | ||
'0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', | ||
'0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', | ||
], | ||
[chain_ids_1.ARB_NOVA_CHAIN_ID]: [ | ||
viem_1.zeroAddress, | ||
'0x750ba8b76187092B0D1E87E28daaf484d1b5273b', | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', | ||
'0x1d05e4e72cD994cdF976181CfB0707345763564d', | ||
'0x722E8BdD2ce80A4422E880164f2079488e115365', | ||
], | ||
}; | ||
var _viem = require("viem"); | ||
var _chainIds = require("./chain-ids"); | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
// For now we're mainly supported the highest traffic Arbitrum tokens | ||
// excluded USDT due to it not being compatible with arbitrum nova | ||
// -------------!!!!! IMPORTANT!!!!!---------------- | ||
// WHEN ADDING NEW TOKENS, MAKE SURE TO UPDATE l1ToL2Map in utils.ts | ||
var ArbitrumTokens = exports.ArbitrumTokens = _defineProperty(_defineProperty(_defineProperty({}, _chainIds.ETH_CHAIN_ID, [_viem.zeroAddress, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', | ||
// USDC | ||
'0x6B175474E89094C44Da98b954EedeAC495271d0F', | ||
// DAI | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', | ||
// ARB | ||
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', | ||
// WBTC | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' // WETH | ||
]), _chainIds.ARB_ONE_CHAIN_ID, [_viem.zeroAddress, '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', | ||
// USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
// DAI | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
// ARB | ||
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', | ||
// WBTC | ||
'0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' // WETH | ||
]), _chainIds.ARB_NOVA_CHAIN_ID, [_viem.zeroAddress, '0x750ba8b76187092B0D1E87E28daaf484d1b5273b', | ||
// USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
// DAI | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', | ||
// ARB | ||
'0x1d05e4e72cD994cdF976181CfB0707345763564d', | ||
// WBTC | ||
'0x722E8BdD2ce80A4422E880164f2079488e115365' // WETH | ||
]); | ||
//# sourceMappingURL=supported-token-addresses.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.L2_TOKEN_TO_L1 = exports.L2_ETH_TO_L1 = exports.L1_ETH_TO_NOVA = exports.L1_ETH_TO_ONE = exports.L1_TOKEN_TO_NOVA = exports.L1_TOKEN_TO_ONE = void 0; | ||
exports.L1_TOKEN_TO_ONE = { | ||
chainId: 1, | ||
from: '0xf9ce182b0fbe597773ab9bb5159b7479047de8fe', | ||
to: '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef', | ||
hash: '0xcdbcb66c6a194ae2f0a58b00c1e6ec0daea08c901590ba056cc6806581bf5a94', | ||
input: '0xd2ce7d65000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f9ce182b0fbe597773ab9bb5159b7479047de8fe0000000000000000000000000000000000000000000000803216cf6e916f980000000000000000000000000000000000000000000000000000000000000177ee0000000000000000000000000000000000000000000000000000000011e1a30000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000268971162634000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '706819394000000', | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.L2_TOKEN_TO_L1 = exports.L2_ETH_TO_L1 = exports.L1_TOKEN_TO_ONE = exports.L1_TOKEN_TO_NOVA = exports.L1_ETH_TO_ONE = exports.L1_ETH_TO_NOVA = void 0; | ||
var L1_TOKEN_TO_ONE = exports.L1_TOKEN_TO_ONE = { | ||
chainId: 1, | ||
from: '0xf9ce182b0fbe597773ab9bb5159b7479047de8fe', | ||
to: '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef', | ||
hash: '0xcdbcb66c6a194ae2f0a58b00c1e6ec0daea08c901590ba056cc6806581bf5a94', | ||
input: '0xd2ce7d65000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f9ce182b0fbe597773ab9bb5159b7479047de8fe0000000000000000000000000000000000000000000000803216cf6e916f980000000000000000000000000000000000000000000000000000000000000177ee0000000000000000000000000000000000000000000000000000000011e1a30000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000268971162634000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '706819394000000' | ||
}; | ||
exports.L1_TOKEN_TO_NOVA = { | ||
chainId: 1, | ||
from: '0x1f536b22d877dc2a116c7bedc862a539551bc56d', | ||
to: '0xc840838bc438d73c16c2f8b22d2ce3669963cd48', | ||
hash: '0x2c55e34062d1d859878400d49f02b21b529a61ed887a6d5dff369965d6bfb977', | ||
input: '0xd2ce7d65000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000001f536b22d877dc2a116c7bedc862a539551bc56d00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000001777b0000000000000000000000000000000000000000000000000000000001c9c38000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000035232b888b68000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '937686417941760', | ||
var L1_TOKEN_TO_NOVA = exports.L1_TOKEN_TO_NOVA = { | ||
chainId: 1, | ||
from: '0x1f536b22d877dc2a116c7bedc862a539551bc56d', | ||
to: '0xc840838bc438d73c16c2f8b22d2ce3669963cd48', | ||
hash: '0x2c55e34062d1d859878400d49f02b21b529a61ed887a6d5dff369965d6bfb977', | ||
input: '0xd2ce7d65000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000001f536b22d877dc2a116c7bedc862a539551bc56d00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000001777b0000000000000000000000000000000000000000000000000000000001c9c38000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000035232b888b68000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '937686417941760' | ||
}; | ||
exports.L1_ETH_TO_ONE = { | ||
chainId: 1, | ||
from: '0x6d7ac63aaa7ba8925dcb3e44be6355261dcf688f', | ||
to: '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f', | ||
hash: '0x81a963983ac2156e6ca76be1e2b36a5cb465943bef72b9844d6d3700ff58aec7', | ||
input: '0x439370b1', | ||
value: '3000000000000000000', | ||
var L1_ETH_TO_ONE = exports.L1_ETH_TO_ONE = { | ||
chainId: 1, | ||
from: '0x6d7ac63aaa7ba8925dcb3e44be6355261dcf688f', | ||
to: '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f', | ||
hash: '0x81a963983ac2156e6ca76be1e2b36a5cb465943bef72b9844d6d3700ff58aec7', | ||
input: '0x439370b1', | ||
value: '3000000000000000000' | ||
}; | ||
exports.L1_ETH_TO_NOVA = { | ||
chainId: 1, | ||
from: '0xba84392ae32a0ffcab1195c57172c05292e02b3e', | ||
to: '0xc4448b71118c9071bcb9734a0eac55d18a153949', | ||
hash: '0xe3df33a0ad03d7c26eb523a28dfb9884873ba9475255878a75ff3881025c5768', | ||
input: '0x439370b1', | ||
value: '250000000000000000', | ||
var L1_ETH_TO_NOVA = exports.L1_ETH_TO_NOVA = { | ||
chainId: 1, | ||
from: '0xba84392ae32a0ffcab1195c57172c05292e02b3e', | ||
to: '0xc4448b71118c9071bcb9734a0eac55d18a153949', | ||
hash: '0xe3df33a0ad03d7c26eb523a28dfb9884873ba9475255878a75ff3881025c5768', | ||
input: '0x439370b1', | ||
value: '250000000000000000' | ||
}; | ||
exports.L2_ETH_TO_L1 = { | ||
chainId: 42170, | ||
from: '0x7169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
to: '0x0000000000000000000000000000000000000064', | ||
hash: '0xbaf3a0440ea37971ee1c7b2ee1139e5ba474497a28d15b80e749434cb6063e73', | ||
input: '0x25e160630000000000000000000000007169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
value: '5000000000000000', | ||
var L2_ETH_TO_L1 = exports.L2_ETH_TO_L1 = { | ||
chainId: 42170, | ||
from: '0x7169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
to: '0x0000000000000000000000000000000000000064', | ||
hash: '0xbaf3a0440ea37971ee1c7b2ee1139e5ba474497a28d15b80e749434cb6063e73', | ||
input: '0x25e160630000000000000000000000007169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
value: '5000000000000000' | ||
}; | ||
exports.L2_TOKEN_TO_L1 = { | ||
chainId: 42161, | ||
from: '0x572b093d735b9e91cbd90972e846333d444f25cd', | ||
to: '0x5288c571fd7ad117bea99bf60fe0846c4e84f933', | ||
hash: '0x3241a751cbe4bb5effd2532c5e1366d62bbe462f03cc999b462fa297b184f8fb', | ||
input: '0x7b3a3c8b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000572b093d735b9e91cbd90972e846333d444f25cd00000000000000000000000000000000000000000000000000000023736c15c400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000', | ||
value: '0', | ||
var L2_TOKEN_TO_L1 = exports.L2_TOKEN_TO_L1 = { | ||
chainId: 42161, | ||
from: '0x572b093d735b9e91cbd90972e846333d444f25cd', | ||
to: '0x5288c571fd7ad117bea99bf60fe0846c4e84f933', | ||
hash: '0x3241a751cbe4bb5effd2532c5e1366d62bbe462f03cc999b462fa297b184f8fb', | ||
input: '0x7b3a3c8b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000572b093d735b9e91cbd90972e846333d444f25cd00000000000000000000000000000000000000000000000000000023736c15c400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000', | ||
value: '0' | ||
}; | ||
//# sourceMappingURL=test-transactions.js.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getContractAddressFromChainId = exports.findL1TokenForL2Token = void 0; | ||
const chain_ids_1 = require("./chain-ids"); | ||
const contract_addresses_1 = require("./contract-addresses"); | ||
const l1ToL2Map = [ | ||
[ | ||
JSON.stringify([ | ||
'0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', | ||
'0x750ba8b76187092b0d1e87e28daaf484d1b5273b', | ||
]), | ||
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', | ||
], | ||
[ | ||
JSON.stringify([ | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', | ||
]), | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', | ||
], | ||
[ | ||
JSON.stringify([ | ||
'0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f', | ||
'0x1d05e4e72cd994cdf976181cfb0707345763564d', | ||
]), | ||
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', | ||
], | ||
[ | ||
JSON.stringify([ | ||
'0x82af49447d8a07e3bd95bd0d56f35241523fbab1', | ||
'0x722e8bdd2ce80a4422e880164f2079488e115365', | ||
]), | ||
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', | ||
], | ||
[ | ||
JSON.stringify(['0xda10009cbd5d07dd0cecc66161fc93d7c9000da1']), | ||
'0x6b175474e89094c44da98b954eedeac495271d0f', | ||
], | ||
]; | ||
const l1TokenFromL2Tokens = new Map(l1ToL2Map); | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.findL1TokenForL2Token = findL1TokenForL2Token; | ||
exports.getContractAddressFromChainId = void 0; | ||
var _chainIds = require("./chain-ids"); | ||
var _contractAddresses = require("./contract-addresses"); | ||
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | ||
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } | ||
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } | ||
var l1ToL2Map = [[ | ||
// USDC | ||
JSON.stringify(['0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', | ||
// one | ||
'0x750ba8b76187092b0d1e87e28daaf484d1b5273b' // nova | ||
]), '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // ethereum | ||
], [ | ||
// ARB | ||
JSON.stringify(['0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
// one | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD' // nova | ||
]), '0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1' // ethereum | ||
], [ | ||
// WBTC | ||
JSON.stringify(['0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f', | ||
// one | ||
'0x1d05e4e72cd994cdf976181cfb0707345763564d' // nova | ||
]), '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599' // ethereum | ||
], [ | ||
// WETH | ||
JSON.stringify(['0x82af49447d8a07e3bd95bd0d56f35241523fbab1', | ||
// one | ||
'0x722e8bdd2ce80a4422e880164f2079488e115365' // nova | ||
]), '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' // ethereum | ||
], [ | ||
// DAI | ||
JSON.stringify(['0xda10009cbd5d07dd0cecc66161fc93d7c9000da1']), | ||
// one/nova | ||
'0x6b175474e89094c44da98b954eedeac495271d0f' // ethereum | ||
]]; | ||
var l1TokenFromL2Tokens = new Map(l1ToL2Map); | ||
function findL1TokenForL2Token(l2TokenAddress) { | ||
if (l2TokenAddress) { | ||
for (const [key, value] of l1TokenFromL2Tokens) { | ||
const pair = JSON.parse(key.toLowerCase()); | ||
if (pair.includes(l2TokenAddress.toLowerCase())) { | ||
return value; | ||
} | ||
if (l2TokenAddress) { | ||
var _iterator = _createForOfIteratorHelper(l1TokenFromL2Tokens), | ||
_step; | ||
try { | ||
for (_iterator.s(); !(_step = _iterator.n()).done;) { | ||
var _step$value = _slicedToArray(_step.value, 2), | ||
key = _step$value[0], | ||
value = _step$value[1]; | ||
var pair = JSON.parse(key.toLowerCase()); | ||
if (pair.includes(l2TokenAddress.toLowerCase())) { | ||
return value; | ||
} | ||
} | ||
} catch (err) { | ||
_iterator.e(err); | ||
} finally { | ||
_iterator.f(); | ||
} | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
exports.findL1TokenForL2Token = findL1TokenForL2Token; | ||
const getContractAddressFromChainId = (sourceChainId, destinationChainId) => { | ||
if (destinationChainId === undefined) | ||
return undefined; | ||
if (sourceChainId === chain_ids_1.ARB_NOVA_CHAIN_ID) | ||
return contract_addresses_1.ARB_NOVA_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === chain_ids_1.ARB_ONE_CHAIN_ID) | ||
return contract_addresses_1.ARB_ONE_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === chain_ids_1.ETH_CHAIN_ID) { | ||
if (destinationChainId === chain_ids_1.ARB_NOVA_CHAIN_ID) | ||
return contract_addresses_1.MAINNET_TO_ARB_NOVA_GATEWAY; | ||
if (destinationChainId === chain_ids_1.ARB_ONE_CHAIN_ID) | ||
return contract_addresses_1.MAINNET_TO_ARB_ONE_GATEWAY; | ||
} | ||
return '0x0'; | ||
var getContractAddressFromChainId = exports.getContractAddressFromChainId = function getContractAddressFromChainId(sourceChainId, destinationChainId) { | ||
// This is klunky but the alternative is some sort of convoluted 2D mapping | ||
if (destinationChainId === undefined) return undefined; | ||
if (sourceChainId === _chainIds.ARB_NOVA_CHAIN_ID) return _contractAddresses.ARB_NOVA_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === _chainIds.ARB_ONE_CHAIN_ID) return _contractAddresses.ARB_ONE_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === _chainIds.ETH_CHAIN_ID) { | ||
if (destinationChainId === _chainIds.ARB_NOVA_CHAIN_ID) return _contractAddresses.MAINNET_TO_ARB_NOVA_GATEWAY; | ||
if (destinationChainId === _chainIds.ARB_ONE_CHAIN_ID) return _contractAddresses.MAINNET_TO_ARB_ONE_GATEWAY; | ||
} | ||
return '0x0'; | ||
}; | ||
exports.getContractAddressFromChainId = getContractAddressFromChainId; | ||
//# sourceMappingURL=utils.js.map |
// https://github.com/OffchainLabs/token-bridge-contracts/blob/main/contracts/tokenbridge/ethereum/gateway/L1GatewayRouter.sol#L229 | ||
export const OUTBOUND_TRANSFER_L1_TO_L2 = [ | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '_token', type: 'address' }, | ||
{ internalType: 'address', name: '_to', type: 'address' }, | ||
{ internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ internalType: 'uint256', name: '_maxGas', type: 'uint256' }, | ||
{ internalType: 'uint256', name: '_gasPriceBid', type: 'uint256' }, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'outboundTransfer', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
export const OUTBOUND_TRANSFER_L2_TO_L1 = [ | ||
{ | ||
inputs: [ | ||
{ internalType: 'address', name: '_l1Token', type: 'address' }, | ||
{ internalType: 'address', name: '_to', type: 'address' }, | ||
{ internalType: 'uint256', name: '_amount', type: 'uint256' }, | ||
{ internalType: 'bytes', name: '_data', type: 'bytes' }, | ||
], | ||
name: 'outboundTransfer', | ||
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
export const ARBSYS_WITHDRAW_ETH_FRAG = [ | ||
{ | ||
inputs: [{ internalType: 'address', name: 'destination', type: 'address' }], | ||
name: 'withdrawEth', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
export const INBOX_DEPOSIT_ETH_FRAG = [ | ||
{ | ||
inputs: [], | ||
name: 'depositEth', | ||
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], | ||
stateMutability: 'payable', | ||
type: 'function', | ||
}, | ||
]; | ||
export const OUTBOUND_TRANSFER_L1_TO_L2 = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: '_token', | ||
type: 'address' | ||
}, { | ||
internalType: 'address', | ||
name: '_to', | ||
type: 'address' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_amount', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_maxGas', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_gasPriceBid', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes' | ||
}], | ||
name: 'outboundTransfer', | ||
outputs: [{ | ||
internalType: 'bytes', | ||
name: '', | ||
type: 'bytes' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
export const OUTBOUND_TRANSFER_L2_TO_L1 = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: '_l1Token', | ||
type: 'address' | ||
}, { | ||
internalType: 'address', | ||
name: '_to', | ||
type: 'address' | ||
}, { | ||
internalType: 'uint256', | ||
name: '_amount', | ||
type: 'uint256' | ||
}, { | ||
internalType: 'bytes', | ||
name: '_data', | ||
type: 'bytes' | ||
}], | ||
name: 'outboundTransfer', | ||
outputs: [{ | ||
internalType: 'bytes', | ||
name: '', | ||
type: 'bytes' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
export const ARBSYS_WITHDRAW_ETH_FRAG = [{ | ||
inputs: [{ | ||
internalType: 'address', | ||
name: 'destination', | ||
type: 'address' | ||
}], | ||
name: 'withdrawEth', | ||
outputs: [{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
export const INBOX_DEPOSIT_ETH_FRAG = [{ | ||
inputs: [], | ||
name: 'depositEth', | ||
outputs: [{ | ||
internalType: 'uint256', | ||
name: '', | ||
type: 'uint256' | ||
}], | ||
stateMutability: 'payable', | ||
type: 'function' | ||
}]; | ||
//# sourceMappingURL=abi.js.map |
import { compressJson } from '@rabbitholegg/questdk'; | ||
import { zeroAddress as ETH_TOKEN_ADDRESS } from 'viem'; | ||
import { CHAIN_ID_ARRAY, ETH_CHAIN_ID, ARB_NOVA_CHAIN_ID } from './chain-ids'; | ||
import { UNIVERSAL_ARBSYS_PRECOMPILE, ARB_ONE_DELAYED_INBOX, ARB_NOVA_DELAYED_INBOX, ARB_NOVA_TO_MAINNET_GATEWAY, ARB_ONE_TO_MAINNET_GATEWAY, MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY, } from './contract-addresses'; | ||
import { UNIVERSAL_ARBSYS_PRECOMPILE, ARB_ONE_DELAYED_INBOX, ARB_NOVA_DELAYED_INBOX, ARB_NOVA_TO_MAINNET_GATEWAY, ARB_ONE_TO_MAINNET_GATEWAY, MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY } from './contract-addresses'; | ||
import { ArbitrumTokens } from './supported-token-addresses'; | ||
import { findL1TokenForL2Token, getContractAddressFromChainId } from './utils'; | ||
import { ARBSYS_WITHDRAW_ETH_FRAG, INBOX_DEPOSIT_ETH_FRAG, OUTBOUND_TRANSFER_L2_TO_L1, OUTBOUND_TRANSFER_L1_TO_L2, } from './abi'; | ||
export const bridge = async (bridge) => { | ||
// This is the information we'll use to compose the Transaction object | ||
const { sourceChainId, destinationChainId, contractAddress, tokenAddress, amount, recipient, } = bridge; | ||
if (!tokenAddress) { | ||
// If token address is undefined, determining the exact bridge contract is not possible | ||
const contracts = sourceChainId === ETH_CHAIN_ID | ||
? [ | ||
MAINNET_TO_ARB_NOVA_GATEWAY, | ||
MAINNET_TO_ARB_ONE_GATEWAY, | ||
ARB_ONE_DELAYED_INBOX, | ||
ARB_NOVA_DELAYED_INBOX, | ||
] | ||
: [ | ||
ARB_ONE_TO_MAINNET_GATEWAY, | ||
ARB_NOVA_TO_MAINNET_GATEWAY, | ||
UNIVERSAL_ARBSYS_PRECOMPILE, | ||
]; | ||
const abiFrags = sourceChainId === ETH_CHAIN_ID | ||
? [...OUTBOUND_TRANSFER_L1_TO_L2, ...INBOX_DEPOSIT_ETH_FRAG] | ||
: [...OUTBOUND_TRANSFER_L2_TO_L1, ...ARBSYS_WITHDRAW_ETH_FRAG]; | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
from: recipient, | ||
to: { | ||
$or: contracts, | ||
}, | ||
input: { | ||
$abi: abiFrags, | ||
}, | ||
}); | ||
} | ||
const isBridgingToken = tokenAddress !== ETH_TOKEN_ADDRESS; | ||
if (isBridgingToken) { | ||
const bridgeContract = contractAddress || | ||
getContractAddressFromChainId(sourceChainId, destinationChainId); | ||
if (sourceChainId !== ETH_CHAIN_ID) { | ||
return compressJson({ | ||
// L2 to L1 Token Transfer | ||
chainId: sourceChainId, | ||
to: bridgeContract | ||
? bridgeContract | ||
: { | ||
$or: [ARB_ONE_TO_MAINNET_GATEWAY, ARB_NOVA_TO_MAINNET_GATEWAY], | ||
}, | ||
input: { | ||
$abi: OUTBOUND_TRANSFER_L2_TO_L1, | ||
_to: recipient, | ||
_amount: amount, | ||
_l1Token: findL1TokenForL2Token(tokenAddress), | ||
}, | ||
}); | ||
import { ARBSYS_WITHDRAW_ETH_FRAG, INBOX_DEPOSIT_ETH_FRAG, OUTBOUND_TRANSFER_L2_TO_L1, OUTBOUND_TRANSFER_L1_TO_L2 } from './abi'; | ||
export const bridge = async bridge => { | ||
// This is the information we'll use to compose the Transaction object | ||
const { | ||
sourceChainId, | ||
destinationChainId, | ||
contractAddress, | ||
tokenAddress, | ||
amount, | ||
recipient | ||
} = bridge; | ||
if (!tokenAddress) { | ||
// If token address is undefined, determining the exact bridge contract is not possible | ||
const contracts = sourceChainId === ETH_CHAIN_ID ? [MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY, ARB_ONE_DELAYED_INBOX, ARB_NOVA_DELAYED_INBOX] : [ARB_ONE_TO_MAINNET_GATEWAY, ARB_NOVA_TO_MAINNET_GATEWAY, UNIVERSAL_ARBSYS_PRECOMPILE]; | ||
const abiFrags = sourceChainId === ETH_CHAIN_ID ? [...OUTBOUND_TRANSFER_L1_TO_L2, ...INBOX_DEPOSIT_ETH_FRAG] : [...OUTBOUND_TRANSFER_L2_TO_L1, ...ARBSYS_WITHDRAW_ETH_FRAG]; | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
from: recipient, | ||
to: { | ||
$or: contracts | ||
}, | ||
input: { | ||
$abi: abiFrags | ||
} | ||
}); | ||
} | ||
const isBridgingToken = tokenAddress !== ETH_TOKEN_ADDRESS; | ||
if (isBridgingToken) { | ||
const bridgeContract = contractAddress || getContractAddressFromChainId(sourceChainId, destinationChainId); | ||
if (sourceChainId !== ETH_CHAIN_ID) { | ||
return compressJson({ | ||
// L2 to L1 Token Transfer | ||
chainId: sourceChainId, | ||
to: bridgeContract ? bridgeContract : { | ||
$or: [ARB_ONE_TO_MAINNET_GATEWAY, ARB_NOVA_TO_MAINNET_GATEWAY] | ||
}, | ||
input: { | ||
$abi: OUTBOUND_TRANSFER_L2_TO_L1, | ||
_to: recipient, | ||
_amount: amount, | ||
_l1Token: findL1TokenForL2Token(tokenAddress) | ||
} | ||
// L1 to L2 Token Transfer | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
to: bridgeContract | ||
? bridgeContract | ||
: { | ||
$or: [MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY], | ||
}, | ||
input: { | ||
$abi: OUTBOUND_TRANSFER_L1_TO_L2, | ||
_to: recipient, | ||
_amount: amount, | ||
_token: tokenAddress, | ||
}, | ||
}); | ||
}); | ||
} | ||
if (sourceChainId === ETH_CHAIN_ID) { | ||
let networkInbox; | ||
if (destinationChainId) { | ||
networkInbox = | ||
destinationChainId === ARB_NOVA_CHAIN_ID | ||
? ARB_NOVA_DELAYED_INBOX | ||
: ARB_ONE_DELAYED_INBOX; | ||
} | ||
// L1 to L2 ETH Transfer | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
to: contractAddress || networkInbox, | ||
from: recipient, | ||
value: amount, | ||
input: { | ||
$abi: INBOX_DEPOSIT_ETH_FRAG, | ||
}, | ||
}); | ||
// L1 to L2 Token Transfer | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
to: bridgeContract ? bridgeContract : { | ||
$or: [MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY] | ||
}, | ||
input: { | ||
$abi: OUTBOUND_TRANSFER_L1_TO_L2, | ||
_to: recipient, | ||
_amount: amount, | ||
_token: tokenAddress | ||
} | ||
}); | ||
} | ||
if (sourceChainId === ETH_CHAIN_ID) { | ||
let networkInbox; | ||
if (destinationChainId) { | ||
networkInbox = destinationChainId === ARB_NOVA_CHAIN_ID ? ARB_NOVA_DELAYED_INBOX : ARB_ONE_DELAYED_INBOX; | ||
} | ||
// L2 to L1 ETH Transfer | ||
// L1 to L2 ETH Transfer | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
value: amount, | ||
to: contractAddress || UNIVERSAL_ARBSYS_PRECOMPILE, | ||
input: { | ||
$abi: ARBSYS_WITHDRAW_ETH_FRAG, | ||
destination: recipient, | ||
}, | ||
chainId: sourceChainId, | ||
to: contractAddress || networkInbox, | ||
from: recipient, | ||
value: amount, | ||
input: { | ||
$abi: INBOX_DEPOSIT_ETH_FRAG | ||
} | ||
}); | ||
} | ||
// L2 to L1 ETH Transfer | ||
return compressJson({ | ||
chainId: sourceChainId, | ||
value: amount, | ||
to: contractAddress || UNIVERSAL_ARBSYS_PRECOMPILE, | ||
input: { | ||
$abi: ARBSYS_WITHDRAW_ETH_FRAG, | ||
destination: recipient | ||
} | ||
}); | ||
}; | ||
export const getSupportedTokenAddresses = async (_chainId) => { | ||
return ArbitrumTokens[_chainId]; | ||
export const getSupportedTokenAddresses = async _chainId => { | ||
return ArbitrumTokens[_chainId]; | ||
}; | ||
export const getSupportedChainIds = async () => { | ||
return CHAIN_ID_ARRAY; | ||
return CHAIN_ID_ARRAY; | ||
}; | ||
//# sourceMappingURL=Arbitrum.js.map |
@@ -5,7 +5,3 @@ // The arbitrum Native Bridge only supports three chains, Arbitrum, Arbitrum Nova, and Ethereum | ||
export const ARB_NOVA_CHAIN_ID = 42170; | ||
export const CHAIN_ID_ARRAY = [ | ||
ETH_CHAIN_ID, | ||
ARB_ONE_CHAIN_ID, | ||
ARB_NOVA_CHAIN_ID, | ||
]; | ||
export const CHAIN_ID_ARRAY = [ETH_CHAIN_ID, ARB_ONE_CHAIN_ID, ARB_NOVA_CHAIN_ID]; | ||
//# sourceMappingURL=chain-ids.js.map |
@@ -1,11 +0,11 @@ | ||
import { PluginActionNotImplementedError, } from '@rabbitholegg/questdk'; | ||
import { bridge, getSupportedChainIds, getSupportedTokenAddresses, } from './Arbitrum'; | ||
import { PluginActionNotImplementedError } from '@rabbitholegg/questdk'; | ||
import { bridge, getSupportedChainIds, getSupportedTokenAddresses } from './Arbitrum'; | ||
export const Arbitrum = { | ||
pluginId: 'arbitrum', | ||
getSupportedTokenAddresses, | ||
getSupportedChainIds, | ||
bridge, | ||
swap: async () => new PluginActionNotImplementedError(), | ||
mint: async () => new PluginActionNotImplementedError(), | ||
pluginId: 'arbitrum', | ||
getSupportedTokenAddresses, | ||
getSupportedChainIds, | ||
bridge, | ||
swap: async () => new PluginActionNotImplementedError(), | ||
mint: async () => new PluginActionNotImplementedError() | ||
}; | ||
//# sourceMappingURL=index.js.map |
@@ -1,1 +0,1 @@ | ||
{"type":"module","sideEffects":false} | ||
{"type":"module"} |
import { zeroAddress as ETH_ADDRESS } from 'viem'; | ||
import { ETH_CHAIN_ID, ARB_ONE_CHAIN_ID, ARB_NOVA_CHAIN_ID } from './chain-ids'; | ||
// For now we're mainly supported the highest traffic Arbitrum tokens | ||
// excluded USDT due to it not being compatible with arbitrum nova | ||
// -------------!!!!! IMPORTANT!!!!!---------------- | ||
// WHEN ADDING NEW TOKENS, MAKE SURE TO UPDATE l1ToL2Map in utils.ts | ||
export const ArbitrumTokens = { | ||
[ETH_CHAIN_ID]: [ | ||
ETH_ADDRESS, | ||
'0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC | ||
'0x6B175474E89094C44Da98b954EedeAC495271d0F', // DAI | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', // ARB | ||
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', // WBTC | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH | ||
], | ||
[ARB_ONE_CHAIN_ID]: [ | ||
ETH_ADDRESS, | ||
'0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', // USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', // DAI | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', // ARB | ||
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', // WBTC | ||
'0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', // WETH | ||
], | ||
[ARB_NOVA_CHAIN_ID]: [ | ||
ETH_ADDRESS, | ||
'0x750ba8b76187092B0D1E87E28daaf484d1b5273b', // USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', // DAI | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', // ARB | ||
'0x1d05e4e72cD994cdF976181CfB0707345763564d', // WBTC | ||
'0x722E8BdD2ce80A4422E880164f2079488e115365', // WETH | ||
], | ||
[ETH_CHAIN_ID]: [ETH_ADDRESS, '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', | ||
// USDC | ||
'0x6B175474E89094C44Da98b954EedeAC495271d0F', | ||
// DAI | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', | ||
// ARB | ||
'0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', | ||
// WBTC | ||
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2' // WETH | ||
], | ||
[ARB_ONE_CHAIN_ID]: [ETH_ADDRESS, '0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8', | ||
// USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
// DAI | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
// ARB | ||
'0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f', | ||
// WBTC | ||
'0x82aF49447D8a07e3bd95BD0d56f35241523fBab1' // WETH | ||
], | ||
[ARB_NOVA_CHAIN_ID]: [ETH_ADDRESS, '0x750ba8b76187092B0D1E87E28daaf484d1b5273b', | ||
// USDC | ||
'0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1', | ||
// DAI | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', | ||
// ARB | ||
'0x1d05e4e72cD994cdF976181CfB0707345763564d', | ||
// WBTC | ||
'0x722E8BdD2ce80A4422E880164f2079488e115365' // WETH | ||
] | ||
}; | ||
//# sourceMappingURL=supported-token-addresses.js.map |
export const L1_TOKEN_TO_ONE = { | ||
chainId: 1, | ||
from: '0xf9ce182b0fbe597773ab9bb5159b7479047de8fe', | ||
to: '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef', | ||
hash: '0xcdbcb66c6a194ae2f0a58b00c1e6ec0daea08c901590ba056cc6806581bf5a94', | ||
input: '0xd2ce7d65000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f9ce182b0fbe597773ab9bb5159b7479047de8fe0000000000000000000000000000000000000000000000803216cf6e916f980000000000000000000000000000000000000000000000000000000000000177ee0000000000000000000000000000000000000000000000000000000011e1a30000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000268971162634000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '706819394000000', | ||
chainId: 1, | ||
from: '0xf9ce182b0fbe597773ab9bb5159b7479047de8fe', | ||
to: '0x72ce9c846789fdb6fc1f34ac4ad25dd9ef7031ef', | ||
hash: '0xcdbcb66c6a194ae2f0a58b00c1e6ec0daea08c901590ba056cc6806581bf5a94', | ||
input: '0xd2ce7d65000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca000000000000000000000000f9ce182b0fbe597773ab9bb5159b7479047de8fe0000000000000000000000000000000000000000000000803216cf6e916f980000000000000000000000000000000000000000000000000000000000000177ee0000000000000000000000000000000000000000000000000000000011e1a30000000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000268971162634000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '706819394000000' | ||
}; | ||
export const L1_TOKEN_TO_NOVA = { | ||
chainId: 1, | ||
from: '0x1f536b22d877dc2a116c7bedc862a539551bc56d', | ||
to: '0xc840838bc438d73c16c2f8b22d2ce3669963cd48', | ||
hash: '0x2c55e34062d1d859878400d49f02b21b529a61ed887a6d5dff369965d6bfb977', | ||
input: '0xd2ce7d65000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000001f536b22d877dc2a116c7bedc862a539551bc56d00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000001777b0000000000000000000000000000000000000000000000000000000001c9c38000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000035232b888b68000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '937686417941760', | ||
chainId: 1, | ||
from: '0x1f536b22d877dc2a116c7bedc862a539551bc56d', | ||
to: '0xc840838bc438d73c16c2f8b22d2ce3669963cd48', | ||
hash: '0x2c55e34062d1d859878400d49f02b21b529a61ed887a6d5dff369965d6bfb977', | ||
input: '0xd2ce7d65000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb480000000000000000000000001f536b22d877dc2a116c7bedc862a539551bc56d00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000000000000000000000000000000000000001777b0000000000000000000000000000000000000000000000000000000001c9c38000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000035232b888b68000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000', | ||
value: '937686417941760' | ||
}; | ||
export const L1_ETH_TO_ONE = { | ||
chainId: 1, | ||
from: '0x6d7ac63aaa7ba8925dcb3e44be6355261dcf688f', | ||
to: '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f', | ||
hash: '0x81a963983ac2156e6ca76be1e2b36a5cb465943bef72b9844d6d3700ff58aec7', | ||
input: '0x439370b1', | ||
value: '3000000000000000000', | ||
chainId: 1, | ||
from: '0x6d7ac63aaa7ba8925dcb3e44be6355261dcf688f', | ||
to: '0x4dbd4fc535ac27206064b68ffcf827b0a60bab3f', | ||
hash: '0x81a963983ac2156e6ca76be1e2b36a5cb465943bef72b9844d6d3700ff58aec7', | ||
input: '0x439370b1', | ||
value: '3000000000000000000' | ||
}; | ||
export const L1_ETH_TO_NOVA = { | ||
chainId: 1, | ||
from: '0xba84392ae32a0ffcab1195c57172c05292e02b3e', | ||
to: '0xc4448b71118c9071bcb9734a0eac55d18a153949', | ||
hash: '0xe3df33a0ad03d7c26eb523a28dfb9884873ba9475255878a75ff3881025c5768', | ||
input: '0x439370b1', | ||
value: '250000000000000000', | ||
chainId: 1, | ||
from: '0xba84392ae32a0ffcab1195c57172c05292e02b3e', | ||
to: '0xc4448b71118c9071bcb9734a0eac55d18a153949', | ||
hash: '0xe3df33a0ad03d7c26eb523a28dfb9884873ba9475255878a75ff3881025c5768', | ||
input: '0x439370b1', | ||
value: '250000000000000000' | ||
}; | ||
export const L2_ETH_TO_L1 = { | ||
chainId: 42170, | ||
from: '0x7169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
to: '0x0000000000000000000000000000000000000064', | ||
hash: '0xbaf3a0440ea37971ee1c7b2ee1139e5ba474497a28d15b80e749434cb6063e73', | ||
input: '0x25e160630000000000000000000000007169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
value: '5000000000000000', | ||
chainId: 42170, | ||
from: '0x7169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
to: '0x0000000000000000000000000000000000000064', | ||
hash: '0xbaf3a0440ea37971ee1c7b2ee1139e5ba474497a28d15b80e749434cb6063e73', | ||
input: '0x25e160630000000000000000000000007169b95c460a75bc6677481a1fcae1ea598f3b65', | ||
value: '5000000000000000' | ||
}; | ||
export const L2_TOKEN_TO_L1 = { | ||
chainId: 42161, | ||
from: '0x572b093d735b9e91cbd90972e846333d444f25cd', | ||
to: '0x5288c571fd7ad117bea99bf60fe0846c4e84f933', | ||
hash: '0x3241a751cbe4bb5effd2532c5e1366d62bbe462f03cc999b462fa297b184f8fb', | ||
input: '0x7b3a3c8b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000572b093d735b9e91cbd90972e846333d444f25cd00000000000000000000000000000000000000000000000000000023736c15c400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000', | ||
value: '0', | ||
chainId: 42161, | ||
from: '0x572b093d735b9e91cbd90972e846333d444f25cd', | ||
to: '0x5288c571fd7ad117bea99bf60fe0846c4e84f933', | ||
hash: '0x3241a751cbe4bb5effd2532c5e1366d62bbe462f03cc999b462fa297b184f8fb', | ||
input: '0x7b3a3c8b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000572b093d735b9e91cbd90972e846333d444f25cd00000000000000000000000000000000000000000000000000000023736c15c400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000', | ||
value: '0' | ||
}; | ||
//# sourceMappingURL=test-transactions.js.map |
@@ -1,71 +0,56 @@ | ||
import {} from 'viem'; | ||
import { ARB_NOVA_CHAIN_ID, ARB_ONE_CHAIN_ID, ETH_CHAIN_ID } from './chain-ids'; | ||
import { ARB_NOVA_TO_MAINNET_GATEWAY, ARB_ONE_TO_MAINNET_GATEWAY, MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY, } from './contract-addresses'; | ||
const l1ToL2Map = [ | ||
[ | ||
// USDC | ||
JSON.stringify([ | ||
'0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', // one | ||
'0x750ba8b76187092b0d1e87e28daaf484d1b5273b', // nova | ||
]), | ||
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48', // ethereum | ||
], | ||
[ | ||
// ARB | ||
JSON.stringify([ | ||
'0x912CE59144191C1204E64559FE8253a0e49E6548', // one | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD', // nova | ||
]), | ||
'0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1', // ethereum | ||
], | ||
[ | ||
// WBTC | ||
JSON.stringify([ | ||
'0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f', // one | ||
'0x1d05e4e72cd994cdf976181cfb0707345763564d', // nova | ||
]), | ||
'0x2260fac5e5542a773aa44fbcfedf7c193bc2c599', // ethereum | ||
], | ||
[ | ||
// WETH | ||
JSON.stringify([ | ||
'0x82af49447d8a07e3bd95bd0d56f35241523fbab1', // one | ||
'0x722e8bdd2ce80a4422e880164f2079488e115365', // nova | ||
]), | ||
'0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', // ethereum | ||
], | ||
[ | ||
// DAI | ||
JSON.stringify(['0xda10009cbd5d07dd0cecc66161fc93d7c9000da1']), // one/nova | ||
'0x6b175474e89094c44da98b954eedeac495271d0f', // ethereum | ||
], | ||
]; | ||
import { ARB_NOVA_TO_MAINNET_GATEWAY, ARB_ONE_TO_MAINNET_GATEWAY, MAINNET_TO_ARB_NOVA_GATEWAY, MAINNET_TO_ARB_ONE_GATEWAY } from './contract-addresses'; | ||
const l1ToL2Map = [[ | ||
// USDC | ||
JSON.stringify(['0xff970a61a04b1ca14834a43f5de4533ebddb5cc8', | ||
// one | ||
'0x750ba8b76187092b0d1e87e28daaf484d1b5273b' // nova | ||
]), '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' // ethereum | ||
], [ | ||
// ARB | ||
JSON.stringify(['0x912CE59144191C1204E64559FE8253a0e49E6548', | ||
// one | ||
'0xf823C3cD3CeBE0a1fA952ba88Dc9EEf8e0Bf46AD' // nova | ||
]), '0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1' // ethereum | ||
], [ | ||
// WBTC | ||
JSON.stringify(['0x2f2a2543b76a4166549f7aab2e75bef0aefc5b0f', | ||
// one | ||
'0x1d05e4e72cd994cdf976181cfb0707345763564d' // nova | ||
]), '0x2260fac5e5542a773aa44fbcfedf7c193bc2c599' // ethereum | ||
], [ | ||
// WETH | ||
JSON.stringify(['0x82af49447d8a07e3bd95bd0d56f35241523fbab1', | ||
// one | ||
'0x722e8bdd2ce80a4422e880164f2079488e115365' // nova | ||
]), '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' // ethereum | ||
], [ | ||
// DAI | ||
JSON.stringify(['0xda10009cbd5d07dd0cecc66161fc93d7c9000da1']), | ||
// one/nova | ||
'0x6b175474e89094c44da98b954eedeac495271d0f' // ethereum | ||
]]; | ||
const l1TokenFromL2Tokens = new Map(l1ToL2Map); | ||
export function findL1TokenForL2Token(l2TokenAddress) { | ||
if (l2TokenAddress) { | ||
for (const [key, value] of l1TokenFromL2Tokens) { | ||
const pair = JSON.parse(key.toLowerCase()); | ||
if (pair.includes(l2TokenAddress.toLowerCase())) { | ||
return value; | ||
} | ||
} | ||
if (l2TokenAddress) { | ||
for (const [key, value] of l1TokenFromL2Tokens) { | ||
const pair = JSON.parse(key.toLowerCase()); | ||
if (pair.includes(l2TokenAddress.toLowerCase())) { | ||
return value; | ||
} | ||
} | ||
return undefined; | ||
} | ||
return undefined; | ||
} | ||
export const getContractAddressFromChainId = (sourceChainId, destinationChainId) => { | ||
// This is klunky but the alternative is some sort of convoluted 2D mapping | ||
if (destinationChainId === undefined) | ||
return undefined; | ||
if (sourceChainId === ARB_NOVA_CHAIN_ID) | ||
return ARB_NOVA_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === ARB_ONE_CHAIN_ID) | ||
return ARB_ONE_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === ETH_CHAIN_ID) { | ||
if (destinationChainId === ARB_NOVA_CHAIN_ID) | ||
return MAINNET_TO_ARB_NOVA_GATEWAY; | ||
if (destinationChainId === ARB_ONE_CHAIN_ID) | ||
return MAINNET_TO_ARB_ONE_GATEWAY; | ||
} | ||
return '0x0'; | ||
// This is klunky but the alternative is some sort of convoluted 2D mapping | ||
if (destinationChainId === undefined) return undefined; | ||
if (sourceChainId === ARB_NOVA_CHAIN_ID) return ARB_NOVA_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === ARB_ONE_CHAIN_ID) return ARB_ONE_TO_MAINNET_GATEWAY; | ||
if (sourceChainId === ETH_CHAIN_ID) { | ||
if (destinationChainId === ARB_NOVA_CHAIN_ID) return MAINNET_TO_ARB_NOVA_GATEWAY; | ||
if (destinationChainId === ARB_ONE_CHAIN_ID) return MAINNET_TO_ARB_ONE_GATEWAY; | ||
} | ||
return '0x0'; | ||
}; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@rabbitholegg/questdk-plugin-arbitrum", | ||
"version": "1.0.0-alpha.14", | ||
"version": "1.0.0-alpha.15", | ||
"type": "module", | ||
@@ -12,3 +12,2 @@ "exports": { | ||
"module": "./dist/esm/index.js", | ||
"packageManager": "pnpm@8.15.1", | ||
"description": "", | ||
@@ -21,4 +20,4 @@ "keywords": [], | ||
"devDependencies": { | ||
"tsconfig": "0.0.1-alpha.0", | ||
"@rabbitholegg/questdk": "2.0.0-alpha.37" | ||
"tsconfig": "0.1.0-alpha.1", | ||
"@rabbitholegg/questdk": "2.0.0-alpha.45" | ||
}, | ||
@@ -28,10 +27,12 @@ "scripts": { | ||
"bench:ci": "CI=true vitest bench", | ||
"build": "pnpm run clean && pnpm run build:cjs && pnpm run build:esm && pnpm run build:types", | ||
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --outDir ./dist/cjs --removeComments --verbatimModuleSyntax false && echo > ./dist/cjs/package.json '{\"type\":\"commonjs\"}'", | ||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir ./dist/esm && echo > ./dist/esm/package.json '{\"type\":\"module\",\"sideEffects\":false}'", | ||
"build": "pnpm build:types && pnpm build:esm && pnpm postbuild:esm && pnpm build:cjs && pnpm postbuild:cjs && BABEL_ENV=esmBundled pnpm rollup -c", | ||
"build:esm": "BABEL_ENV=esmUnbundled babel src --extensions '.ts' --out-dir 'dist/esm' --source-maps", | ||
"build:cjs": "BABEL_ENV=cjs babel src --extensions '.ts' --out-dir 'dist/cjs' --source-maps", | ||
"build:types": "tsc --project tsconfig.build.json --module esnext --declarationDir ./dist/types --emitDeclarationOnly --declaration --declarationMap", | ||
"clean": "rimraf dist", | ||
"postbuild:cjs": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json", | ||
"postbuild:esm": "echo '{\"type\":\"module\"}' > dist/esm/package.json", | ||
"format": "rome format . --write", | ||
"lint": "rome check .", | ||
"lint:fix": "pnpm lint --apply", | ||
"lint": "eslint .", | ||
"lint:fix": "eslint . --fix", | ||
"test": "vitest dev", | ||
@@ -38,0 +39,0 @@ "test:cov": "vitest dev --coverage", |
@@ -1,2 +0,2 @@ | ||
import { GreaterThanOrEqual, apply } from '@rabbitholegg/questdk/filter' | ||
import { GreaterThanOrEqual, apply } from '@rabbitholegg/questdk' | ||
import { bridge } from './Arbitrum' | ||
@@ -15,3 +15,3 @@ import { OUTBOUND_TRANSFER_L1_TO_L2 } from './abi' | ||
L2_TOKEN_TO_L1, | ||
} from './test-transactions.js' | ||
} from './test-transactions' | ||
describe('Given the arbitrum plugin', () => { | ||
@@ -18,0 +18,0 @@ describe('When handling the bridge', () => { |
@@ -10,3 +10,3 @@ import { type Address } from 'viem' | ||
const l1ToL2Map: [string, Address][] = [ | ||
const l1ToL2Map: Array<[string, Address]> = [ | ||
[ | ||
@@ -13,0 +13,0 @@ // USDC |
@@ -12,8 +12,6 @@ { | ||
"compilerOptions": { | ||
"declaration": true, | ||
"declarationDir": "./dist/types", | ||
"resolveJsonModule": true, | ||
"sourceMap": true, | ||
"rootDir": "./src" | ||
"rootDir": "./src", | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2490750
97
14911
1