@gardenfi/swap 0.0.1 → 0.0.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -44
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +157 -25
- package/dist/index100.cjs +1 -0
- package/dist/index100.js +6 -0
- package/dist/index101.cjs +1 -0
- package/dist/index101.js +10 -0
- package/dist/index102.cjs +1 -0
- package/dist/index102.js +8 -0
- package/dist/index103.cjs +1 -0
- package/dist/index103.js +16 -0
- package/dist/index104.cjs +1 -0
- package/dist/index104.js +174 -0
- package/dist/index105.cjs +1 -0
- package/dist/index105.js +36 -0
- package/dist/index106.cjs +1 -0
- package/dist/index106.js +54 -0
- package/dist/index107.cjs +1 -0
- package/dist/index107.js +40 -0
- package/dist/index108.cjs +1 -0
- package/dist/index108.js +27 -0
- package/dist/index109.cjs +1 -0
- package/dist/index109.js +82 -0
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +23 -33
- package/dist/index110.cjs +1 -0
- package/dist/index110.js +5 -0
- package/dist/index111.cjs +1 -0
- package/dist/index111.js +35 -0
- package/dist/index112.cjs +1 -0
- package/dist/index112.js +118 -0
- package/dist/index113.cjs +1 -0
- package/dist/index113.js +6 -0
- package/dist/index114.cjs +1 -0
- package/dist/index114.js +18 -0
- package/dist/index115.cjs +1 -0
- package/dist/index115.js +14 -0
- package/dist/index116.cjs +1 -0
- package/dist/index116.js +21 -0
- package/dist/index117.cjs +1 -0
- package/dist/index117.js +61 -0
- package/dist/index118.cjs +1 -0
- package/dist/index118.js +23 -0
- package/dist/index119.cjs +1 -0
- package/dist/index119.js +16 -0
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +67 -63
- package/dist/index120.cjs +1 -0
- package/dist/index120.js +287 -0
- package/dist/index121.cjs +1 -0
- package/dist/index121.js +576 -0
- package/dist/index122.cjs +1 -0
- package/dist/index122.js +36 -0
- package/dist/index123.cjs +1 -0
- package/dist/index123.js +6 -0
- package/dist/index124.cjs +1 -0
- package/dist/index124.js +12 -0
- package/dist/index125.cjs +1 -0
- package/dist/index125.js +119 -0
- package/dist/index126.cjs +1 -0
- package/dist/index126.js +64 -0
- package/dist/index127.cjs +1 -0
- package/dist/index127.js +27 -0
- package/dist/index128.cjs +1 -0
- package/dist/index128.js +39 -0
- package/dist/index129.cjs +1 -0
- package/dist/index129.js +44 -0
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +28 -29
- package/dist/index130.cjs +1 -0
- package/dist/index130.js +61 -0
- package/dist/index131.cjs +1 -0
- package/dist/index131.js +43 -0
- package/dist/index132.cjs +1 -0
- package/dist/index132.js +12 -0
- package/dist/index133.cjs +1 -0
- package/dist/index133.js +34 -0
- package/dist/index134.cjs +1 -0
- package/dist/index134.js +39 -0
- package/dist/index135.cjs +1 -0
- package/dist/index135.js +12 -0
- package/dist/index136.cjs +1 -0
- package/dist/index136.js +32 -0
- package/dist/index137.cjs +1 -0
- package/dist/index137.js +53 -0
- package/dist/index138.cjs +1 -0
- package/dist/index138.js +73 -0
- package/dist/index139.cjs +1 -0
- package/dist/index139.js +44 -0
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +13 -186
- package/dist/index140.cjs +1 -0
- package/dist/index140.js +80 -0
- package/dist/index141.cjs +1 -0
- package/dist/index141.js +11 -0
- package/dist/index142.cjs +1 -0
- package/dist/index142.js +9 -0
- package/dist/index143.cjs +1 -0
- package/dist/index143.js +20 -0
- package/dist/index144.cjs +1 -0
- package/dist/index144.js +11 -0
- package/dist/index145.cjs +1 -0
- package/dist/index145.js +16 -0
- package/dist/index146.cjs +1 -0
- package/dist/index146.js +10 -0
- package/dist/index147.cjs +1 -0
- package/dist/index147.js +19 -0
- package/dist/index148.cjs +1 -0
- package/dist/index148.js +49 -0
- package/dist/index149.cjs +1 -0
- package/dist/index149.js +16 -0
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +49 -46
- package/dist/index150.cjs +1 -0
- package/dist/index150.js +19 -0
- package/dist/index151.cjs +1 -0
- package/dist/index151.js +16 -0
- package/dist/index152.cjs +1 -0
- package/dist/index152.js +9 -0
- package/dist/index153.cjs +1 -0
- package/dist/index153.js +38 -0
- package/dist/index154.cjs +1 -0
- package/dist/index154.js +12 -0
- package/dist/index155.cjs +1 -0
- package/dist/index155.js +11 -0
- package/dist/index156.cjs +1 -0
- package/dist/index156.js +32 -0
- package/dist/index157.cjs +1 -0
- package/dist/index157.js +13 -0
- package/dist/index158.cjs +1 -0
- package/dist/index158.js +17 -0
- package/dist/index159.cjs +1 -0
- package/dist/index159.js +15 -0
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +8 -311
- package/dist/index160.cjs +1 -0
- package/dist/index160.js +124 -0
- package/dist/index161.cjs +1 -0
- package/dist/index161.js +85 -0
- package/dist/index162.cjs +1 -0
- package/dist/index162.js +180 -0
- package/dist/index163.cjs +1 -0
- package/dist/index163.js +47 -0
- package/dist/index164.cjs +1 -0
- package/dist/index164.js +9 -0
- package/dist/index165.cjs +1 -0
- package/dist/index165.js +17 -0
- package/dist/index166.cjs +1 -0
- package/dist/index166.js +17 -0
- package/dist/index167.cjs +1 -0
- package/dist/index167.js +106 -0
- package/dist/index168.cjs +1 -0
- package/dist/index168.js +78 -0
- package/dist/index169.cjs +1 -0
- package/dist/index169.js +92 -0
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +59 -27
- package/dist/index170.cjs +1 -0
- package/dist/index170.js +154 -0
- package/dist/index171.cjs +1 -0
- package/dist/index171.js +141 -0
- package/dist/index172.cjs +1 -0
- package/dist/index172.js +72 -0
- package/dist/index173.cjs +1 -0
- package/dist/index173.js +26 -0
- package/dist/index174.cjs +1 -0
- package/dist/index174.js +167 -0
- package/dist/index175.cjs +1 -0
- package/dist/index175.js +9 -0
- package/dist/index176.cjs +1 -0
- package/dist/index176.js +16 -0
- package/dist/index177.cjs +1 -0
- package/dist/index177.js +22 -0
- package/dist/index178.cjs +1 -0
- package/dist/index178.js +109 -0
- package/dist/index179.cjs +1 -0
- package/dist/index179.js +81 -0
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +74 -14
- package/dist/index180.cjs +1 -0
- package/dist/index180.js +12 -0
- package/dist/index181.cjs +1 -0
- package/dist/index181.js +31 -0
- package/dist/index182.cjs +1 -0
- package/dist/index182.js +93 -0
- package/dist/index183.cjs +1 -0
- package/dist/index183.js +5 -0
- package/dist/index184.cjs +1 -0
- package/dist/index184.js +4 -0
- package/dist/index185.cjs +2 -0
- package/dist/index185.js +5 -0
- package/dist/index186.cjs +1 -0
- package/dist/index186.js +11 -0
- package/dist/index187.cjs +20 -0
- package/dist/index187.js +329 -0
- package/dist/index188.cjs +1 -0
- package/dist/index188.js +16 -0
- package/dist/index189.cjs +2 -0
- package/dist/index189.js +62 -0
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +76 -224
- package/dist/index190.cjs +1 -0
- package/dist/index190.js +4 -0
- package/dist/index191.cjs +1 -0
- package/dist/index191.js +10 -0
- package/dist/index192.cjs +1 -0
- package/dist/index192.js +34 -0
- package/dist/index193.cjs +1 -0
- package/dist/index193.js +24 -0
- package/dist/index194.cjs +1 -0
- package/dist/index194.js +8 -0
- package/dist/index195.cjs +1 -0
- package/dist/index195.js +76 -0
- package/dist/index196.cjs +1 -0
- package/dist/index196.js +8 -0
- package/dist/index197.cjs +1 -0
- package/dist/index197.js +8 -0
- package/dist/index198.cjs +9 -0
- package/dist/index198.js +38 -0
- package/dist/index199.cjs +2 -0
- package/dist/index199.js +123 -0
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +58 -13
- package/dist/index200.cjs +1 -0
- package/dist/index200.js +5 -0
- package/dist/index201.cjs +1 -0
- package/dist/index201.js +21 -0
- package/dist/index202.cjs +1 -0
- package/dist/index202.js +36 -0
- package/dist/index203.cjs +1 -0
- package/dist/index203.js +38 -0
- package/dist/index204.cjs +1 -0
- package/dist/index204.js +26 -0
- package/dist/index205.cjs +1 -0
- package/dist/index205.js +11 -0
- package/dist/index206.cjs +4 -0
- package/dist/index206.js +197 -0
- package/dist/index207.cjs +1 -0
- package/dist/index207.js +4 -0
- package/dist/index208.cjs +3 -0
- package/dist/index208.js +454 -0
- package/dist/index209.cjs +1 -0
- package/dist/index209.js +30 -0
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +146 -85
- package/dist/index210.cjs +1 -0
- package/dist/index210.js +164 -0
- package/dist/index211.cjs +1 -0
- package/dist/index211.js +130 -0
- package/dist/index212.cjs +1 -0
- package/dist/index212.js +41 -0
- package/dist/index213.cjs +1 -0
- package/dist/index213.js +30 -0
- package/dist/index214.cjs +1 -0
- package/dist/index214.js +58 -0
- package/dist/index215.cjs +1 -0
- package/dist/index215.js +194 -0
- package/dist/index216.cjs +1 -0
- package/dist/index216.js +6 -0
- package/dist/index217.cjs +1 -0
- package/dist/index217.js +76 -0
- package/dist/index218.cjs +1 -0
- package/dist/index218.js +23 -0
- package/dist/index219.cjs +1 -0
- package/dist/index219.js +5 -0
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +67 -137
- package/dist/index220.cjs +1 -0
- package/dist/index220.js +19 -0
- package/dist/index221.cjs +1 -0
- package/dist/index221.js +26 -0
- package/dist/index222.cjs +1 -0
- package/dist/index222.js +37 -0
- package/dist/index223.cjs +1 -0
- package/dist/index223.js +5 -0
- package/dist/index224.cjs +1 -0
- package/dist/index224.js +30 -0
- package/dist/index225.cjs +1 -0
- package/dist/index225.js +39 -0
- package/dist/index226.cjs +1 -0
- package/dist/index226.js +11 -0
- package/dist/index227.cjs +1 -0
- package/dist/index227.js +28 -0
- package/dist/index228.cjs +1 -0
- package/dist/index228.js +31 -0
- package/dist/index229.cjs +1 -0
- package/dist/index229.js +78 -0
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +63 -20
- package/dist/index230.cjs +1 -0
- package/dist/index230.js +24 -0
- package/dist/index231.cjs +1 -0
- package/dist/index231.js +11 -0
- package/dist/index232.cjs +1 -0
- package/dist/index232.js +13 -0
- package/dist/index233.cjs +1 -0
- package/dist/index233.js +14 -0
- package/dist/index234.cjs +1 -0
- package/dist/index234.js +9 -0
- package/dist/index235.cjs +1 -0
- package/dist/index235.js +9 -0
- package/dist/index236.cjs +1 -0
- package/dist/index236.js +16 -0
- package/dist/index237.cjs +1 -0
- package/dist/index237.js +35 -0
- package/dist/index238.cjs +1 -0
- package/dist/index238.js +7 -0
- package/dist/index239.cjs +1 -0
- package/dist/index239.js +40 -0
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +31 -17
- package/dist/index240.cjs +1 -0
- package/dist/index240.js +114 -0
- package/dist/index241.cjs +1 -0
- package/dist/index241.js +52 -0
- package/dist/index242.cjs +1 -0
- package/dist/index242.js +35 -0
- package/dist/index243.cjs +1 -0
- package/dist/index243.js +11 -0
- package/dist/index244.cjs +1 -0
- package/dist/index244.js +10 -0
- package/dist/index245.cjs +1 -0
- package/dist/index245.js +19 -0
- package/dist/index246.cjs +1 -0
- package/dist/index246.js +25 -0
- package/dist/index247.cjs +1 -0
- package/dist/index247.js +107 -0
- package/dist/index248.cjs +1 -0
- package/dist/index248.js +5 -0
- package/dist/index249.cjs +1 -0
- package/dist/index249.js +8 -0
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +23 -104
- package/dist/index250.cjs +1 -0
- package/dist/index250.js +34 -0
- package/dist/index251.cjs +1 -0
- package/dist/index251.js +23 -0
- package/dist/index252.cjs +1 -0
- package/dist/index252.js +6 -0
- package/dist/index253.cjs +1 -0
- package/dist/index253.js +20 -0
- package/dist/index254.cjs +1 -0
- package/dist/index254.js +8 -0
- package/dist/index255.cjs +1 -0
- package/dist/index255.js +11 -0
- package/dist/index256.cjs +1 -0
- package/dist/index256.js +106 -0
- package/dist/index257.cjs +1 -0
- package/dist/index257.js +67 -0
- package/dist/index258.cjs +1 -0
- package/dist/index258.js +9 -0
- package/dist/index259.cjs +1 -0
- package/dist/index259.js +30 -0
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +173 -75
- package/dist/index260.cjs +1 -0
- package/dist/index260.js +37 -0
- package/dist/index261.cjs +1 -0
- package/dist/index261.js +19 -0
- package/dist/index262.cjs +1 -0
- package/dist/index262.js +81 -0
- package/dist/index263.cjs +1 -0
- package/dist/index263.js +4 -0
- package/dist/index264.cjs +1 -0
- package/dist/index264.js +17 -0
- package/dist/index265.cjs +1 -0
- package/dist/index265.js +21 -0
- package/dist/index266.cjs +1 -0
- package/dist/index266.js +20 -0
- package/dist/index267.cjs +1 -0
- package/dist/index267.js +13 -0
- package/dist/index268.cjs +1 -0
- package/dist/index268.js +43 -0
- package/dist/index269.cjs +1 -0
- package/dist/index269.js +16 -0
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +34 -9
- package/dist/index270.cjs +1 -0
- package/dist/index270.js +27 -0
- package/dist/index271.cjs +1 -0
- package/dist/index271.js +15 -0
- package/dist/index272.cjs +1 -0
- package/dist/index272.js +12 -0
- package/dist/index273.cjs +1 -0
- package/dist/index273.js +33 -0
- package/dist/index274.cjs +1 -0
- package/dist/index274.js +4 -0
- package/dist/index275.cjs +1 -0
- package/dist/index275.js +50 -0
- package/dist/index276.cjs +1 -0
- package/dist/index276.js +14 -0
- package/dist/index277.cjs +1 -0
- package/dist/index277.js +177 -0
- package/dist/index278.cjs +2 -0
- package/dist/index278.js +94 -0
- package/dist/index279.cjs +1 -0
- package/dist/index279.js +43 -0
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +332 -47
- package/dist/index280.cjs +1 -0
- package/dist/index280.js +7 -0
- package/dist/index281.cjs +1 -0
- package/dist/index281.js +166 -0
- package/dist/index282.cjs +1 -0
- package/dist/index282.js +7 -0
- package/dist/index283.cjs +2 -0
- package/dist/index283.js +44 -0
- package/dist/index284.cjs +1 -0
- package/dist/index284.js +4 -0
- package/dist/index285.cjs +1 -0
- package/dist/index285.js +8 -0
- package/dist/index286.cjs +1 -0
- package/dist/index286.js +13 -0
- package/dist/index287.cjs +1 -0
- package/dist/index287.js +22 -0
- package/dist/index288.cjs +1 -0
- package/dist/index288.js +11 -0
- package/dist/index289.cjs +1 -0
- package/dist/index289.js +75 -0
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +4 -61
- package/dist/index290.cjs +1 -0
- package/dist/index290.js +68 -0
- package/dist/index291.cjs +1 -0
- package/dist/index291.js +191 -0
- package/dist/index292.cjs +1 -0
- package/dist/index292.js +25 -0
- package/dist/index293.cjs +1 -0
- package/dist/index293.js +45 -0
- package/dist/index294.cjs +1 -0
- package/dist/index294.js +28 -0
- package/dist/index295.cjs +1 -0
- package/dist/index295.js +93 -0
- package/dist/index296.cjs +1 -0
- package/dist/index296.js +43 -0
- package/dist/index297.cjs +1 -0
- package/dist/index297.js +19 -0
- package/dist/index298.cjs +1 -0
- package/dist/index298.js +16 -0
- package/dist/index299.cjs +1 -0
- package/dist/index299.js +40 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +9 -5
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +271 -35
- package/dist/index300.cjs +1 -0
- package/dist/index300.js +18 -0
- package/dist/index301.cjs +1 -0
- package/dist/index301.js +11 -0
- package/dist/index302.cjs +1 -0
- package/dist/index302.js +10 -0
- package/dist/index303.cjs +1 -0
- package/dist/index303.js +45 -0
- package/dist/index304.cjs +1 -0
- package/dist/index304.js +323 -0
- package/dist/index305.cjs +1 -0
- package/dist/index305.js +608 -0
- package/dist/index306.cjs +1 -0
- package/dist/index306.js +112 -0
- package/dist/index307.cjs +1 -0
- package/dist/index307.js +170 -0
- package/dist/index308.cjs +1 -0
- package/dist/index308.js +304 -0
- package/dist/index309.cjs +1 -0
- package/dist/index309.js +96 -0
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +19 -41
- package/dist/index310.cjs +1 -0
- package/dist/index310.js +59 -0
- package/dist/index311.cjs +1 -0
- package/dist/index311.js +56 -0
- package/dist/index312.cjs +1 -0
- package/dist/index312.js +47 -0
- package/dist/index313.cjs +1 -0
- package/dist/index313.js +18 -0
- package/dist/index314.cjs +1 -0
- package/dist/index314.js +320 -0
- package/dist/index315.cjs +1 -0
- package/dist/index315.js +62 -0
- package/dist/index316.cjs +1 -0
- package/dist/index316.js +22 -0
- package/dist/index317.cjs +1 -0
- package/dist/index317.js +32 -0
- package/dist/index318.cjs +1 -0
- package/dist/index318.js +6 -0
- package/dist/index319.cjs +7 -0
- package/dist/index319.js +240 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +22 -0
- package/dist/index320.cjs +1 -0
- package/dist/index320.js +50 -0
- package/dist/index321.cjs +1 -0
- package/dist/index321.js +215 -0
- package/dist/index322.cjs +1 -0
- package/dist/index322.js +84 -0
- package/dist/index323.cjs +1 -0
- package/dist/index323.js +32 -0
- package/dist/index324.cjs +1 -0
- package/dist/index324.js +79 -0
- package/dist/index325.cjs +1 -0
- package/dist/index325.js +12 -0
- package/dist/index326.cjs +1 -0
- package/dist/index326.js +19 -0
- package/dist/index327.cjs +1 -0
- package/dist/index327.js +25 -0
- package/dist/index328.cjs +1 -0
- package/dist/index328.js +16 -0
- package/dist/index329.cjs +1 -0
- package/dist/index329.js +16 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +6 -0
- package/dist/index330.cjs +1 -0
- package/dist/index330.js +17 -0
- package/dist/index331.cjs +1 -0
- package/dist/index331.js +12 -0
- package/dist/index332.cjs +1 -0
- package/dist/index332.js +18 -0
- package/dist/index333.cjs +1 -0
- package/dist/index333.js +28 -0
- package/dist/index334.cjs +1 -0
- package/dist/index334.js +34 -0
- package/dist/index335.cjs +2 -0
- package/dist/index335.js +21 -0
- package/dist/index336.cjs +1 -0
- package/dist/index336.js +17 -0
- package/dist/index337.cjs +1 -0
- package/dist/index337.js +14 -0
- package/dist/index338.cjs +1 -0
- package/dist/index338.js +15 -0
- package/dist/index339.cjs +1 -0
- package/dist/index339.js +36 -0
- package/dist/index34.cjs +1 -0
- package/dist/index34.js +28 -0
- package/dist/index340.cjs +1 -0
- package/dist/index340.js +118 -0
- package/dist/index341.cjs +1 -0
- package/dist/index341.js +106 -0
- package/dist/index342.cjs +1 -0
- package/dist/index342.js +9 -0
- package/dist/index343.cjs +1 -0
- package/dist/index343.js +9 -0
- package/dist/index344.cjs +1 -0
- package/dist/index344.js +29 -0
- package/dist/index345.cjs +1 -0
- package/dist/index345.js +19 -0
- package/dist/index346.cjs +1 -0
- package/dist/index346.js +217 -0
- package/dist/index347.cjs +1 -0
- package/dist/index347.js +10 -0
- package/dist/index348.cjs +1 -0
- package/dist/index348.js +122 -0
- package/dist/index349.cjs +1 -0
- package/dist/index349.js +7 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +13 -0
- package/dist/index350.cjs +2 -0
- package/dist/index350.js +196 -0
- package/dist/index351.cjs +1 -0
- package/dist/index351.js +80 -0
- package/dist/index352.cjs +1 -0
- package/dist/index352.js +346 -0
- package/dist/index353.cjs +1 -0
- package/dist/index353.js +163 -0
- package/dist/index354.cjs +1 -0
- package/dist/index354.js +7 -0
- package/dist/index355.cjs +1 -0
- package/dist/index355.js +17 -0
- package/dist/index356.cjs +1 -0
- package/dist/index356.js +19 -0
- package/dist/index357.cjs +1 -0
- package/dist/index357.js +12 -0
- package/dist/index358.cjs +1 -0
- package/dist/index358.js +55 -0
- package/dist/index359.cjs +1 -0
- package/dist/index359.js +209 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +44 -0
- package/dist/index360.cjs +1 -0
- package/dist/index360.js +71 -0
- package/dist/index361.cjs +1 -0
- package/dist/index361.js +97 -0
- package/dist/index362.cjs +1 -0
- package/dist/index362.js +31 -0
- package/dist/index363.cjs +1 -0
- package/dist/index363.js +151 -0
- package/dist/index364.cjs +1 -0
- package/dist/index364.js +357 -0
- package/dist/index365.cjs +1 -0
- package/dist/index365.js +6 -0
- package/dist/index366.cjs +1 -0
- package/dist/index366.js +143 -0
- package/dist/index367.cjs +1 -0
- package/dist/index367.js +76 -0
- package/dist/index368.cjs +1 -0
- package/dist/index368.js +34 -0
- package/dist/index369.cjs +1 -0
- package/dist/index369.js +8 -0
- package/dist/index37.cjs +1 -0
- package/dist/index37.js +90 -0
- package/dist/index370.cjs +1 -0
- package/dist/index370.js +278 -0
- package/dist/index371.cjs +1 -0
- package/dist/index371.js +173 -0
- package/dist/index372.cjs +1 -0
- package/dist/index372.js +12 -0
- package/dist/index373.cjs +1 -0
- package/dist/index373.js +110 -0
- package/dist/index374.cjs +1 -0
- package/dist/index374.js +12 -0
- package/dist/index375.cjs +1 -0
- package/dist/index375.js +136 -0
- package/dist/index376.cjs +1 -0
- package/dist/index376.js +81 -0
- package/dist/index377.cjs +1 -0
- package/dist/index377.js +4 -0
- package/dist/index378.cjs +1 -0
- package/dist/index378.js +45 -0
- package/dist/index379.cjs +1 -0
- package/dist/index379.js +660 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +153 -0
- package/dist/index380.cjs +1 -0
- package/dist/index380.js +180 -0
- package/dist/index381.cjs +1 -0
- package/dist/index381.js +4 -0
- package/dist/index382.cjs +1 -0
- package/dist/index382.js +24 -0
- package/dist/index383.cjs +1 -0
- package/dist/index383.js +112 -0
- package/dist/index384.cjs +1 -0
- package/dist/index384.js +5 -0
- package/dist/index385.cjs +1 -0
- package/dist/index385.js +65 -0
- package/dist/index386.cjs +1 -0
- package/dist/index386.js +134 -0
- package/dist/index387.cjs +1 -0
- package/dist/index387.js +262 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +90 -0
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +33 -23
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +16 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +31 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +20 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +110 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +14 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +61 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +524 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +32 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +28 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +28 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +51 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +30 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +30 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +33 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +32 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +58 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +56 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +38 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +39 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +32 -0
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +273 -91
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +30 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +30 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +17 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +16 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +20 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +12 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +35 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +17 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +15 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +39 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +237 -47
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +44 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +45 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +27 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +57 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +30 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +22 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +730 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +524 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +15 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +14 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +42 -46
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +21 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +48 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +45 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +174 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +23 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +33 -0
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +29 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +7 -0
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +9 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +19 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +69 -93
- package/dist/index90.cjs +1 -0
- package/dist/index90.js +15 -0
- package/dist/index91.cjs +1 -0
- package/dist/index91.js +12 -0
- package/dist/index92.cjs +1 -0
- package/dist/index92.js +159 -0
- package/dist/index93.cjs +1 -0
- package/dist/index93.js +7 -0
- package/dist/index94.cjs +3 -0
- package/dist/index94.js +218 -0
- package/dist/index95.cjs +1 -0
- package/dist/index95.js +21 -0
- package/dist/index96.cjs +1 -0
- package/dist/index96.js +13 -0
- package/dist/index97.cjs +1 -0
- package/dist/index97.js +24 -0
- package/dist/index98.cjs +1 -0
- package/dist/index98.js +12 -0
- package/dist/index99.cjs +1 -0
- package/dist/index99.js +12 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/lib/GardenSwapWidget.d.ts +5 -0
- package/dist/src/lib/common/BottomSheet.d.ts +7 -0
- package/dist/src/lib/common/CopyToClipboard.d.ts +7 -0
- package/dist/src/lib/common/GardenBranding.d.ts +3 -0
- package/dist/src/lib/common/Header.d.ts +3 -0
- package/dist/src/lib/common/Modal.d.ts +0 -2
- package/dist/src/lib/common/Sidebar.d.ts +9 -0
- package/dist/src/lib/common/SwapWidgetBase.d.ts +7 -0
- package/dist/src/lib/components/CreateSwap.d.ts +1 -2
- package/dist/src/lib/components/SwapSavingsAndAddresses.d.ts +1 -1
- package/dist/src/lib/components/SwapWidget.d.ts +4 -2
- package/dist/src/lib/components/swapInProgress/SwapInProgress.d.ts +3 -0
- package/dist/src/lib/components/swapInProgress/SwapInProgressSkeleton.d.ts +3 -0
- package/dist/src/lib/components/transactions/TransactionHistory.d.ts +2 -2
- package/dist/src/lib/components/transactions/Transactions.d.ts +1 -2
- package/dist/src/lib/constants/constants.d.ts +25 -0
- package/dist/src/lib/constants/wagmiConfig.d.ts +1548 -0
- package/dist/src/lib/hooks/useAddresses.d.ts +8 -0
- package/dist/src/lib/hooks/useSwap.d.ts +1 -0
- package/dist/src/lib/store/assetStore.d.ts +11 -0
- package/dist/src/lib/store/heightStore.d.ts +10 -0
- package/dist/src/lib/store/orderInProgressStore.d.ts +10 -0
- package/dist/src/lib/store/swapStore.d.ts +22 -4
- package/dist/src/lib/store/transactionHistoryStore.d.ts +2 -2
- package/dist/src/lib/store/widgetConfigStore.d.ts +8 -0
- package/dist/src/lib/types/types.d.ts +19 -2
- package/dist/src/lib/utils/balance/getBalanceMulticall.d.ts +5 -0
- package/dist/src/lib/utils/balance/getNativeTokenFee.d.ts +7 -0
- package/dist/src/lib/utils/balance/getNetworkFees.d.ts +5 -0
- package/dist/src/lib/utils/balance/getTokenBalance.d.ts +8 -0
- package/dist/src/lib/utils/balance/getmaxBtc.d.ts +3 -0
- package/dist/src/lib/utils/balance/rpcUtils.d.ts +17 -0
- package/dist/src/lib/utils/utils.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +17 -8
- package/dist/index5.cjs +0 -1
- package/dist/index5.js +0 -250
- package/dist/src/lib/GardenComponent.d.ts +0 -6
- package/dist/src/lib/common/Navbar.d.ts +0 -10
package/dist/index359.js
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
2
|
+
const w = /* @__PURE__ */ BigInt(0), p = /* @__PURE__ */ BigInt(1);
|
|
3
|
+
function b(t) {
|
|
4
|
+
return t instanceof Uint8Array || ArrayBuffer.isView(t) && t.constructor.name === "Uint8Array";
|
|
5
|
+
}
|
|
6
|
+
function h(t) {
|
|
7
|
+
if (!b(t))
|
|
8
|
+
throw new Error("Uint8Array expected");
|
|
9
|
+
}
|
|
10
|
+
function k(t, n) {
|
|
11
|
+
if (typeof n != "boolean")
|
|
12
|
+
throw new Error(t + " boolean expected, got " + n);
|
|
13
|
+
}
|
|
14
|
+
function F(t) {
|
|
15
|
+
const n = t.toString(16);
|
|
16
|
+
return n.length & 1 ? "0" + n : n;
|
|
17
|
+
}
|
|
18
|
+
function E(t) {
|
|
19
|
+
if (typeof t != "string")
|
|
20
|
+
throw new Error("hex string expected, got " + typeof t);
|
|
21
|
+
return t === "" ? w : BigInt("0x" + t);
|
|
22
|
+
}
|
|
23
|
+
const U = (
|
|
24
|
+
// @ts-ignore
|
|
25
|
+
typeof Uint8Array.from([]).toHex == "function" && typeof Uint8Array.fromHex == "function"
|
|
26
|
+
), S = /* @__PURE__ */ Array.from({ length: 256 }, (t, n) => n.toString(16).padStart(2, "0"));
|
|
27
|
+
function x(t) {
|
|
28
|
+
if (h(t), U)
|
|
29
|
+
return t.toHex();
|
|
30
|
+
let n = "";
|
|
31
|
+
for (let e = 0; e < t.length; e++)
|
|
32
|
+
n += S[t[e]];
|
|
33
|
+
return n;
|
|
34
|
+
}
|
|
35
|
+
const u = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
36
|
+
function m(t) {
|
|
37
|
+
if (t >= u._0 && t <= u._9)
|
|
38
|
+
return t - u._0;
|
|
39
|
+
if (t >= u.A && t <= u.F)
|
|
40
|
+
return t - (u.A - 10);
|
|
41
|
+
if (t >= u.a && t <= u.f)
|
|
42
|
+
return t - (u.a - 10);
|
|
43
|
+
}
|
|
44
|
+
function B(t) {
|
|
45
|
+
if (typeof t != "string")
|
|
46
|
+
throw new Error("hex string expected, got " + typeof t);
|
|
47
|
+
if (U)
|
|
48
|
+
return Uint8Array.fromHex(t);
|
|
49
|
+
const n = t.length, e = n / 2;
|
|
50
|
+
if (n % 2)
|
|
51
|
+
throw new Error("hex string expected, got unpadded hex of length " + n);
|
|
52
|
+
const r = new Uint8Array(e);
|
|
53
|
+
for (let o = 0, i = 0; o < e; o++, i += 2) {
|
|
54
|
+
const a = m(t.charCodeAt(i)), f = m(t.charCodeAt(i + 1));
|
|
55
|
+
if (a === void 0 || f === void 0) {
|
|
56
|
+
const c = t[i] + t[i + 1];
|
|
57
|
+
throw new Error('hex string expected, got non-hex character "' + c + '" at index ' + i);
|
|
58
|
+
}
|
|
59
|
+
r[o] = a * 16 + f;
|
|
60
|
+
}
|
|
61
|
+
return r;
|
|
62
|
+
}
|
|
63
|
+
function O(t) {
|
|
64
|
+
return E(x(t));
|
|
65
|
+
}
|
|
66
|
+
function V(t) {
|
|
67
|
+
return h(t), E(x(Uint8Array.from(t).reverse()));
|
|
68
|
+
}
|
|
69
|
+
function T(t, n) {
|
|
70
|
+
return B(t.toString(16).padStart(n * 2, "0"));
|
|
71
|
+
}
|
|
72
|
+
function C(t, n) {
|
|
73
|
+
return T(t, n).reverse();
|
|
74
|
+
}
|
|
75
|
+
function M(t, n, e) {
|
|
76
|
+
let r;
|
|
77
|
+
if (typeof n == "string")
|
|
78
|
+
try {
|
|
79
|
+
r = B(n);
|
|
80
|
+
} catch (i) {
|
|
81
|
+
throw new Error(t + " must be hex string or Uint8Array, cause: " + i);
|
|
82
|
+
}
|
|
83
|
+
else if (b(n))
|
|
84
|
+
r = Uint8Array.from(n);
|
|
85
|
+
else
|
|
86
|
+
throw new Error(t + " must be hex string or Uint8Array");
|
|
87
|
+
const o = r.length;
|
|
88
|
+
if (typeof e == "number" && o !== e)
|
|
89
|
+
throw new Error(t + " of length " + e + " expected, got " + o);
|
|
90
|
+
return r;
|
|
91
|
+
}
|
|
92
|
+
function H(...t) {
|
|
93
|
+
let n = 0;
|
|
94
|
+
for (let r = 0; r < t.length; r++) {
|
|
95
|
+
const o = t[r];
|
|
96
|
+
h(o), n += o.length;
|
|
97
|
+
}
|
|
98
|
+
const e = new Uint8Array(n);
|
|
99
|
+
for (let r = 0, o = 0; r < t.length; r++) {
|
|
100
|
+
const i = t[r];
|
|
101
|
+
e.set(i, o), o += i.length;
|
|
102
|
+
}
|
|
103
|
+
return e;
|
|
104
|
+
}
|
|
105
|
+
const y = (t) => typeof t == "bigint" && w <= t;
|
|
106
|
+
function I(t, n, e) {
|
|
107
|
+
return y(t) && y(n) && y(e) && n <= t && t < e;
|
|
108
|
+
}
|
|
109
|
+
function R(t, n, e, r) {
|
|
110
|
+
if (!I(n, e, r))
|
|
111
|
+
throw new Error("expected valid " + t + ": " + e + " <= n < " + r + ", got " + n);
|
|
112
|
+
}
|
|
113
|
+
function j(t) {
|
|
114
|
+
let n;
|
|
115
|
+
for (n = 0; t > w; t >>= p, n += 1)
|
|
116
|
+
;
|
|
117
|
+
return n;
|
|
118
|
+
}
|
|
119
|
+
const z = (t) => (p << BigInt(t)) - p, d = (t) => new Uint8Array(t), A = (t) => Uint8Array.from(t);
|
|
120
|
+
function D(t, n, e) {
|
|
121
|
+
if (typeof t != "number" || t < 2)
|
|
122
|
+
throw new Error("hashLen must be a number");
|
|
123
|
+
if (typeof n != "number" || n < 2)
|
|
124
|
+
throw new Error("qByteLen must be a number");
|
|
125
|
+
if (typeof e != "function")
|
|
126
|
+
throw new Error("hmacFn must be a function");
|
|
127
|
+
let r = d(t), o = d(t), i = 0;
|
|
128
|
+
const a = () => {
|
|
129
|
+
r.fill(1), o.fill(0), i = 0;
|
|
130
|
+
}, f = (...s) => e(o, r, ...s), c = (s = d(0)) => {
|
|
131
|
+
o = f(A([0]), s), r = f(), s.length !== 0 && (o = f(A([1]), s), r = f());
|
|
132
|
+
}, v = () => {
|
|
133
|
+
if (i++ >= 1e3)
|
|
134
|
+
throw new Error("drbg: tried 1000 values");
|
|
135
|
+
let s = 0;
|
|
136
|
+
const l = [];
|
|
137
|
+
for (; s < n; ) {
|
|
138
|
+
r = f();
|
|
139
|
+
const g = r.slice();
|
|
140
|
+
l.push(g), s += r.length;
|
|
141
|
+
}
|
|
142
|
+
return H(...l);
|
|
143
|
+
};
|
|
144
|
+
return (s, l) => {
|
|
145
|
+
a(), c(s);
|
|
146
|
+
let g;
|
|
147
|
+
for (; !(g = l(v())); )
|
|
148
|
+
c();
|
|
149
|
+
return a(), g;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
const _ = {
|
|
153
|
+
bigint: (t) => typeof t == "bigint",
|
|
154
|
+
function: (t) => typeof t == "function",
|
|
155
|
+
boolean: (t) => typeof t == "boolean",
|
|
156
|
+
string: (t) => typeof t == "string",
|
|
157
|
+
stringOrUint8Array: (t) => typeof t == "string" || b(t),
|
|
158
|
+
isSafeInteger: (t) => Number.isSafeInteger(t),
|
|
159
|
+
array: (t) => Array.isArray(t),
|
|
160
|
+
field: (t, n) => n.Fp.isValid(t),
|
|
161
|
+
hash: (t) => typeof t == "function" && Number.isSafeInteger(t.outputLen)
|
|
162
|
+
};
|
|
163
|
+
function P(t, n, e = {}) {
|
|
164
|
+
const r = (o, i, a) => {
|
|
165
|
+
const f = _[i];
|
|
166
|
+
if (typeof f != "function")
|
|
167
|
+
throw new Error("invalid validator function");
|
|
168
|
+
const c = t[o];
|
|
169
|
+
if (!(a && c === void 0) && !f(c, t))
|
|
170
|
+
throw new Error("param " + String(o) + " is invalid. Expected " + i + ", got " + c);
|
|
171
|
+
};
|
|
172
|
+
for (const [o, i] of Object.entries(n))
|
|
173
|
+
r(o, i, !1);
|
|
174
|
+
for (const [o, i] of Object.entries(e))
|
|
175
|
+
r(o, i, !0);
|
|
176
|
+
return t;
|
|
177
|
+
}
|
|
178
|
+
function W(t) {
|
|
179
|
+
const n = /* @__PURE__ */ new WeakMap();
|
|
180
|
+
return (e, ...r) => {
|
|
181
|
+
const o = n.get(e);
|
|
182
|
+
if (o !== void 0)
|
|
183
|
+
return o;
|
|
184
|
+
const i = t(e, ...r);
|
|
185
|
+
return n.set(e, i), i;
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
export {
|
|
189
|
+
R as aInRange,
|
|
190
|
+
k as abool,
|
|
191
|
+
h as abytes,
|
|
192
|
+
j as bitLen,
|
|
193
|
+
z as bitMask,
|
|
194
|
+
x as bytesToHex,
|
|
195
|
+
O as bytesToNumberBE,
|
|
196
|
+
V as bytesToNumberLE,
|
|
197
|
+
H as concatBytes,
|
|
198
|
+
D as createHmacDrbg,
|
|
199
|
+
M as ensureBytes,
|
|
200
|
+
B as hexToBytes,
|
|
201
|
+
E as hexToNumber,
|
|
202
|
+
I as inRange,
|
|
203
|
+
b as isBytes,
|
|
204
|
+
W as memoized,
|
|
205
|
+
T as numberToBytesBE,
|
|
206
|
+
C as numberToBytesLE,
|
|
207
|
+
F as numberToHexUnpadded,
|
|
208
|
+
P as validateObject
|
|
209
|
+
};
|
package/dist/index36.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),o=require("@gardenfi/garden-book"),f=require("./index7.cjs"),m=({sendAsset:n,receiveAsset:i,sendAmount:s,receiveAmount:g,equalSplit:r=!1})=>{const{chains:l}=f.assetInfoStore(),t=l.find(a=>a.chain===n.chain),c=l.find(a=>a.chain===i.chain);return e.createElement("div",{className:"flex items-center justify-between"},e.createElement("div",{className:`flex items-center justify-start gap-2 ${r?"w-fit":"w-full"}`},e.createElement(o.Typography,{size:"h3",weight:"regular"},s),e.createElement(o.TokenNetworkLogos,{tokenLogo:n.icon,chainLogo:(t==null?void 0:t.iconUrl)===n.icon?"":(t==null?void 0:t.iconUrl)??""})),e.createElement(o.ArrowRightIcon,{className:r?"":"h-5 w-9"}),e.createElement("div",{className:`flex items-center justify-end gap-2 ${r?"w-fit":"w-full"}`},e.createElement(o.Typography,{size:"h3",weight:"regular"},g),e.createElement(o.TokenNetworkLogos,{tokenLogo:i.icon,chainLogo:(c==null?void 0:c.iconUrl)??""})))};exports.SwapInfo=m;
|
package/dist/index36.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
import { Typography as l, TokenNetworkLogos as m, ArrowRightIcon as g } from "@gardenfi/garden-book";
|
|
3
|
+
import { assetInfoStore as w } from "./index7.js";
|
|
4
|
+
const u = ({
|
|
5
|
+
sendAsset: o,
|
|
6
|
+
receiveAsset: a,
|
|
7
|
+
sendAmount: f,
|
|
8
|
+
receiveAmount: s,
|
|
9
|
+
equalSplit: c = !1
|
|
10
|
+
}) => {
|
|
11
|
+
const { chains: i } = w(), t = i.find((n) => n.chain === o.chain), r = i.find(
|
|
12
|
+
(n) => n.chain === a.chain
|
|
13
|
+
);
|
|
14
|
+
return /* @__PURE__ */ e.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ e.createElement(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: `flex items-center justify-start gap-2 ${c ? "w-fit" : "w-full"}`
|
|
18
|
+
},
|
|
19
|
+
/* @__PURE__ */ e.createElement(l, { size: "h3", weight: "regular" }, f),
|
|
20
|
+
/* @__PURE__ */ e.createElement(
|
|
21
|
+
m,
|
|
22
|
+
{
|
|
23
|
+
tokenLogo: o.icon,
|
|
24
|
+
chainLogo: (t == null ? void 0 : t.iconUrl) === o.icon ? "" : (t == null ? void 0 : t.iconUrl) ?? ""
|
|
25
|
+
}
|
|
26
|
+
)
|
|
27
|
+
), /* @__PURE__ */ e.createElement(g, { className: c ? "" : "h-5 w-9" }), /* @__PURE__ */ e.createElement(
|
|
28
|
+
"div",
|
|
29
|
+
{
|
|
30
|
+
className: `flex items-center justify-end gap-2 ${c ? "w-fit" : "w-full"}`
|
|
31
|
+
},
|
|
32
|
+
/* @__PURE__ */ e.createElement(l, { size: "h3", weight: "regular" }, s),
|
|
33
|
+
/* @__PURE__ */ e.createElement(
|
|
34
|
+
m,
|
|
35
|
+
{
|
|
36
|
+
tokenLogo: a.icon,
|
|
37
|
+
chainLogo: (r == null ? void 0 : r.iconUrl) ?? ""
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
));
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
u as SwapInfo
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function r(a,y,i){let e="";if(i)for(const t of Object.entries(i)){if(!t)continue;let s="";for(const n of t[1])s+=`[${n.type}${n.name?`:${n.name}`:""}]`;e+=`(${t[0]}{${s}})`}return y?`${y}:${a}${e}`:`${a}${e}`}const d=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]);exports.getParameterCacheKey=r;exports.parameterCache=d;
|
package/dist/index360.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
function d(y, i, a) {
|
|
2
|
+
let e = "";
|
|
3
|
+
if (a)
|
|
4
|
+
for (const t of Object.entries(a)) {
|
|
5
|
+
if (!t)
|
|
6
|
+
continue;
|
|
7
|
+
let s = "";
|
|
8
|
+
for (const n of t[1])
|
|
9
|
+
s += `[${n.type}${n.name ? `:${n.name}` : ""}]`;
|
|
10
|
+
e += `(${t[0]}{${s}})`;
|
|
11
|
+
}
|
|
12
|
+
return i ? `${i}:${y}${e}` : `${y}${e}`;
|
|
13
|
+
}
|
|
14
|
+
const p = /* @__PURE__ */ new Map([
|
|
15
|
+
// Unnamed
|
|
16
|
+
["address", { type: "address" }],
|
|
17
|
+
["bool", { type: "bool" }],
|
|
18
|
+
["bytes", { type: "bytes" }],
|
|
19
|
+
["bytes32", { type: "bytes32" }],
|
|
20
|
+
["int", { type: "int256" }],
|
|
21
|
+
["int256", { type: "int256" }],
|
|
22
|
+
["string", { type: "string" }],
|
|
23
|
+
["uint", { type: "uint256" }],
|
|
24
|
+
["uint8", { type: "uint8" }],
|
|
25
|
+
["uint16", { type: "uint16" }],
|
|
26
|
+
["uint24", { type: "uint24" }],
|
|
27
|
+
["uint32", { type: "uint32" }],
|
|
28
|
+
["uint64", { type: "uint64" }],
|
|
29
|
+
["uint96", { type: "uint96" }],
|
|
30
|
+
["uint112", { type: "uint112" }],
|
|
31
|
+
["uint160", { type: "uint160" }],
|
|
32
|
+
["uint192", { type: "uint192" }],
|
|
33
|
+
["uint256", { type: "uint256" }],
|
|
34
|
+
// Named
|
|
35
|
+
["address owner", { type: "address", name: "owner" }],
|
|
36
|
+
["address to", { type: "address", name: "to" }],
|
|
37
|
+
["bool approved", { type: "bool", name: "approved" }],
|
|
38
|
+
["bytes _data", { type: "bytes", name: "_data" }],
|
|
39
|
+
["bytes data", { type: "bytes", name: "data" }],
|
|
40
|
+
["bytes signature", { type: "bytes", name: "signature" }],
|
|
41
|
+
["bytes32 hash", { type: "bytes32", name: "hash" }],
|
|
42
|
+
["bytes32 r", { type: "bytes32", name: "r" }],
|
|
43
|
+
["bytes32 root", { type: "bytes32", name: "root" }],
|
|
44
|
+
["bytes32 s", { type: "bytes32", name: "s" }],
|
|
45
|
+
["string name", { type: "string", name: "name" }],
|
|
46
|
+
["string symbol", { type: "string", name: "symbol" }],
|
|
47
|
+
["string tokenURI", { type: "string", name: "tokenURI" }],
|
|
48
|
+
["uint tokenId", { type: "uint256", name: "tokenId" }],
|
|
49
|
+
["uint8 v", { type: "uint8", name: "v" }],
|
|
50
|
+
["uint256 balance", { type: "uint256", name: "balance" }],
|
|
51
|
+
["uint256 tokenId", { type: "uint256", name: "tokenId" }],
|
|
52
|
+
["uint256 value", { type: "uint256", name: "value" }],
|
|
53
|
+
// Indexed
|
|
54
|
+
[
|
|
55
|
+
"event:address indexed from",
|
|
56
|
+
{ type: "address", name: "from", indexed: !0 }
|
|
57
|
+
],
|
|
58
|
+
["event:address indexed to", { type: "address", name: "to", indexed: !0 }],
|
|
59
|
+
[
|
|
60
|
+
"event:uint indexed tokenId",
|
|
61
|
+
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
62
|
+
],
|
|
63
|
+
[
|
|
64
|
+
"event:uint256 indexed tokenId",
|
|
65
|
+
{ type: "uint256", name: "tokenId", indexed: !0 }
|
|
66
|
+
]
|
|
67
|
+
]);
|
|
68
|
+
export {
|
|
69
|
+
d as getParameterCacheKey,
|
|
70
|
+
p as parameterCache
|
|
71
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index362.cjs");class n{constructor(t){this.bytePosition=0,this.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength)}shift(t){return this.bytePosition+=t,this}read8(){const t=this.dataView.getUint8(this.bytePosition);return this.shift(1),t}read16(){const t=this.dataView.getUint16(this.bytePosition,!0);return this.shift(2),t}read32(){const t=this.dataView.getUint32(this.bytePosition,!0);return this.shift(4),t}read64(){const t=this.read32(),e=this.read32().toString(16)+t.toString(16).padStart(8,"0");return BigInt("0x"+e).toString(10)}read128(){const t=BigInt(this.read64()),e=BigInt(this.read64()).toString(16)+t.toString(16).padStart(16,"0");return BigInt("0x"+e).toString(10)}read256(){const t=BigInt(this.read128()),e=BigInt(this.read128()).toString(16)+t.toString(16).padStart(32,"0");return BigInt("0x"+e).toString(10)}readBytes(t){const i=this.bytePosition+this.dataView.byteOffset,e=new Uint8Array(this.dataView.buffer,i,t);return this.shift(t),e}readULEB(){const t=this.bytePosition+this.dataView.byteOffset,i=new Uint8Array(this.dataView.buffer,t),{value:e,length:s}=r.ulebDecode(i);return this.shift(s),e}readVec(t){const i=this.readULEB(),e=[];for(let s=0;s<i;s++)e.push(t(this,s,i));return e}}exports.BcsReader=n;
|
package/dist/index361.js
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { ulebDecode as r } from "./index362.js";
|
|
2
|
+
class o {
|
|
3
|
+
/**
|
|
4
|
+
* @param {Uint8Array} data Data to use as a buffer.
|
|
5
|
+
*/
|
|
6
|
+
constructor(t) {
|
|
7
|
+
this.bytePosition = 0, this.dataView = new DataView(t.buffer, t.byteOffset, t.byteLength);
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Shift current cursor position by `bytes`.
|
|
11
|
+
*
|
|
12
|
+
* @param {Number} bytes Number of bytes to
|
|
13
|
+
* @returns {this} Self for possible chaining.
|
|
14
|
+
*/
|
|
15
|
+
shift(t) {
|
|
16
|
+
return this.bytePosition += t, this;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read U8 value from the buffer and shift cursor by 1.
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
read8() {
|
|
23
|
+
const t = this.dataView.getUint8(this.bytePosition);
|
|
24
|
+
return this.shift(1), t;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Read U16 value from the buffer and shift cursor by 2.
|
|
28
|
+
* @returns
|
|
29
|
+
*/
|
|
30
|
+
read16() {
|
|
31
|
+
const t = this.dataView.getUint16(this.bytePosition, !0);
|
|
32
|
+
return this.shift(2), t;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Read U32 value from the buffer and shift cursor by 4.
|
|
36
|
+
* @returns
|
|
37
|
+
*/
|
|
38
|
+
read32() {
|
|
39
|
+
const t = this.dataView.getUint32(this.bytePosition, !0);
|
|
40
|
+
return this.shift(4), t;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read U64 value from the buffer and shift cursor by 8.
|
|
44
|
+
* @returns
|
|
45
|
+
*/
|
|
46
|
+
read64() {
|
|
47
|
+
const t = this.read32(), e = this.read32().toString(16) + t.toString(16).padStart(8, "0");
|
|
48
|
+
return BigInt("0x" + e).toString(10);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Read U128 value from the buffer and shift cursor by 16.
|
|
52
|
+
*/
|
|
53
|
+
read128() {
|
|
54
|
+
const t = BigInt(this.read64()), e = BigInt(this.read64()).toString(16) + t.toString(16).padStart(16, "0");
|
|
55
|
+
return BigInt("0x" + e).toString(10);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Read U128 value from the buffer and shift cursor by 32.
|
|
59
|
+
* @returns
|
|
60
|
+
*/
|
|
61
|
+
read256() {
|
|
62
|
+
const t = BigInt(this.read128()), e = BigInt(this.read128()).toString(16) + t.toString(16).padStart(32, "0");
|
|
63
|
+
return BigInt("0x" + e).toString(10);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Read `num` number of bytes from the buffer and shift cursor by `num`.
|
|
67
|
+
* @param num Number of bytes to read.
|
|
68
|
+
*/
|
|
69
|
+
readBytes(t) {
|
|
70
|
+
const i = this.bytePosition + this.dataView.byteOffset, e = new Uint8Array(this.dataView.buffer, i, t);
|
|
71
|
+
return this.shift(t), e;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Read ULEB value - an integer of varying size. Used for enum indexes and
|
|
75
|
+
* vector lengths.
|
|
76
|
+
* @returns {Number} The ULEB value.
|
|
77
|
+
*/
|
|
78
|
+
readULEB() {
|
|
79
|
+
const t = this.bytePosition + this.dataView.byteOffset, i = new Uint8Array(this.dataView.buffer, t), { value: e, length: s } = r(i);
|
|
80
|
+
return this.shift(s), e;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Read a BCS vector: read a length and then apply function `cb` X times
|
|
84
|
+
* where X is the length of the vector, defined as ULEB in BCS bytes.
|
|
85
|
+
* @param cb Callback to process elements of vector.
|
|
86
|
+
* @returns {Array<Any>} Array of the resulting values, returned by callback.
|
|
87
|
+
*/
|
|
88
|
+
readVec(t) {
|
|
89
|
+
const i = this.readULEB(), e = [];
|
|
90
|
+
for (let s = 0; s < i; s++)
|
|
91
|
+
e.push(t(this, s, i));
|
|
92
|
+
return e;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
o as BcsReader
|
|
97
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function l(n){let e=BigInt(n);const t=[];let r=0;if(e===0n)return[0];for(;e>0;)t[r]=Number(e&0x7fn),e>>=7n,e>0n&&(t[r]|=128),r+=1;return t}function u(n){let e=0n,t=0n,r=0;for(;;){if(r>=n.length)throw new Error("ULEB decode error: buffer overflow");const o=n[r];if(r+=1,e+=BigInt(o&127)<<t,!(o&128))break;t+=7n}if(e>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("ULEB decode error: value exceeds MAX_SAFE_INTEGER");return{value:Number(e),length:r}}exports.ulebDecode=u;exports.ulebEncode=l;
|
package/dist/index362.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
function l(t) {
|
|
2
|
+
let e = BigInt(t);
|
|
3
|
+
const n = [];
|
|
4
|
+
let r = 0;
|
|
5
|
+
if (e === 0n)
|
|
6
|
+
return [0];
|
|
7
|
+
for (; e > 0; )
|
|
8
|
+
n[r] = Number(e & 0x7fn), e >>= 7n, e > 0n && (n[r] |= 128), r += 1;
|
|
9
|
+
return n;
|
|
10
|
+
}
|
|
11
|
+
function u(t) {
|
|
12
|
+
let e = 0n, n = 0n, r = 0;
|
|
13
|
+
for (; ; ) {
|
|
14
|
+
if (r >= t.length)
|
|
15
|
+
throw new Error("ULEB decode error: buffer overflow");
|
|
16
|
+
const o = t[r];
|
|
17
|
+
if (r += 1, e += BigInt(o & 127) << n, !(o & 128))
|
|
18
|
+
break;
|
|
19
|
+
n += 7n;
|
|
20
|
+
}
|
|
21
|
+
if (e > BigInt(Number.MAX_SAFE_INTEGER))
|
|
22
|
+
throw new Error("ULEB decode error: value exceeds MAX_SAFE_INTEGER");
|
|
23
|
+
return {
|
|
24
|
+
value: Number(e),
|
|
25
|
+
length: r
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
u as ulebDecode,
|
|
30
|
+
l as ulebEncode
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./index362.cjs"),o=require("./index317.cjs");class a{constructor({initialSize:t=1024,maxSize:i=1/0,allocateSize:e=1024}={}){this.bytePosition=0,this.size=t,this.maxSize=i,this.allocateSize=e,this.dataView=new DataView(new ArrayBuffer(t))}ensureSizeOrGrow(t){const i=this.bytePosition+t;if(i>this.size){const e=Math.min(this.maxSize,Math.max(this.size+i,this.size+this.allocateSize));if(i>e)throw new Error(`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${i}`);this.size=e;const s=new ArrayBuffer(this.size);new Uint8Array(s).set(new Uint8Array(this.dataView.buffer)),this.dataView=new DataView(s)}}shift(t){return this.bytePosition+=t,this}write8(t){return this.ensureSizeOrGrow(1),this.dataView.setUint8(this.bytePosition,Number(t)),this.shift(1)}writeBytes(t){this.ensureSizeOrGrow(t.length);for(let i=0;i<t.length;i++)this.dataView.setUint8(this.bytePosition+i,t[i]);return this.shift(t.length)}write16(t){return this.ensureSizeOrGrow(2),this.dataView.setUint16(this.bytePosition,Number(t),!0),this.shift(2)}write32(t){return this.ensureSizeOrGrow(4),this.dataView.setUint32(this.bytePosition,Number(t),!0),this.shift(4)}write64(t){return n(BigInt(t),8).forEach(i=>this.write8(i)),this}write128(t){return n(BigInt(t),16).forEach(i=>this.write8(i)),this}write256(t){return n(BigInt(t),32).forEach(i=>this.write8(i)),this}writeULEB(t){return h.ulebEncode(t).forEach(i=>this.write8(i)),this}writeVec(t,i){return this.writeULEB(t.length),Array.from(t).forEach((e,s)=>i(this,e,s,t.length)),this}*[Symbol.iterator](){for(let t=0;t<this.bytePosition;t++)yield this.dataView.getUint8(t);return this.toBytes()}toBytes(){return new Uint8Array(this.dataView.buffer.slice(0,this.bytePosition))}toString(t){return o.encodeStr(this.toBytes(),t)}}function n(r,t){const i=new Uint8Array(t);let e=0;for(;r>0;)i[e]=Number(r%BigInt(256)),r=r/BigInt(256),e+=1;return i}exports.BcsWriter=a;
|
package/dist/index363.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { ulebEncode as n } from "./index362.js";
|
|
2
|
+
import { encodeStr as o } from "./index317.js";
|
|
3
|
+
class u {
|
|
4
|
+
constructor({
|
|
5
|
+
initialSize: t = 1024,
|
|
6
|
+
maxSize: i = 1 / 0,
|
|
7
|
+
allocateSize: e = 1024
|
|
8
|
+
} = {}) {
|
|
9
|
+
this.bytePosition = 0, this.size = t, this.maxSize = i, this.allocateSize = e, this.dataView = new DataView(new ArrayBuffer(t));
|
|
10
|
+
}
|
|
11
|
+
ensureSizeOrGrow(t) {
|
|
12
|
+
const i = this.bytePosition + t;
|
|
13
|
+
if (i > this.size) {
|
|
14
|
+
const e = Math.min(
|
|
15
|
+
this.maxSize,
|
|
16
|
+
Math.max(this.size + i, this.size + this.allocateSize)
|
|
17
|
+
);
|
|
18
|
+
if (i > e)
|
|
19
|
+
throw new Error(
|
|
20
|
+
`Attempting to serialize to BCS, but buffer does not have enough size. Allocated size: ${this.size}, Max size: ${this.maxSize}, Required size: ${i}`
|
|
21
|
+
);
|
|
22
|
+
this.size = e;
|
|
23
|
+
const s = new ArrayBuffer(this.size);
|
|
24
|
+
new Uint8Array(s).set(new Uint8Array(this.dataView.buffer)), this.dataView = new DataView(s);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Shift current cursor position by `bytes`.
|
|
29
|
+
*
|
|
30
|
+
* @param {Number} bytes Number of bytes to
|
|
31
|
+
* @returns {this} Self for possible chaining.
|
|
32
|
+
*/
|
|
33
|
+
shift(t) {
|
|
34
|
+
return this.bytePosition += t, this;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Write a U8 value into a buffer and shift cursor position by 1.
|
|
38
|
+
* @param {Number} value Value to write.
|
|
39
|
+
* @returns {this}
|
|
40
|
+
*/
|
|
41
|
+
write8(t) {
|
|
42
|
+
return this.ensureSizeOrGrow(1), this.dataView.setUint8(this.bytePosition, Number(t)), this.shift(1);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Write a U8 value into a buffer and shift cursor position by 1.
|
|
46
|
+
* @param {Number} value Value to write.
|
|
47
|
+
* @returns {this}
|
|
48
|
+
*/
|
|
49
|
+
writeBytes(t) {
|
|
50
|
+
this.ensureSizeOrGrow(t.length);
|
|
51
|
+
for (let i = 0; i < t.length; i++)
|
|
52
|
+
this.dataView.setUint8(this.bytePosition + i, t[i]);
|
|
53
|
+
return this.shift(t.length);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Write a U16 value into a buffer and shift cursor position by 2.
|
|
57
|
+
* @param {Number} value Value to write.
|
|
58
|
+
* @returns {this}
|
|
59
|
+
*/
|
|
60
|
+
write16(t) {
|
|
61
|
+
return this.ensureSizeOrGrow(2), this.dataView.setUint16(this.bytePosition, Number(t), !0), this.shift(2);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Write a U32 value into a buffer and shift cursor position by 4.
|
|
65
|
+
* @param {Number} value Value to write.
|
|
66
|
+
* @returns {this}
|
|
67
|
+
*/
|
|
68
|
+
write32(t) {
|
|
69
|
+
return this.ensureSizeOrGrow(4), this.dataView.setUint32(this.bytePosition, Number(t), !0), this.shift(4);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Write a U64 value into a buffer and shift cursor position by 8.
|
|
73
|
+
* @param {bigint} value Value to write.
|
|
74
|
+
* @returns {this}
|
|
75
|
+
*/
|
|
76
|
+
write64(t) {
|
|
77
|
+
return h(BigInt(t), 8).forEach((i) => this.write8(i)), this;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Write a U128 value into a buffer and shift cursor position by 16.
|
|
81
|
+
*
|
|
82
|
+
* @param {bigint} value Value to write.
|
|
83
|
+
* @returns {this}
|
|
84
|
+
*/
|
|
85
|
+
write128(t) {
|
|
86
|
+
return h(BigInt(t), 16).forEach((i) => this.write8(i)), this;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Write a U256 value into a buffer and shift cursor position by 16.
|
|
90
|
+
*
|
|
91
|
+
* @param {bigint} value Value to write.
|
|
92
|
+
* @returns {this}
|
|
93
|
+
*/
|
|
94
|
+
write256(t) {
|
|
95
|
+
return h(BigInt(t), 32).forEach((i) => this.write8(i)), this;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Write a ULEB value into a buffer and shift cursor position by number of bytes
|
|
99
|
+
* written.
|
|
100
|
+
* @param {Number} value Value to write.
|
|
101
|
+
* @returns {this}
|
|
102
|
+
*/
|
|
103
|
+
writeULEB(t) {
|
|
104
|
+
return n(t).forEach((i) => this.write8(i)), this;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Write a vector into a buffer by first writing the vector length and then calling
|
|
108
|
+
* a callback on each passed value.
|
|
109
|
+
*
|
|
110
|
+
* @param {Array<Any>} vector Array of elements to write.
|
|
111
|
+
* @param {WriteVecCb} cb Callback to call on each element of the vector.
|
|
112
|
+
* @returns {this}
|
|
113
|
+
*/
|
|
114
|
+
writeVec(t, i) {
|
|
115
|
+
return this.writeULEB(t.length), Array.from(t).forEach((e, s) => i(this, e, s, t.length)), this;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Adds support for iterations over the object.
|
|
119
|
+
* @returns {Uint8Array}
|
|
120
|
+
*/
|
|
121
|
+
// oxlint-disable-next-line require-yields
|
|
122
|
+
*[Symbol.iterator]() {
|
|
123
|
+
for (let t = 0; t < this.bytePosition; t++)
|
|
124
|
+
yield this.dataView.getUint8(t);
|
|
125
|
+
return this.toBytes();
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get underlying buffer taking only value bytes (in case initial buffer size was bigger).
|
|
129
|
+
* @returns {Uint8Array} Resulting bcs.
|
|
130
|
+
*/
|
|
131
|
+
toBytes() {
|
|
132
|
+
return new Uint8Array(this.dataView.buffer.slice(0, this.bytePosition));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Represent data as 'hex' or 'base64'
|
|
136
|
+
* @param encoding Encoding to use: 'base64' or 'hex'
|
|
137
|
+
*/
|
|
138
|
+
toString(t) {
|
|
139
|
+
return o(this.toBytes(), t);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function h(r, t) {
|
|
143
|
+
const i = new Uint8Array(t);
|
|
144
|
+
let e = 0;
|
|
145
|
+
for (; r > 0; )
|
|
146
|
+
i[e] = Number(r % BigInt(256)), r = r / BigInt(256), e += 1;
|
|
147
|
+
return i;
|
|
148
|
+
}
|
|
149
|
+
export {
|
|
150
|
+
u as BcsWriter
|
|
151
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./index304.cjs"),m=require("./index362.cjs");function y(e,r,a){return new d.BcsType({read:t=>{const n=new Array(e);for(let u=0;u<e;u++)n[u]=r.read(t);return n},write:(t,n)=>{for(const u of t)r.write(u,n)},...a,name:(a==null?void 0:a.name)??`${r.name}[${e}]`,validate:t=>{var n;if((n=a==null?void 0:a.validate)==null||n.call(a,t),!t||typeof t!="object"||!("length"in t))throw new TypeError(`Expected array, found ${typeof t}`);if(t.length!==e)throw new TypeError(`Expected array of length ${e}, found ${t.length}`)}})}function w(e){return c.enum(`Option<${e.name}>`,{None:null,Some:e}).transform({input:r=>r==null?{None:!0}:{Some:r},output:r=>r.$kind==="Some"?r.Some:null})}function f(e,r){return new d.BcsType({read:a=>{const t=a.readULEB(),n=new Array(t);for(let u=0;u<t;u++)n[u]=e.read(a);return n},write:(a,t)=>{t.writeULEB(a.length);for(const n of a)e.write(n,t)},...r,name:(r==null?void 0:r.name)??`vector<${e.name}>`,validate:a=>{var t;if((t=r==null?void 0:r.validate)==null||t.call(r,a),!a||typeof a!="object"||!("length"in a))throw new TypeError(`Expected array, found ${typeof a}`)}})}function l(e,r){return c.vector(c.tuple([e,r])).transform({name:`Map<${e.name}, ${r.name}>`,input:a=>[...a.entries()],output:a=>{const t=new Map;for(const[n,u]of a)t.set(n,u);return t}})}const c={u8(e){return d.uIntBcsType({readMethod:"read8",writeMethod:"write8",size:1,maxValue:2**8-1,...e,name:(e==null?void 0:e.name)??"u8"})},u16(e){return d.uIntBcsType({readMethod:"read16",writeMethod:"write16",size:2,maxValue:2**16-1,...e,name:(e==null?void 0:e.name)??"u16"})},u32(e){return d.uIntBcsType({readMethod:"read32",writeMethod:"write32",size:4,maxValue:2**32-1,...e,name:(e==null?void 0:e.name)??"u32"})},u64(e){return d.bigUIntBcsType({readMethod:"read64",writeMethod:"write64",size:8,maxValue:2n**64n-1n,...e,name:(e==null?void 0:e.name)??"u64"})},u128(e){return d.bigUIntBcsType({readMethod:"read128",writeMethod:"write128",size:16,maxValue:2n**128n-1n,...e,name:(e==null?void 0:e.name)??"u128"})},u256(e){return d.bigUIntBcsType({readMethod:"read256",writeMethod:"write256",size:32,maxValue:2n**256n-1n,...e,name:(e==null?void 0:e.name)??"u256"})},bool(e){return d.fixedSizeBcsType({size:1,read:r=>r.read8()===1,write:(r,a)=>a.write8(r?1:0),...e,name:(e==null?void 0:e.name)??"bool",validate:r=>{var a;if((a=e==null?void 0:e.validate)==null||a.call(e,r),typeof r!="boolean")throw new TypeError(`Expected boolean, found ${typeof r}`)}})},uleb128(e){return d.dynamicSizeBcsType({read:r=>r.readULEB(),serialize:r=>Uint8Array.from(m.ulebEncode(r)),...e,name:(e==null?void 0:e.name)??"uleb128"})},bytes(e,r){return d.fixedSizeBcsType({size:e,read:a=>a.readBytes(e),write:(a,t)=>{t.writeBytes(new Uint8Array(a))},...r,name:(r==null?void 0:r.name)??`bytes[${e}]`,validate:a=>{var t;if((t=r==null?void 0:r.validate)==null||t.call(r,a),!a||typeof a!="object"||!("length"in a))throw new TypeError(`Expected array, found ${typeof a}`);if(a.length!==e)throw new TypeError(`Expected array of length ${e}, found ${a.length}`)}})},byteVector(e){return new d.BcsType({read:r=>{const a=r.readULEB();return r.readBytes(a)},write:(r,a)=>{const t=new Uint8Array(r);a.writeULEB(t.length),a.writeBytes(t)},...e,name:(e==null?void 0:e.name)??"vector<u8>",serializedSize:r=>{const a="length"in r?r.length:null;return a==null?null:m.ulebEncode(a).length+a},validate:r=>{var a;if((a=e==null?void 0:e.validate)==null||a.call(e,r),!r||typeof r!="object"||!("length"in r))throw new TypeError(`Expected array, found ${typeof r}`)}})},string(e){return d.stringLikeBcsType({toBytes:r=>new TextEncoder().encode(r),fromBytes:r=>new TextDecoder().decode(r),...e,name:(e==null?void 0:e.name)??"string"})},fixedArray:y,option:w,vector:f,tuple(e,r){return new d.BcsTuple({fields:e,...r})},struct(e,r,a){return new d.BcsStruct({name:e,fields:r,...a})},enum(e,r,a){return new d.BcsEnum({name:e,fields:r,...a})},map:l,lazy(e){return d.lazyBcsType(e)}};exports.bcs=c;
|