Skip to content

Commit

Permalink
Fix: paths build issue (#38)
Browse files Browse the repository at this point in the history
* fix default account handler

* add tslib

* fix account handler types

* fix account data viewer

* fix asset

* fix channel accounts handler

* fix tx submitter

* Tx processor and horizon

* wrap up and test

* feat: upload wasm hash

* feat: deploy contract instance

* feat: wrap sac and SAC handler

* wrap up and testing

* fix-build

* fix: imports and add tsc-alias
  • Loading branch information
fazzatti authored Dec 14, 2023
1 parent 7a1626c commit d83e2eb
Show file tree
Hide file tree
Showing 44 changed files with 262 additions and 148 deletions.
106 changes: 104 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"private": false,
"scripts": {
"build": "tsc",
"build": "tsc && tsc-alias -p tsconfig.json",
"dev": "nodemon -e ts,js --exec ts-node -r tsconfig-paths/register ./src/index-test.ts",
"test": "echo \"No test specified yet\" && exit 0",
"lint": "eslint --ext .js,.ts .",
Expand Down Expand Up @@ -40,6 +40,7 @@
"nodemon": "^3.0.1",
"prettier": "^3.1.0",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.8",
"tsconfig-paths": "^4.2.0",
"tslib": "^2.6.2",
"typescript": "^5.3.2"
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * as StellarPlus from '@stellar-plus/index'
export * as StellarPlus from 'stellar-plus/index'

export default module.exports
6 changes: 3 additions & 3 deletions src/stellar-plus/account/account-handler/default/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FeeBumpTransaction, Keypair, Transaction } from '@stellar/stellar-sdk'

import { DefaultAccountHandler, DefaultAccountHandlerPayload } from '@account/account-handler/default/types'
import { AccountBaseClient } from '@account/base'
import { TransactionXdr } from '@stellar-plus/types'
import { DefaultAccountHandler, DefaultAccountHandlerPayload } from 'stellar-plus/account/account-handler/default/types'
import { AccountBaseClient } from 'stellar-plus/account/base'
import { TransactionXdr } from 'stellar-plus/types'

export class DefaultAccountHandlerClient extends AccountBaseClient implements DefaultAccountHandler {
public secretKey: string
Expand Down
5 changes: 3 additions & 2 deletions src/stellar-plus/account/account-handler/default/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { Transaction } from '@stellar/stellar-sdk'

import { AccountHandler, AccountHandlerPayload } from '@account/account-handler/types'
import { TransactionXdr } from '@stellar-plus/types'
import { AccountHandler, AccountHandlerPayload } from 'stellar-plus/account/account-handler/types'
import { TransactionXdr } from 'stellar-plus/types'


export type DefaultAccountHandler = AccountHandler & {
sign(tx: Transaction): TransactionXdr
Expand Down
6 changes: 3 additions & 3 deletions src/stellar-plus/account/account-handler/freighter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import {
FreighterAccHandlerPayload,
FreighterAccountHandler,
FreighterCallback,
} from '@account/account-handler/freighter/types'
import { AccountBaseClient } from '@account/base'
import { Network } from '@stellar-plus/types'
} from 'stellar-plus/account/account-handler/freighter/types'
import { AccountBaseClient } from 'stellar-plus/account/base'
import { Network } from 'stellar-plus/types'

export class FreighterAccountHandlerClient extends AccountBaseClient implements FreighterAccountHandler {
private network: Network
Expand Down
4 changes: 2 additions & 2 deletions src/stellar-plus/account/account-handler/freighter/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountHandler, AccountHandlerPayload } from '@account/account-handler/types'
import { Network } from '@stellar-plus/types'
import { AccountHandler, AccountHandlerPayload } from 'stellar-plus/account/account-handler/types'
import { Network } from 'stellar-plus/types'

export type FreighterAccountHandler = AccountHandler & {
connect(onPublicKeyReceived: FreighterCallback): Promise<void>
Expand Down
6 changes: 3 additions & 3 deletions src/stellar-plus/account/account-handler/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { FeeBumpTransaction, Transaction } from '@stellar/stellar-sdk'

import { AccountBase } from '@account/base/types'
import { AccountHelpersPayload } from '@account/helpers/types'
import { TransactionXdr } from '@stellar-plus/types'
import { AccountBase } from 'stellar-plus/account/base/types'
import { AccountHelpersPayload } from 'stellar-plus/account/helpers/types'
import { TransactionXdr } from 'stellar-plus/types'

export type AccountHandler = AccountBase & {
sign(tx: Transaction | FeeBumpTransaction): Promise<TransactionXdr> | TransactionXdr
Expand Down
4 changes: 2 additions & 2 deletions src/stellar-plus/account/base/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountBase, AccountBasePayload } from '@account/base/types'
import { AccountHelpers } from '@account/helpers'
import { AccountBase, AccountBasePayload } from 'stellar-plus/account/base/types'
import { AccountHelpers } from 'stellar-plus/account/helpers'

export class AccountBaseClient extends AccountHelpers implements AccountBase {
publicKey: string
Expand Down
2 changes: 1 addition & 1 deletion src/stellar-plus/account/base/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AccountHelpers, AccountHelpersPayload } from '@account/helpers/types'
import { AccountHelpers, AccountHelpersPayload } from 'stellar-plus/account/helpers/types'

export type AccountBase = AccountHelpers & {
publicKey?: string
Expand Down
10 changes: 5 additions & 5 deletions src/stellar-plus/account/helpers/account-data-viewer/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Horizon } from '@stellar/stellar-sdk'

import { AccountHelpers } from '@account/helpers'
import { AccountDataViewer } from '@account/helpers/account-data-viewer/types'
import { HorizonHandlerClient } from '@horizon/index'
import { HorizonHandler } from '@horizon/types'
import { Network } from '@stellar-plus/types'
import { AccountHelpers } from 'stellar-plus/account/helpers'
import { AccountDataViewer } from 'stellar-plus/account/helpers/account-data-viewer/types'
import { HorizonHandlerClient } from 'stellar-plus/horizon/index'
import { HorizonHandler } from 'stellar-plus/horizon/types'
import { Network } from 'stellar-plus/types'

export class AccountDataViewerClient implements AccountDataViewer {
private network: Network
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Horizon } from '@stellar/stellar-sdk'

import { Network } from '@stellar-plus/types'
import { Network } from 'stellar-plus/types'

//
// Allows for account data to be fetched from the network
Expand Down
6 changes: 3 additions & 3 deletions src/stellar-plus/account/helpers/friendbot/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import axios from 'axios'

import { AccountHelpers } from '@account/helpers'
import { Friendbot } from '@account/helpers/friendbot/types'
import { Network, NetworksList } from '@stellar-plus/types'
import { AccountHelpers } from 'stellar-plus/account/helpers'
import { Friendbot } from 'stellar-plus/account/helpers/friendbot/types'
import { Network, NetworksList } from 'stellar-plus/types'

export class FriendbotClient implements Friendbot {
private network: Network
Expand Down
2 changes: 1 addition & 1 deletion src/stellar-plus/account/helpers/friendbot/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Network } from '@stellar-plus/types'
import { Network } from 'stellar-plus/types'

//
// Allows for accounts to be initialized with Friendbot
Expand Down
10 changes: 5 additions & 5 deletions src/stellar-plus/account/helpers/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AccountDataViewerClient } from '@account/helpers/account-data-viewer'
import { AccountDataViewer } from '@account/helpers/account-data-viewer/types'
import { FriendbotClient } from '@account/helpers/friendbot'
import { Friendbot } from '@account/helpers/friendbot/types'
import { AccountHelpersPayload, AccountHelpers as AccountHelpersType } from '@account/helpers/types'
import { AccountDataViewerClient } from 'stellar-plus/account/helpers/account-data-viewer'
import { AccountDataViewer } from 'stellar-plus/account/helpers/account-data-viewer/types'
import { FriendbotClient } from 'stellar-plus/account/helpers/friendbot'
import { Friendbot } from 'stellar-plus/account/helpers/friendbot/types'
import { AccountHelpersPayload, AccountHelpers as AccountHelpersType } from 'stellar-plus/account/helpers/types'

export class AccountHelpers implements AccountHelpersType {
public accountDataViewer?: AccountDataViewer
Expand Down
4 changes: 2 additions & 2 deletions src/stellar-plus/account/helpers/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AccountDataViewer, AccountDataViewerConstructor } from '@account/helpers/account-data-viewer/types'
import { Friendbot } from '@account/helpers/friendbot/types'
import { AccountDataViewer, AccountDataViewerConstructor } from 'stellar-plus/account/helpers/account-data-viewer/types'
import { Friendbot } from 'stellar-plus/account/helpers/friendbot/types'

export type AccountHelpersPayload = AccountDataViewerConstructor
export type AccountHelpers = {
Expand Down
6 changes: 3 additions & 3 deletions src/stellar-plus/account/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DefaultAccountHandlerClient as DefaultAccountHandler } from '@account/account-handler/default'
import { FreighterAccountHandlerClient as FreighterAccountHandler } from '@account/account-handler/freighter'
import { AccountBaseClient as Base } from '@account/base'
import { DefaultAccountHandlerClient as DefaultAccountHandler } from 'stellar-plus/account/account-handler/default'
import { FreighterAccountHandlerClient as FreighterAccountHandler } from 'stellar-plus/account/account-handler/freighter'
import { AccountBaseClient as Base } from 'stellar-plus/account/base'

//
// Export Classes
Expand Down
15 changes: 9 additions & 6 deletions src/stellar-plus/asset/classic/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import { Horizon as HorizonNamespace, Operation, Asset as StellarAsset } from '@stellar/stellar-sdk'

import { AccountHandler } from '@account/account-handler/types'
import { ClassicAssetHandlerConstructorArgs, ClassicAssetHandler as IClassicAssetHandler } from '@asset/classic/types'
import { AssetTypes } from '@asset/types'
import { TransactionProcessor } from '@core/classic-transaction-processor'
import { TransactionInvocation } from '@core/types'
import { i128 } from '@stellar-plus/types'
import { AccountHandler } from 'stellar-plus/account/account-handler/types'
import {
ClassicAssetHandlerConstructorArgs,
ClassicAssetHandler as IClassicAssetHandler,
} from 'stellar-plus/asset/classic/types'
import { AssetTypes } from 'stellar-plus/asset/types'
import { TransactionProcessor } from 'stellar-plus/core/classic-transaction-processor'
import { TransactionInvocation } from 'stellar-plus/core/types'
import { i128 } from 'stellar-plus/types'

export class ClassicAssetHandler extends TransactionProcessor implements IClassicAssetHandler {
public code: string
Expand Down
9 changes: 5 additions & 4 deletions src/stellar-plus/asset/classic/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { AccountHandler } from '@account/account-handler/types'
import { AssetTypes, TokenInterface } from '@asset/types'
import { TransactionSubmitter } from '@core/transaction-submitter/classic/types'
import { Network } from '@stellar-plus/types'

import { AccountHandler } from 'stellar-plus/account/account-handler/types'
import { AssetTypes, TokenInterface } from 'stellar-plus/asset/types'
import { TransactionSubmitter } from 'stellar-plus/core/transaction-submitter/classic/types'
import { Network } from 'stellar-plus/types'

export type ClassicAsset = {
code: string
Expand Down
Loading

0 comments on commit d83e2eb

Please sign in to comment.