Skip to content

Commit

Permalink
fix(types): use the newer Ao types from @ar.io/sdk
Browse files Browse the repository at this point in the history
The old types were deprecated in v2 but not removed. Moving to the newest Ao types that will be extended as network contract features are added.
  • Loading branch information
dtfiedler committed Aug 6, 2024
1 parent 6aae128 commit c935004
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"deploy": "yarn build && permaweb-deploy --ant-process ${DEPLOY_ANT_PROCESS_ID}"
},
"dependencies": {
"@ar.io/sdk": "2.1.0-alpha.6",
"@ar.io/sdk": "2.1.0-alpha.10",
"@fontsource/rubik": "^5.0.19",
"@headlessui/react": "^1.7.19",
"@radix-ui/react-tooltip": "^1.0.7",
Expand Down
4 changes: 2 additions & 2 deletions src/components/modals/StartGatewayModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,11 @@ const StartGatewayModal = ({ onClose }: { onClose: () => void }) => {
allowDelegatedStaking
? parseFloat(String(formState.minDelegatedStake))
: DEFAULT_DELEGATED_STAKING,
).toMIO(),
).toMIO().valueOf(),
autoStake: true,
operatorStake: new IOToken(
parseFloat(String(formState.stake)),
).toMIO(),
).toMIO().valueOf(),
};

// UNCOMMENT AND COMMENT OUT JOIN NETWORK FOR DEV WORK
Expand Down
6 changes: 3 additions & 3 deletions src/pages/Gateway/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IOToken, UpdateGatewaySettingsParams, mIOToken } from '@ar.io/sdk/web';
import { IOToken, AoUpdateGatewaySettingsParams, mIOToken } from '@ar.io/sdk/web';
import Button, { ButtonType } from '@src/components/Button';
import Placeholder from '@src/components/Placeholder';
import FormRow, { RowType } from '@src/components/forms/FormRow';
Expand Down Expand Up @@ -307,7 +307,7 @@ const Gateway = () => {
? parseFloat(changed.stake as string)
: undefined;

const updateGatewaySettingsParams: UpdateGatewaySettingsParams = {
const updateGatewaySettingsParams: AoUpdateGatewaySettingsParams = {
allowDelegatedStaking: changed.allowDelegatedStaking as boolean,
delegateRewardShareRatio:
formState.allowDelegatedStaking && changed.delegateRewardShareRatio
Expand All @@ -319,7 +319,7 @@ const Gateway = () => {
formState.allowDelegatedStaking && changed.minDelegatedStake
? new IOToken(
parseFloat(changed.minDelegatedStake as string),
).toMIO()
).toMIO().valueOf()
: undefined,
note: changed.note as string,
properties: changed.properties as string,
Expand Down
39 changes: 32 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
plimit-lit "^3.0.1"
warp-contracts "1.4.45"

"@ar.io/[email protected].6":
version "2.1.0-alpha.6"
resolved "https://registry.yarnpkg.com/@ar.io/sdk/-/sdk-2.1.0-alpha.6.tgz#e831d2153200c7503aaf72b294a5aebf6b0a3bcd"
integrity sha512-5Cso0T8ucIbw69zm0CNV9UDep0Q2rxPqjbTao0yi0XuAiTLD3M7J9u8+0O5Vf9n7ASjBeC6qTTm1LvQUIGQ0sA==
"@ar.io/[email protected].10":
version "2.1.0-alpha.10"
resolved "https://registry.yarnpkg.com/@ar.io/sdk/-/sdk-2.1.0-alpha.10.tgz#6458acf17264664efb11b11096f041c009e6b7b3"
integrity sha512-Z8sKTOoYgp0nAgLH46gwsz3RvtaG0vG1kZNVRMgyyfA7rPX78C/3P72IiSbkrTy9cnAq29QYvZbgFSeeZdqjVQ==
dependencies:
"@permaweb/aoconnect" "^0.0.57"
arbundles "0.11.0"
Expand Down Expand Up @@ -10021,7 +10021,16 @@ string-length@^4.0.1:
char-regex "^1.0.2"
strip-ansi "^6.0.0"

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -10108,7 +10117,14 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand Down Expand Up @@ -10999,7 +11015,7 @@ word-wrap@^1.2.5:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -11017,6 +11033,15 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit c935004

Please sign in to comment.