Skip to content

Commit

Permalink
refactor: bump @arbitrum/sdk to 4.0.2-beta.1
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Oct 30, 2024
1 parent 771d78a commit f51d908
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"viem": "^1.20.0"
},
"dependencies": {
"@arbitrum/sdk": "^4.0.2-beta.0",
"@arbitrum/sdk": "^4.0.2-beta.1",
"@arbitrum/token-bridge-contracts": "^1.2.2",
"@offchainlabs/fund-distribution-contracts": "^1.0.1",
"@safe-global/protocol-kit": "^4.0.2",
Expand Down
16 changes: 11 additions & 5 deletions src/utils/decimals.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { BigNumber } from 'ethers';
import {
scaleToNativeTokenDecimals as ethers_scaleToNativeTokenDecimals,
nativeTokenDecimalsTo18Decimals as ethers_nativeTokenDecimalsTo18Decimals,
} from '@arbitrum/sdk/dist/lib/utils/lib';
scaleFrom18DecimalsToNativeTokenDecimals as ethers_scaleFrom18DecimalsToNativeTokenDecimals,
scaleFromNativeTokenDecimalsTo18Decimals as ethers_scaleFromNativeTokenDecimalsTo18Decimals,
} from '@arbitrum/sdk';

/**
* Scales a value from 18 decimals to the number of decimals of the native token.
Expand All @@ -20,7 +20,10 @@ export function scaleFrom18DecimalsToNativeTokenDecimals({
decimals: number;
}): bigint {
const amountBigNumber = BigNumber.from(amount);
const result = ethers_scaleToNativeTokenDecimals({ amount: amountBigNumber, decimals });
const result = ethers_scaleFrom18DecimalsToNativeTokenDecimals({
amount: amountBigNumber,
decimals,
});
return BigInt(result.toString());
}

Expand All @@ -40,6 +43,9 @@ export function scaleFromNativeTokenDecimalsTo18Decimals({
decimals: number;
}): bigint {
const amountBigNumber = BigNumber.from(amount);
const result = ethers_nativeTokenDecimalsTo18Decimals({ amount: amountBigNumber, decimals });
const result = ethers_scaleFromNativeTokenDecimalsTo18Decimals({
amount: amountBigNumber,
decimals,
});
return BigInt(result.toString());
}
38 changes: 28 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"@openzeppelin/contracts-upgradeable" "4.5.2"
patch-package "^6.4.7"

"@arbitrum/sdk@^4.0.2-beta.0":
version "4.0.2-beta.0"
resolved "https://registry.yarnpkg.com/@arbitrum/sdk/-/sdk-4.0.2-beta.0.tgz#864e38797d9f25e0b0d6a5f0147d60bd5b5db3b6"
integrity sha512-Q22DqEYzlkspvx6h9LUgTFgpUr9PNtPiyp4hTaODOdNl+cbpVAz6G9x04iMAnNia9sP0KffhDD5WxS4CzFrFFw==
"@arbitrum/sdk@^4.0.2-beta.1":
version "4.0.2-beta.1"
resolved "https://registry.yarnpkg.com/@arbitrum/sdk/-/sdk-4.0.2-beta.1.tgz#c6c6c5784a8eaa6a4edab3600f765e9f82ce5988"
integrity sha512-a5DG6+Ld3X4L8H3CTUl3gc27Bj/Pqjo+5UZiCI97SM2mHtHKWF1BgQ+FCk/8bgFUP5nS9dXBl5tPJRtCFfOe0A==
dependencies:
"@ethersproject/address" "^5.0.8"
"@ethersproject/bignumber" "^5.1.1"
Expand Down Expand Up @@ -1596,7 +1596,20 @@ duplexer@^0.1.1, duplexer@~0.1.1:
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
integrity sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==

[email protected], [email protected], elliptic@^6.5.4:
[email protected]:
version "6.5.4"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb"
integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==
dependencies:
bn.js "^4.11.9"
brorand "^1.1.0"
hash.js "^1.0.0"
hmac-drbg "^1.0.1"
inherits "^2.0.4"
minimalistic-assert "^1.0.1"
minimalistic-crypto-utils "^1.0.1"

elliptic@^6.5.4:
version "6.5.7"
resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.7.tgz#8ec4da2cb2939926a1b9a73619d768207e647c8b"
integrity sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==
Expand Down Expand Up @@ -3703,12 +3716,17 @@ wrappy@1:
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==

[email protected], [email protected]:
version "7.5.10"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9"
integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==
[email protected]:
version "7.4.6"
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==

[email protected]:
version "8.13.0"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.13.0.tgz#9a9fb92f93cf41512a0735c8f4dd09b8a1211cd0"
integrity sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==

ws@8.13.0, ws@8.17.1:
[email protected]:
version "8.17.1"
resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b"
integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==
Expand Down

0 comments on commit f51d908

Please sign in to comment.