From c9350040e1c9285e20e7164f84b8576977e6a07a Mon Sep 17 00:00:00 2001 From: dtfiedler Date: Tue, 6 Aug 2024 12:34:18 -0600 Subject: [PATCH] fix(types): use the newer Ao types from @ar.io/sdk 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. --- package.json | 2 +- src/components/modals/StartGatewayModal.tsx | 4 +-- src/pages/Gateway/index.tsx | 6 ++-- yarn.lock | 39 +++++++++++++++++---- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index ddf83d19..acb6866b 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/modals/StartGatewayModal.tsx b/src/components/modals/StartGatewayModal.tsx index e024a176..85fda646 100644 --- a/src/components/modals/StartGatewayModal.tsx +++ b/src/components/modals/StartGatewayModal.tsx @@ -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 diff --git a/src/pages/Gateway/index.tsx b/src/pages/Gateway/index.tsx index 9ac5ef1e..8f0560d7 100644 --- a/src/pages/Gateway/index.tsx +++ b/src/pages/Gateway/index.tsx @@ -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'; @@ -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 @@ -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, diff --git a/yarn.lock b/yarn.lock index 405adb57..6feffa0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -35,10 +35,10 @@ plimit-lit "^3.0.1" warp-contracts "1.4.45" -"@ar.io/sdk@2.1.0-alpha.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/sdk@2.1.0-alpha.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" @@ -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== @@ -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== @@ -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== @@ -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"