Skip to content

Commit

Permalink
chore: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
billyjacoby committed Oct 29, 2024
1 parent 07e1aff commit 8dc1f82
Show file tree
Hide file tree
Showing 9 changed files with 429 additions and 18 deletions.
22 changes: 14 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.renderFinalNewline": "on",
"cSpell.words": [
"chronos"
]
}
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.renderFinalNewline": "on",
"cSpell.words": ["chronos"],
"[json][jsonc][javascript][javascriptreact][typescript][typescriptreact][vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.formatDocument",
"source.fixAll.eslint"
]
}
}
50 changes: 49 additions & 1 deletion packages/wallets/wallet-cosmos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,55 @@ yarn add @injectivelabs/wallet-cosmos

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { CosmosWalletStrategy } from '@injectivelabs/wallet-cosmos';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.Keplr,
strategies: {
[Wallet.Keplr]: new CosmosWalletStrategy({
chainId: ChainId.Mainnet
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand Down
50 changes: 49 additions & 1 deletion packages/wallets/wallet-cosmostation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,55 @@ yarn add @injectivelabs/wallet-cosmostation

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { CosmostationWalletStrategy } from '@injectivelabs/wallet-cosmostation';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.Cosmostation,
strategies: {
[Wallet.Cosmostation]: new CosmostationWalletStrategy({
chainId: ChainId.Mainnet,
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand Down
57 changes: 54 additions & 3 deletions packages/wallets/wallet-evm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,58 @@ yarn add @injectivelabs/wallet-evm

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { EvmWalletStrategy } from '@injectivelabs/wallet-evm';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.Metamask,
strategies: {
[Wallet.Metamask]: new EvmWalletStrategy({
chainId: ChainId.Mainnet,
ethereumOptions: {
ethereumChainId: EthereumChainId.Mainnet,
},
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand All @@ -45,14 +96,14 @@ Reach out to us at one of the following places!

## 🔓 License

Copyright © 2021 - 2022 Injective Labs Inc. (https://injectivelabs.org/)
Copyright © 2021 - 2022 Injective Labs Inc. (<https://injectivelabs.org/>)

<a href="https://iili.io/mNneZN.md.png"><img src="https://iili.io/mNneZN.md.png" style="width: 300px; max-width: 100%; height: auto" />

Originally released by Injective Labs Inc. under: <br />
Apache License <br />
Version 2.0, January 2004 <br />
http://www.apache.org/licenses/
<http://www.apache.org/licenses/>

<p>&nbsp;</p>
<div align="center">
Expand Down
53 changes: 52 additions & 1 deletion packages/wallets/wallet-ledger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,58 @@ yarn add @injectivelabs/wallet-ledger

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { LedgerLive } from '@injectivelabs/wallet-ledger';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.Ledger,
strategies: {
[Wallet.Ledger]: new LedgerLive({
chainId: ChainId.Mainnet,
ethereumOptions: {
ethereumChainId: EthereumChainId.Mainnet,
},
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand Down
53 changes: 52 additions & 1 deletion packages/wallets/wallet-magic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,58 @@ yarn add @injectivelabs/wallet-magic

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { MagicStrategy } from '@injectivelabs/wallet-magic';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.Magic,
strategies: {
[Wallet.Magic]: new MagicStrategy({
chainId: ChainId.Mainnet,
metadata: {
apiKey: 'YOUR_MAGIC_API_KEY'
}
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand Down
54 changes: 53 additions & 1 deletion packages/wallets/wallet-private-key/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,59 @@ yarn add @injectivelabs/wallet-evm

## 📖 Documentation

<!-- TODO -->
Injective's wallet packages are intended to make it easy for developers to choose exactly what wallets - and subsequent dependencies - they
want to include in their projects.

Regardless of which wallet package(s) you choose to use you must also have `@injectivelabs/wallet-core` and `@injectivelabs/wallet-base`
installed. These contain all of the types and core wallet functionality, with the separate wallet packages only providing the necessary
dependencies and implementations for their specific wallets.

Here's a brief example of how to use this package to send 1 INJ.:

```typescript
import { Wallet } from '@injectivelabs/wallet-base';
import { BaseWalletStrategy, MsgBroadcaster } from '@injectivelabs/wallet-core';
import { PrivateKeyWalletStrategy } from '@injectivelabs/wallet-private-key';


const strategyArgs: WalletStrategyArguments = {
chainId: ChainId.Mainnet,
wallet: Wallet.PrivateKey,
strategies: {
[Wallet.PrivateKey]: new PrivateKeyWalletStrategy({
chainId: ChainId.Mainnet,
privateKey: 'YOUR_PRIVATE_KEY'
ethereumOptions: {
ethereumChainId: EthereumChainId.Mainnet,
},
}),
},
}
const walletStrategy = new BaseWalletStrategy(strategyArgs)

const msgBroadcaster = new MsgBroadcaster({
walletStrategy,
simulateTx: true,
network: Network.Mainnet,
})

const sendTX = async () => {
const injectiveAddress = 'someInjectiveAddress'

const message = MsgSend.fromJSON({
srcInjectiveAddress: injectiveAddress,
dstInjectiveAddress: injectiveAddress,
amount: {
amount: '1',
denom: 'inj',
},
})

return await msgBroadcaster.broadcast({ msgs: message })
}

const result = await sendTX()
```

Read more and find example usages on our [WalletStrategy Docs](https://docs.ts.injective.network/wallet/wallet-wallet-strategy)

Expand Down
Loading

0 comments on commit 8dc1f82

Please sign in to comment.