Skip to content

Commit 5ab1b70

Browse files
authored
Merge pull request paltalabs#82 from paltalabs/fix-dependencies-and-warning
Moving types definitions for removing circular dependencies
2 parents c896281 + 27808fe commit 5ab1b70

File tree

4 files changed

+22
-26
lines changed

4 files changed

+22
-26
lines changed

packages/contracts/src/useRegisteredContract.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { useSorobanReact } from '@soroban-react/core'
2-
import {type ContractDeploymentInfo, type WrappedContract, type WrappedContractInvokeArgs} from '@soroban-react/types'
2+
import {type ContractDeploymentInfo} from '@soroban-react/types'
33
import { contractInvoke,type InvokeArgs } from './contractInvoke'
4+
import {TxResponse} from '.'
45
import { useCallback, useEffect, useState } from 'react';
6+
import * as StellarSdk from '@stellar/stellar-sdk'
57

68
const getDeployment = (deployments: ContractDeploymentInfo[], contractId: string, networkPassphrase: string) => {
79
let deployment = deployments.find((deployment) => {
@@ -18,6 +20,24 @@ const getDeployment = (deployments: ContractDeploymentInfo[], contractId: string
1820
}
1921
}
2022

23+
export type WrappedContractInvokeArgs = {
24+
// NO NEED contractAddress: string
25+
method: string
26+
args?: StellarSdk.xdr.ScVal[] | undefined
27+
signAndSend?: boolean
28+
fee?: number
29+
skipAddingFootprint?: boolean
30+
secretKey?: string
31+
// NO NEED MAYBE sorobanContext: SorobanContextType
32+
// If useSorobanReact called inside of wrapped function
33+
reconnectAfterTx?: boolean
34+
}
35+
36+
export type WrappedContract = {
37+
deploymentInfo: ContractDeploymentInfo,
38+
invoke: (args: WrappedContractInvokeArgs) => Promise<TxResponse | StellarSdk.xdr.ScVal>
39+
}
40+
2141
export const useWrappedContract = (
2242
deploymentInfo: ContractDeploymentInfo
2343
) => {

packages/core/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"@soroban-react/freighter": "^9.0.2",
4343
"@soroban-react/types": "^9.0.2",
4444
"@soroban-react/xbull": "^1.0.1",
45-
"@soroban-react/contracts": "^9.0.2",
4645
"@stellar/stellar-sdk": "11.1.0"
4746
},
4847
"devDependencies": {

packages/types/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
"start": "tsc --watch"
1616
},
1717
"dependencies": {
18-
"@stellar/stellar-sdk": "11.1.0",
19-
"@soroban-react/contracts": "^9.0.2"
18+
"@stellar/stellar-sdk": "11.1.0"
2019
},
2120
"main": "dist/index.js",
2221
"exports": "./dist/index.js",

packages/types/src/index.tsx

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -62,26 +62,4 @@ export type ContractDeploymentInfo = {
6262
contractId: string,
6363
networkPassphrase: string,
6464
contractAddress: string
65-
}
66-
67-
import * as StellarSdk from '@stellar/stellar-sdk'
68-
69-
export type WrappedContractInvokeArgs = {
70-
// NO NEED contractAddress: string
71-
method: string
72-
args?: StellarSdk.xdr.ScVal[] | undefined
73-
signAndSend?: boolean
74-
fee?: number
75-
skipAddingFootprint?: boolean
76-
secretKey?: string
77-
// NO NEED MAYBE sorobanContext: SorobanContextType
78-
// If useSorobanReact called inside of wrapped function
79-
reconnectAfterTx?: boolean
80-
}
81-
82-
import {TxResponse} from '@soroban-react/contracts'
83-
84-
export type WrappedContract = {
85-
deploymentInfo: ContractDeploymentInfo,
86-
invoke: (args: WrappedContractInvokeArgs) => Promise<TxResponse | StellarSdk.xdr.ScVal>
8765
}

0 commit comments

Comments
 (0)