Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
upgrade mangolana (#2074)
Browse files Browse the repository at this point in the history
  • Loading branch information
abrzezinski94 authored Jan 22, 2024
1 parent 22c43df commit bbbfcab
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 55 deletions.
4 changes: 2 additions & 2 deletions components/TreasuryAccount/MangoModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const MangoModal = ({ account }: { account: AssetAccount }) => {
)

const depositIx = await mangoClient!.program.methods
.tokenDeposit(new BN(100000000000), false)
.tokenDeposit(new BN(1000000000000), false)
.accounts({
group: mangoGroup!.publicKey,
account: mangoAccount,
Expand All @@ -107,7 +107,7 @@ const MangoModal = ({ account }: { account: AssetAccount }) => {
const delegateIx = await mangoClient!.program.methods
.accountEdit(
null,
new PublicKey('EsWMqyaEDoAqMgiWG9McSmpetBiYjL4VkHPkfevxKu4D'),
new PublicKey('CwkzPDCBMzYZuvNa88sgToYyyqtEdKTJneWTsg7n3mTE'),
null,
null
)
Expand Down
32 changes: 28 additions & 4 deletions components/instructions/programs/mangoV4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { tryParseKey } from '@tools/validators/pubkey'
import Loading from '@components/Loading'
import { getClient, getGroupForClient } from '@utils/mangoV4Tools'
import { tryGetMint } from '@utils/tokens'
import { formatNumber } from '@utils/formatNumber'
// import { snakeCase } from 'snake-case'
// import { sha256 } from 'js-sha256'

Expand Down Expand Up @@ -1598,12 +1599,35 @@ const instructions = () => ({
],
getDataUI: async (
connection: Connection,
data: Uint8Array
//accounts: AccountMetaData[]
data: Uint8Array,
accounts: AccountMetaData[]
) => {
const info = await displayArgs(connection, data)
const args = await getDataObjectFlattened<any>(connection, data)
const accountInfo = await connection.getParsedAccountInfo(
accounts[6].pubkey
)
const mint = await tryGetMint(
connection,
new PublicKey(accountInfo.value?.data['parsed'].info.mint)
)
const tokenInfo = tokenPriceService.getTokenInfo(
accountInfo.value?.data['parsed'].info.mint
)
try {
return <div>{info}</div>
return (
<div>
<div>
amount:{' '}
{mint?.account.decimals
? formatNumber(
toUiDecimals(args.amount, mint?.account.decimals)
)
: args.amount}{' '}
{tokenInfo?.symbol}
</div>
<div>reduce only: {args.reduceOnly.toString()}</div>
</div>
)
} catch (e) {
console.log(e)
return <div>{JSON.stringify(data)}</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@blockworks-foundation/mango-mints-redemption": "0.0.10",
"@blockworks-foundation/mango-v4": "0.21.22",
"@blockworks-foundation/mango-v4-settings": "0.4.10",
"@blockworks-foundation/mangolana": "0.0.1-beta.16",
"@blockworks-foundation/mangolana": "0.0.14",
"@bonfida/spl-name-service": "0.1.47",
"@bundlr-network/client": "0.7.15",
"@carbon/icons-react": "11.7.0",
Expand Down
59 changes: 11 additions & 48 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -382,15 +382,6 @@
lodash "^4.17.21"
node-kraken-api "^2.2.2"

"@blockworks-foundation/[email protected]":
version "0.0.1-beta.16"
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mangolana/-/mangolana-0.0.1-beta.16.tgz#37e27ca076a4961f0e23f9664c0d7fbd667c7e22"
integrity sha512-zdCaVfno129OmPuABzkcPjNhXNc6PLk56u6DH3bjBebG31CY2udMXfP3zlV2TN9l9Y54zM7oJS3WItbzRPKMfQ==
dependencies:
"@solana/web3.js" "^1.63.1"
bs58 "^5.0.0"
node-fetch "^3.2.10"

"@blockworks-foundation/[email protected]":
version "0.0.13"
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mangolana/-/mangolana-0.0.13.tgz#82a9b0846e69068de6216d20fcdcd60375d14e1e"
Expand All @@ -402,6 +393,17 @@
node-fetch "2.6.11"
ws "^8.16.0"

"@blockworks-foundation/[email protected]":
version "0.0.14"
resolved "https://registry.yarnpkg.com/@blockworks-foundation/mangolana/-/mangolana-0.0.14.tgz#f2a0e164f2cbe6e0a0db4fc10267e81ef5d2f7ec"
integrity sha512-KuA2+GdeKoHCBmx2HZnVb8IPomUP1w0ZiwQ1F10SLIypYfrylvPa+HSK2ak/+nzZCb8erS9Oub45UPV7cOh5ng==
dependencies:
"@solana/web3.js" "^1.88.0"
bs58 "^5.0.0"
isomorphic-ws "^5.0.0"
node-fetch "2.6.11"
ws "^8.16.0"

"@blocto/sdk@^0.2.22":
version "0.2.22"
resolved "https://registry.yarnpkg.com/@blocto/sdk/-/sdk-0.2.22.tgz#c7fe62809de0640a0a3f7a043c5bbceb8be17e38"
Expand Down Expand Up @@ -8210,11 +8212,6 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

data-uri-to-buffer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz#d8feb2b2881e6a4f58c2e08acfd0e2834e26222e"
integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==

data-urls@^3.0.2:
version "3.0.2"
resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-3.0.2.tgz#9cf24a477ae22bcef5cd5f6f0bfbc1d2d3be9143"
Expand Down Expand Up @@ -9346,14 +9343,6 @@ fbjs@^2.0.0:
setimmediate "^1.0.5"
ua-parser-js "^0.7.18"

fetch-blob@^3.1.2, fetch-blob@^3.1.4:
version "3.2.0"
resolved "https://registry.yarnpkg.com/fetch-blob/-/fetch-blob-3.2.0.tgz#f09b8d4bbd45adc6f0c20b7e787e793e309dcce9"
integrity sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==
dependencies:
node-domexception "^1.0.0"
web-streams-polyfill "^3.0.3"

fetch-retry@^5.0.6:
version "5.0.6"
resolved "https://registry.yarnpkg.com/fetch-retry/-/fetch-retry-5.0.6.tgz#17d0bc90423405b7a88b74355bf364acd2a7fa56"
Expand Down Expand Up @@ -9522,13 +9511,6 @@ form-data@~2.3.2:
combined-stream "^1.0.6"
mime-types "^2.1.12"

formdata-polyfill@^4.0.10:
version "4.0.10"
resolved "https://registry.yarnpkg.com/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz#24807c31c9d402e002ab3d8c720144ceb8848423"
integrity sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==
dependencies:
fetch-blob "^3.1.2"

[email protected]:
version "2.12.2"
resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.12.2.tgz#a191db2dbbb04f48a0e75050b94f57cc876c7b40"
Expand Down Expand Up @@ -12283,11 +12265,6 @@ node-addon-api@^2.0.0:
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
integrity sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==

node-domexception@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/node-domexception/-/node-domexception-1.0.0.tgz#6888db46a1f71c0b76b3f7555016b63fe64766e5"
integrity sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==

node-emoji@^1.11.0:
version "1.11.0"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c"
Expand Down Expand Up @@ -12316,15 +12293,6 @@ node-fetch@^2.6.1, node-fetch@^2.6.12, node-fetch@^2.6.7:
dependencies:
whatwg-url "^5.0.0"

node-fetch@^3.2.10:
version "3.3.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-3.3.1.tgz#b3eea7b54b3a48020e46f4f88b9c5a7430d20b2e"
integrity sha512-cRVc/kyto/7E5shrWca1Wsea4y6tL9iYJE5FBCius3JQfb/4P4I295PfhgbJQBLTx6lATE4z+wK0rPM4VS2uow==
dependencies:
data-uri-to-buffer "^4.0.0"
fetch-blob "^3.1.4"
formdata-polyfill "^4.0.10"

node-gyp-build@^4.2.0, node-gyp-build@^4.3.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.6.0.tgz#0c52e4cbf54bbd28b709820ef7b6a3c2d6209055"
Expand Down Expand Up @@ -15681,11 +15649,6 @@ wcwidth@^1.0.1:
dependencies:
defaults "^1.0.3"

web-streams-polyfill@^3.0.3:
version "3.2.1"
resolved "https://registry.yarnpkg.com/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz#71c2718c52b45fd49dbeee88634b3a60ceab42a6"
integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q==

web3-utils@^1.3.4:
version "1.10.0"
resolved "https://registry.yarnpkg.com/web3-utils/-/web3-utils-1.10.0.tgz#ca4c1b431a765c14ac7f773e92e0fd9377ccf578"
Expand Down

1 comment on commit bbbfcab

@vercel
Copy link

@vercel vercel bot commented on bbbfcab Jan 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

governance-ui – ./

app.realms.today
governance-ui-solana-labs.vercel.app
governance-ui-git-main-solana-labs.vercel.app

Please sign in to comment.