Skip to content

Commit

Permalink
fix: fix
Browse files Browse the repository at this point in the history
module resolution
  • Loading branch information
cgilbe27 committed Jan 4, 2024
1 parent 7891168 commit 89f4b6e
Show file tree
Hide file tree
Showing 57 changed files with 1,121 additions and 562 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-ts-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ jobs:

- name: "Run examples (packages/examples)"
run: |
yarn run tsx packages/examples/examples.test.ts
yarn run tsx examples/examples.test.ts
# tsx is a TS script executor similar to ts-node, except it runs more
# consistently and has a more lightweight implementation.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ import {
newRandomWallet,
Localnet,
Chain,
TEST_ADDRESS,
TEST_MNEMONIC,
} from "@nibiruchain/nibijs"
import { StdFee, coin } from "@cosmjs/amino"
import { DirectSecp256k1HdWallet } from "@cosmjs/proto-signing"
import { TEST_ADDRESS, TEST_MNEMONIC } from "@nibiruchain/nibijs/dist/testutil"
import esMain from "es-main"

// -----------------------------------------------
Expand All @@ -28,15 +29,15 @@ const CHAIN: Chain = Localnet
let _SIGNER: DirectSecp256k1HdWallet | null
let _SIGNING_CLIENT: NibiruTxClient | null

const getSigner = async (): Promise<DirectSecp256k1HdWallet> => {
export const getSigner = async (): Promise<DirectSecp256k1HdWallet> => {
if (!_SIGNER) {
// For the account that will sign the transaction
_SIGNER = await newSignerFromMnemonic(TEST_MNEMONIC)
}
return _SIGNER
}

const getSigningClient = async (): Promise<NibiruTxClient> => {
export const getSigningClient = async (): Promise<NibiruTxClient> => {
if (!_SIGNING_CLIENT) {
const signer = await getSigner()
_SIGNING_CLIENT = await NibiruTxClient.connectWithSigner(
Expand Down Expand Up @@ -166,7 +167,7 @@ const exampleTxMsgs = async () => {
}

/** Example: Send Funds */
const exampleSendFunds = async () => {
export const exampleSendFunds = async () => {
console.log(
hereDoc(`Running example: ${exampleSendFunds.name}...
This example broadcasts a transaction to send 5 unibi from the test account
Expand Down
1 change: 1 addition & 0 deletions examples/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const noop = () => {}
8 changes: 4 additions & 4 deletions packages/examples/package.json → examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
"module": "examples.test.ts",
"type": "module",
"version": "0.0.1",
"engines": {
"node": ">=18"
},
"dependencies": {
"@cosmjs/amino": "^0.32.1",
"@cosmjs/proto-signing": "^0.32.1",
"@nibiruchain/nibijs": "0.21.43"
},
"engines": {
"node": ">=18"
"@nibiruchain/nibijs": "0.21.45"
},
"devDependencies": {
"es-main": "^1.3.0",
Expand Down
Loading

0 comments on commit 89f4b6e

Please sign in to comment.