Skip to content

Commit e138ec7

Browse files
philiphacksPhilip
andauthored
chore: upgrade @stacks/connect (#609)
* chore: upgrade @stacks/connect * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip --------- Co-authored-by: Philip <philip@Philips-MacBook-Pro.local>
1 parent 3c992f4 commit e138ec7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+4679
-5193
lines changed

analytics-web/components/home.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Vaults } from './vaults';
88
import { Tvl } from './tvl';
99
import { MarketCap } from './market-cap';
1010
import { TokenPriceSelect } from './token-price-select';
11-
import { callReadOnlyFunction, stringAsciiCV, cvToJSON } from '@stacks/transactions';
11+
import { fetchCallReadOnlyFunction, Cl, cvToJSON } from '@stacks/transactions';
1212
import { stacksNetwork as network } from '@common/utils';
1313
import { DefiLlama } from './defillama';
1414
import { BuyBackBurn } from './buyback-burn';
@@ -27,11 +27,11 @@ const getPrice = async (symbol: string) => {
2727
}
2828

2929
const contractAddress = 'SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR';
30-
const fetchedPrice = await callReadOnlyFunction({
30+
const fetchedPrice = await fetchCallReadOnlyFunction({
3131
contractAddress,
3232
contractName: 'arkadiko-oracle-v2-3',
3333
functionName: 'get-price',
34-
functionArgs: [stringAsciiCV(symbol || 'stx')],
34+
functionArgs: [Cl.stringAscii(symbol || 'stx')],
3535
senderAddress: contractAddress,
3636
network: network,
3737
});

analytics-web/components/market-cap.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, { useEffect, useState } from 'react';
2-
import { callReadOnlyFunction, cvToJSON } from '@stacks/transactions';
2+
import { fetchCallReadOnlyFunction, cvToJSON } from '@stacks/transactions';
33
import { stacksNetwork as network } from '@common/utils';
44
import { Placeholder } from '../../web/components/ui/placeholder';
55
import { tokenList } from '../../web/components/token-swap-list';
@@ -16,7 +16,7 @@ export const MarketCap: React.FC = ({ lastDikoPrice, lastUsdaPrice }) => {
1616
useEffect(() => {
1717
const fetchData = async () => {
1818
const contractAddress = 'SP2C2YFP12AJZB4MABJBAJ55XECVS7E4PMMZ89YZR';
19-
const supplyCall = await callReadOnlyFunction({
19+
const supplyCall = await fetchCallReadOnlyFunction({
2020
contractAddress,
2121
contractName: "arkadiko-token",
2222
functionName: "get-total-supply",
@@ -41,7 +41,7 @@ export const MarketCap: React.FC = ({ lastDikoPrice, lastUsdaPrice }) => {
4141
setDikoFloat(float);
4242
setDikoMarketCap(lastDikoPrice * float);
4343

44-
const usdaSupplyCall = await callReadOnlyFunction({
44+
const usdaSupplyCall = await fetchCallReadOnlyFunction({
4545
contractAddress,
4646
contractName: "usda-token",
4747
functionName: "get-total-supply",

analytics-web/components/prices.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { getPriceInfo, getDikoAmmPrice } from '../../web/common/get-price';
55
import { Placeholder } from '../../web/components/ui/placeholder';
66
import { Tooltip } from '@blockstack/ui';
77
import { StyledIcon } from '../../web/components/ui/styled-icon';
8-
import { callReadOnlyFunction, contractPrincipalCV, cvToJSON } from '@stacks/transactions';
8+
import { fetchCallReadOnlyFunction, Cl, cvToJSON } from '@stacks/transactions';
99

1010
export const Prices: React.FC = () => {
1111
const [stxPrice, setStxPrice] = useState(0.0);
@@ -26,13 +26,13 @@ export const Prices: React.FC = () => {
2626
const getStxUsdaAmmPrice = async () => {
2727
const contractAddress = process.env.REACT_APP_CONTRACT_ADDRESS || '';
2828
const fetchPair = async () => {
29-
const details = await callReadOnlyFunction({
29+
const details = await fetchCallReadOnlyFunction({
3030
contractAddress,
3131
contractName: 'arkadiko-swap-v2-1',
3232
functionName: 'get-pair-details',
3333
functionArgs: [
34-
contractPrincipalCV(contractAddress, 'wrapped-stx-token'),
35-
contractPrincipalCV(contractAddress, 'usda-token'),
34+
Cl.contractPrincipal(contractAddress, 'wrapped-stx-token'),
35+
Cl.contractPrincipal(contractAddress, 'usda-token'),
3636
],
3737
senderAddress: contractAddress,
3838
network: network,

clarity/integration/constants.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)