Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: make snaps build and run #100

Merged
merged 130 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
130 commits
Select commit Hold shift + click to select a range
5794330
chore: update metamask upstream packages to latest published
0xdef1cafe Aug 24, 2023
ba23d80
fix: remove m 44 prime 60 from derivation paths
0xdef1cafe Aug 24, 2023
6936e8d
fix: make svg valid
0xdef1cafe Aug 24, 2023
b1fefee
fix: make more svg valid
0xdef1cafe Aug 24, 2023
b5fcbc4
fix: remove unsupported shapeshift chains
0xdef1cafe Aug 24, 2023
c0b8662
fix: make the sandbox and snap the intersection of shapeshift support…
0xdef1cafe Aug 24, 2023
4011958
feat: add lerna
gomesalexandre Aug 25, 2023
4ef52ec
feat: temp use verdaccio for publishing
gomesalexandre Aug 25, 2023
048d3b2
Revert "feat: temp use verdaccio for publishing"
gomesalexandre Aug 25, 2023
5ea93a5
feat: lerna things
gomesalexandre Aug 25, 2023
c1446ad
feat: lerna version 0
gomesalexandre Aug 25, 2023
5209d59
feat: lerna use verdaccio
gomesalexandre Aug 25, 2023
b22521f
feat: add snap_getBip44Entropy permissions to manifest
gomesalexandre Aug 26, 2023
881648c
feat: commit lerna things
gomesalexandre Aug 26, 2023
37bf2d5
fix: derp comments in json
gomesalexandre Aug 26, 2023
9a888b9
feat: cleanup
gomesalexandre Aug 26, 2023
0b2bca4
fix: sandbox shouldn't use workspace package
gomesalexandre Aug 26, 2023
851ec87
v1.0.1
gomesalexandre Aug 26, 2023
0ee6144
feat: manifest v1.0.1
gomesalexandre Aug 26, 2023
ce8b69f
feat: attempt 1 at bip32 entropy getPublicKeys
gomesalexandre Aug 27, 2023
39f718b
feat: remove bip44 entropy perms
gomesalexandre Aug 27, 2023
3382933
v1.0.2
gomesalexandre Aug 27, 2023
74891f2
feat: getPublicKeys things
gomesalexandre Aug 27, 2023
2002387
feat: author manifest version
gomesalexandre Aug 27, 2023
6271e53
v1.0.3
gomesalexandre Aug 27, 2023
8e26565
fix: types
gomesalexandre Aug 27, 2023
a068010
feat: bump manifest
gomesalexandre Aug 27, 2023
517e23e
v1.0.4
gomesalexandre Aug 27, 2023
cceafbe
feat: litecoin getPublicKeys
gomesalexandre Aug 27, 2023
1f45945
v1.0.5
gomesalexandre Aug 27, 2023
04e9aea
feat: doggo coin
gomesalexandre Aug 27, 2023
932334d
v1.0.6
gomesalexandre Aug 27, 2023
5284f66
feat: roger ver pls
gomesalexandre Aug 27, 2023
abc93ec
v1.0.7
gomesalexandre Aug 27, 2023
2f0850a
feat: bump manifest
gomesalexandre Aug 27, 2023
57cd854
feat: bumpy bump
gomesalexandre Aug 28, 2023
ed2cbfe
v1.0.0-alpha.0
gomesalexandre Aug 28, 2023
118fc82
feat: consume alpha packages
gomesalexandre Aug 28, 2023
d31fe06
feat: rm registry entry from package
gomesalexandre Aug 29, 2023
ed151dd
feat: last removy
gomesalexandre Aug 29, 2023
5dbad7d
feat: adapter publishConfig
gomesalexandre Aug 29, 2023
6954d33
v1.0.0-alpha.1
gomesalexandre Aug 29, 2023
08020bd
feat: update manifest
gomesalexandre Aug 29, 2023
ee78320
feat: bump deps
gomesalexandre Aug 29, 2023
22d6153
v1.0.0-alpha.2
gomesalexandre Aug 29, 2023
9e93ece
v1.0.0-alpha.2
gomesalexandre Aug 29, 2023
83cc8d8
fix: maybe tsc things maybe not
gomesalexandre Aug 29, 2023
8fde98b
v1.0.0-alpha.3
gomesalexandre Aug 29, 2023
7bcb799
feat: include files
gomesalexandre Aug 29, 2023
f6281ee
feat: include src files
gomesalexandre Aug 29, 2023
8e0e7f6
feat: bump manifest
gomesalexandre Aug 29, 2023
16fe52c
v1.0.0-alpha.4
gomesalexandre Aug 29, 2023
50f0289
feat: matching versions
gomesalexandre Aug 29, 2023
98af0e5
v1.0.0-alpha.5
gomesalexandre Aug 29, 2023
6403087
feat: emit README in published package
gomesalexandre Aug 29, 2023
35c0a0a
feat: bring back npmjs registry
gomesalexandre Aug 29, 2023
889145c
v1.0.0-alpha.6
gomesalexandre Aug 29, 2023
65f4efc
feat: snap TODO readme ffs
gomesalexandre Aug 29, 2023
12d9af9
v1.0.0-alpha.7
gomesalexandre Aug 29, 2023
7dcab2a
feat: sync package version
gomesalexandre Aug 29, 2023
39ef5b6
v1.0.0-alpha.8
gomesalexandre Aug 29, 2023
78de7f9
feat: resync
gomesalexandre Aug 29, 2023
1446707
v1.0.0-alpha.9
gomesalexandre Aug 29, 2023
8cfec0e
v1.0.0-alpha.9
gomesalexandre Aug 29, 2023
e6c7133
feat: add README to types package
gomesalexandre Aug 29, 2023
2808b2a
v1.0.0-alpha.10
gomesalexandre Aug 29, 2023
d1ff01d
feat: life is better with sane types isn't it
gomesalexandre Aug 30, 2023
5f6cee1
feat: prepare manifest for next versionnaroo
gomesalexandre Aug 30, 2023
1bed27f
v1.0.0-alpha.11
gomesalexandre Aug 30, 2023
1861855
fix: typo
gomesalexandre Aug 30, 2023
74c0f1a
feat: regen lockfile
gomesalexandre Aug 30, 2023
d150a61
feat: lint
gomesalexandre Aug 30, 2023
bc7d6c9
fix: seriously man
gomesalexandre Aug 31, 2023
35f0f84
feat: frontrun manifest bump
gomesalexandre Aug 31, 2023
ba2fc54
feat: frontrun
gomesalexandre Aug 31, 2023
d330cb2
v1.0.0-alpha.12
gomesalexandre Aug 31, 2023
b44ecf2
feat: frontrun
gomesalexandre Aug 31, 2023
76cbd72
v1.0.0-alpha.13
gomesalexandre Aug 31, 2023
15d9617
feat: bump manifest
gomesalexandre Aug 31, 2023
5569a34
fix: yarn.lock
gomesalexandre Aug 31, 2023
3c56409
v1.0.0-alpha.14
gomesalexandre Aug 31, 2023
14220cb
fix: yarn.lock
gomesalexandre Aug 31, 2023
a4b42ec
feat: another frontrun
gomesalexandre Aug 31, 2023
2c82966
v1.0.0-alpha.15
gomesalexandre Aug 31, 2023
dfba3c9
feat: reregen
gomesalexandre Aug 31, 2023
23c5c5f
fix: reconciliate patch-package versions
gomesalexandre Aug 31, 2023
ee9d9ce
v1.0.0-alpha.16
gomesalexandre Aug 31, 2023
fd889a3
feat: regen yarn.lock
gomesalexandre Aug 31, 2023
4f04795
v1.0.0-alpha.17
gomesalexandre Aug 31, 2023
d30cca8
feat: pls work
gomesalexandre Aug 31, 2023
952353c
feat: move patch-package to direct dep
gomesalexandre Aug 31, 2023
54beb75
feat: frontrun
gomesalexandre Aug 31, 2023
e17c1cf
feat: boimp
gomesalexandre Aug 31, 2023
2f08dae
fix: merge
gomesalexandre Aug 31, 2023
b5267cc
fix: lint
gomesalexandre Sep 3, 2023
ffb7818
v1.0.0-alpha.22
gomesalexandre Sep 5, 2023
6ccf6ad
feat: p-queu
gomesalexandre Sep 5, 2023
e4e5546
v1.0.0-alpha.23
gomesalexandre Sep 5, 2023
a8d36e5
feat: 1 rps json-rpc requests
gomesalexandre Sep 5, 2023
71d20da
v1.0.0-alpha.24
gomesalexandre Sep 5, 2023
c51d18d
feat: improve shapeshiftSnapInstalled control flow
gomesalexandre Sep 6, 2023
fc176dd
v1.0.0-alpha.25
gomesalexandre Sep 7, 2023
22b5d22
feat: regen yarn.lock and manifest
gomesalexandre Sep 7, 2023
93cc39a
feat: remove flask assumptions
gomesalexandre Sep 11, 2023
ee2ecde
v1.0.0-alpha.26
gomesalexandre Sep 11, 2023
7955e7c
feat: best safe interval
gomesalexandre Sep 11, 2023
f89d637
feat: bump manifest
gomesalexandre Sep 11, 2023
37b87bb
v1.0.0-alpha.27
gomesalexandre Sep 11, 2023
86f6173
feat: blazingly fast
gomesalexandre Sep 11, 2023
5bccb92
v1.0.0-alpha.28
gomesalexandre Sep 11, 2023
af81502
feat: regen yarn.lock
gomesalexandre Sep 11, 2023
4c460f6
fix: comment
gomesalexandre Sep 11, 2023
c9e3f43
feat: bump manifest
gomesalexandre Sep 11, 2023
b689eb2
feat: frontrun manifest bump
gomesalexandre Sep 11, 2023
dc88d2c
feat: frontrun manifest sha
gomesalexandre Sep 11, 2023
485f169
v1.0.0-alpha.28
gomesalexandre Sep 11, 2023
a4564fc
feat: frontrun again
gomesalexandre Sep 11, 2023
a251e1f
v1.0.0-alpha.29
gomesalexandre Sep 11, 2023
08a7444
feat: remove now empty re-exports file
gomesalexandre Sep 11, 2023
3c4fd33
v1.0.0-alpha.30
gomesalexandre Sep 11, 2023
5b76d69
feat: bump manifest
gomesalexandre Sep 11, 2023
7cc4ef0
v1.0.0-alpha.30-1
gomesalexandre Sep 11, 2023
c43b1b5
feat: frontrun again
gomesalexandre Sep 11, 2023
9eac9ab
v1.0.0-alpha.31
gomesalexandre Sep 11, 2023
7f2fe80
feat: frontrun
gomesalexandre Sep 11, 2023
bb4e4fd
feat: bump snap only
gomesalexandre Sep 11, 2023
5637f03
feat: snap v1.0.0
gomesalexandre Sep 11, 2023
0b776a6
feat: wrap all utxo xpub methods in MaybeRpcResponse<T>
gomesalexandre Sep 19, 2023
d75641f
v1.0.1
gomesalexandre Sep 19, 2023
520dfd9
feat: bump yarn.lock
gomesalexandre Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"packages": [
"packages/*"
],
"version": "1.0.0-alpha.21",
"version": "1.0.1",
"useWorkspaces": true,
"npmClient": "yarn"
}
9 changes: 5 additions & 4 deletions packages/adapter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/metamask-snaps-adapter",
"version": "1.0.0-alpha.21",
"version": "1.0.1",
"description": "",
"author": "pastaghost <[email protected]> (http://www.github.com/pastaghost)",
"homepage": "https://github.com/shapeshift/metamask-snaps/tree/main/packages/adapter",
Expand Down Expand Up @@ -28,8 +28,9 @@
"@metamask/snaps-ui": "1.0.1",
"@shapeshiftoss/hdwallet-core": "^1.50.4",
"@shapeshiftoss/logger": "^1.1.3",
"@shapeshiftoss/metamask-snaps": "^1.0.0-alpha.21",
"@shapeshiftoss/metamask-snaps-types": "^1.0.0-alpha.21"
"@shapeshiftoss/metamask-snaps": "^1.0.1",
"@shapeshiftoss/metamask-snaps-types": "^1.0.1",
"p-queue": "^7.4.1"
},
"peerDependencies": {
"@shapeshiftoss/caip": "*",
Expand Down Expand Up @@ -60,7 +61,7 @@
"publishConfig": {
"access": "public"
},
"gitHead": "54beb75f060ee91836861205eaaf04226f40a326",
"gitHead": "dff70c07a9132a258ab89fc1e3f2169ec2e3fcff",
"installConfig": {
"hoistingLimits": "dependencies"
},
Expand Down
1 change: 0 additions & 1 deletion packages/adapter/src/utils.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
describe('utils', () => {
describe('getMetaMaskProvider', () => {})
describe('metaMaskFlaskSupported', () => {})
describe('shapeShiftSnapInstalled', () => {})
describe('isLocked', () => {})
describe('enableShapeShiftsnap', () => {})
Expand Down
48 changes: 21 additions & 27 deletions packages/adapter/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
ShapeShiftSnapRPCResponse,
} from '@shapeshiftoss/metamask-snaps-types'
import assert from 'assert'
import PQueue from 'p-queue'

import { logger } from './lib/logger'
import { walletRequestSnaps } from './metamask/metamask'
Expand Down Expand Up @@ -39,27 +40,15 @@ export const getMetaMaskProvider = async (): Promise<Provider | undefined> => {
return undefined
}

export const metaMaskFlaskSupported = async (externalProvider?: any): Promise<boolean> => {
try {
const provider = externalProvider || (await getMetaMaskProvider())

const isFlask = (await provider.request({ method: 'web3_clientVersion' }))?.includes('flask')
assert(isFlask, 'Please install MetaMask Flask.')
} catch (error) {
moduleLogger.error({ fn: 'metaMaskFlaskSupported' }, error)
}
return true
}

export const shapeShiftSnapInstalled = async (snapId: string): Promise<boolean> => {
const provider = await getMetaMaskProvider()
if (provider === undefined) {
throw new Error('Could not get MetaMask provider')
}
if (provider.request === undefined) {
throw new Error('MetaMask provider does not define a .request() method')
}
try {
const provider = await getMetaMaskProvider()
if (provider === undefined) {
throw new Error('Could not get MetaMask provider')
}
if (provider.request === undefined) {
throw new Error('MetaMask provider does not define a .request() method')
}
const ret = await provider.request({
method: 'wallet_getSnaps',
})
Expand Down Expand Up @@ -119,7 +108,6 @@ export const enableShapeShiftSnap = async (
},
}
try {
assert(metaMaskFlaskSupported(), 'Please install MetaMask Flask.')
const snapIsInstalled = await shapeShiftSnapInstalled(snapId)
if (!snapIsInstalled) {
const res = await walletRequestSnaps(snapId, version)
Expand All @@ -133,6 +121,10 @@ export const enableShapeShiftSnap = async (
return ret
}

// Flask only supports a max. of 5 queued requests, so this ensures we're under that
// by limiting to 5 concurrent snap JSON-RPC request in a 40ms window
const flaskRpcRequestsQueue = new PQueue({ concurrency: 5, interval: 40 })

export const sendFlaskRPCRequest = async <T extends ShapeShiftSnapRPCResponse>(
request: ShapeShiftSnapRPCRequest,
snapId: string,
Expand All @@ -145,13 +137,15 @@ export const sendFlaskRPCRequest = async <T extends ShapeShiftSnapRPCResponse>(
if (provider.request === undefined) {
throw new Error('MetaMask provider does not define a .request() method')
}
const ret = await provider.request({
method: 'wallet_invokeSnap',
params: {
snapId,
request,
},
})
const ret = await flaskRpcRequestsQueue.add(() =>
provider.request?.({
method: 'wallet_invokeSnap',
params: {
snapId,
request,
},
}),
)
return ret as T
} catch (error) {
moduleLogger.error(error, { fn: 'sendFlaskRPCRequest' }, `${request.method} RPC call failed.`)
Expand Down
16 changes: 16 additions & 0 deletions packages/adapter/src/utxo/bitcoin/bitcoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
BitcoinBroadcastTransactionResponse,
BitcoinGetAddressAdapterParams,
BitcoinGetAddressResponse,
BitcoinGetPublicKeysResponse,
BitcoinSignTransactionAdapterParams,
BitcoinSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand All @@ -27,6 +28,21 @@ export const BTCGetAddress = async (
}
}

export const BTCGetPublicKeys = async (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This guy was missing and so was btc_getPublicKeys and its handler - this calls the btc_getPublicKeys with the same abstraction other methods in this module do so

params: BitcoinGetAddressAdapterParams,
): Promise<BitcoinGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
{ method: 'btc_getPublicKeys', params: { addressParams } },
snapId,
)
} catch (error) {
moduleLogger.error(error, { fn: 'BTCGetPublicKeys' }, `btc_getPublicKeys RPC call failed.`)
return Promise.reject(error)
}
}

export const BTCSignTransaction = async (
params: BitcoinSignTransactionAdapterParams,
): Promise<BitcoinSignTransactionResponse> => {
Expand Down
16 changes: 16 additions & 0 deletions packages/adapter/src/utxo/bitcoincash/bitcoincash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
BitcoinCashBroadcastTransactionResponse,
BitcoinCashGetAddressAdapterParams,
BitcoinCashGetAddressResponse,
BitcoinCashGetPublicKeysResponse,
BitcoinCashSignTransactionAdapterParams,
BitcoinCashSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -32,6 +33,21 @@ export const BCHGetAddress = async (
}
}

export const BCHGetPublicKeys = async (
params: BitcoinCashGetAddressAdapterParams,
): Promise<BitcoinCashGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
{ method: 'bch_getPublicKeys', params: { addressParams } },
snapId,
)
} catch (error) {
moduleLogger.error(error, { fn: 'BCHGetPublicKeys' }, `bch_getPublicKeys RPC call failed.`)
return Promise.reject(error)
}
}

export const BCHSignTransaction = async (
params: BitcoinCashSignTransactionAdapterParams,
): Promise<BitcoinCashSignTransactionResponse> => {
Expand Down
20 changes: 20 additions & 0 deletions packages/adapter/src/utxo/dogecoin/dogecoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
DogecoinBroadcastTransactionResponse,
DogecoinGetAddressAdapterParams,
DogecoinGetAddressResponse,
DogecoinGetPublicKeysResponse,
DogecoinSignTransactionAdapterParams,
DogecoinSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -30,6 +31,25 @@ export const dogecoinGetAddress = async (
}
}

export const dogecoinGetPublicKeys = async (
params: DogecoinGetAddressAdapterParams,
): Promise<DogecoinGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
{ method: 'doge_getPublicKeys', params: { addressParams } },
snapId,
)
} catch (error) {
moduleLogger.error(
error,
{ fn: 'dogecoinGetPublicKeys' },
`doge_getPublicKeys RPC call failed.`,
)
return Promise.reject(error)
}
}

export const dogecoinSignTransaction = async (
params: DogecoinSignTransactionAdapterParams,
): Promise<DogecoinSignTransactionResponse> => {
Expand Down
16 changes: 16 additions & 0 deletions packages/adapter/src/utxo/litecoin/litecoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type {
LitecoinBroadcastTransactionResponse,
LitecoinGetAddressAdapterParams,
LitecoinGetAddressResponse,
LitecoinGetPublicKeysResponse,
LitecoinSignTransactionAdapterParams,
LitecoinSignTransactionResponse,
} from '@shapeshiftoss/metamask-snaps-types'
Expand Down Expand Up @@ -30,6 +31,21 @@ export const LTCGetAddress = async (
}
}

export const LTCGetPublicKeys = async (
params: LitecoinGetAddressAdapterParams,
): Promise<LitecoinGetPublicKeysResponse> => {
const { addressParams, snapId } = params
try {
return await sendFlaskRPCRequest(
{ method: 'ltc_getPublicKeys', params: { addressParams } },
snapId,
)
} catch (error) {
moduleLogger.error(error, { fn: 'LTCGetPublicKeys' }, `ltc_getPublicKeys RPC call failed.`)
return Promise.reject(error)
}
}

export const LTCSignTransaction = async (
params: LitecoinSignTransactionAdapterParams,
): Promise<LitecoinSignTransactionResponse> => {
Expand Down
4 changes: 2 additions & 2 deletions packages/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "sandbox",
"version": "1.0.0-alpha.21",
"version": "1.0.1",
"license": "MIT",
"homepage": "https://shapeshift.github.io/metamask-snaps/",
"scripts": {
Expand All @@ -26,7 +26,7 @@
"@reduxjs/toolkit": "^1.8.3",
"@shapeshiftoss/hdwallet-core": "^1.50.4",
"@shapeshiftoss/logger": "^1.1.2",
"@shapeshiftoss/metamask-snaps-adapter": "^1.0.0-alpha.21",
"@shapeshiftoss/metamask-snaps-adapter": "^1.0.1",
"@testing-library/jest-dom": "^5.16.4",
"@testing-library/react": "^13.0.1",
"@testing-library/user-event": "^14.1.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {
BCHBroadcastTransaction,
BCHGetAddress,
BCHBroadcastTransaction,
BCHSignTransaction,
BTCBroadcastTransaction,
BTCGetAddress,
Expand All @@ -11,9 +11,9 @@ import {
dogecoinBroadcastTransaction,
dogecoinGetAddress,
dogecoinSignTransaction,
LTCBroadcastTransaction,
LTCGetAddress,
LTCSignTransaction,
LTCBroadcastTransaction,
thorchainBroadcastTransaction,
thorchainGetAddress,
thorchainSignTransaction,
Expand Down
6 changes: 3 additions & 3 deletions packages/snap/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/metamask-snaps",
"version": "1.0.0-alpha.21",
"version": "1.0.1",
"description": "A multi-chain Snap for MetaMask by ShapeShift.",
"license": "MIT",
"author": "pastaghost <[email protected]> (http://www.github.com/pastaghost)",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@shapeshiftoss/hdwallet-core": "^1.50.4",
"@shapeshiftoss/hdwallet-native": "^1.50.4",
"@shapeshiftoss/logger": "^1.1.2",
"@shapeshiftoss/metamask-snaps-types": "^1.0.0-alpha.21",
"@shapeshiftoss/metamask-snaps-types": "^1.0.1",
"@shapeshiftoss/types": "^8.3.0",
"@shapeshiftoss/unchained-client": "10.1.1",
"eth-rpc-errors": "^4.0.3",
Expand Down Expand Up @@ -117,5 +117,5 @@
"hoistingLimits": "workspaces"
},
"packageManager": "[email protected]",
"gitHead": "54beb75f060ee91836861205eaaf04226f40a326"
"gitHead": "dff70c07a9132a258ab89fc1e3f2169ec2e3fcff"
}
4 changes: 2 additions & 2 deletions packages/snap/snap.manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.0.0-alpha.21",
"version": "1.0.1",
"description": "The ShapeShift Multichain snap evolves your wallet to support 11 chains in one snap, including Bitcoin, Dogecoin, Litecoin, Cosmos, Binance Chain, Bitcoin Cash, THORChain, Osmosis, and Secret Network.",
"proposedName": "ShapeShift Multichain",
"repository": {
Expand All @@ -15,7 +15,7 @@
"registry": "https://registry.npmjs.org/"
}
},
"shasum": "6BFw+qPCNlvOwsg02OhdBLlwyVCV2sjqPoUWxXY7eRc="
"shasum": "TGIuQx3ItIAjD1Zp1hl+53YY1ULXSoRQGQx9ppn1pFM="
},
"initialPermissions": {
"endowment:network-access": {},
Expand Down
12 changes: 12 additions & 0 deletions packages/snap/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,25 @@ import {
import {
bitcoinBroadcastTransaction,
bitcoinGetAddress,
bitcoinGetPublicKeys,
bitcoinSignTransaction,
} from './rpc/utxo/bitcoin'
import {
bitcoincashBroadcastTransaction,
bitcoincashGetAddress,
bitcoincashGetPublicKeys,
bitcoincashSignTransaction,
} from './rpc/utxo/bitcoincash'
import {
dogecoinBroadcastTransaction,
dogecoinGetAddress,
dogecoinGetPublicKeys,
dogecoinSignTransaction,
} from './rpc/utxo/dogecoin'
import {
litecoinBroadcastTransaction,
litecoinGetAddress,
litecoinGetPublicKeys,
litecoinSignTransaction,
} from './rpc/utxo/litecoin'

Expand Down Expand Up @@ -99,12 +103,16 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request, origin }: RPC
return await binanceBroadcastTransaction({ origin, ...params })
case 'bch_getAddress':
return await bitcoincashGetAddress(params)
case 'bch_getPublicKeys':
return await bitcoincashGetPublicKeys(params)
case 'bch_signTransaction':
return await bitcoincashSignTransaction({ origin, ...params })
case 'bch_broadcastTransaction':
return await bitcoincashBroadcastTransaction({ origin, ...params })
case 'btc_getAddress':
return await bitcoinGetAddress(params)
case 'btc_getPublicKeys':
return await bitcoinGetPublicKeys(params)
case 'btc_signTransaction':
return await bitcoinSignTransaction({ origin, ...params })
case 'btc_broadcastTransaction':
Expand All @@ -117,6 +125,8 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request, origin }: RPC
return await cosmosBroadcastTransaction({ origin, ...params })
case 'doge_getAddress':
return await dogecoinGetAddress(params)
case 'doge_getPublicKeys':
return await dogecoinGetPublicKeys(params)
case 'doge_signTransaction':
return await dogecoinSignTransaction({ origin, ...params })
case 'doge_broadcastTransaction':
Expand All @@ -135,6 +145,8 @@ export const onRpcRequest: OnRpcRequestHandler = async ({ request, origin }: RPC
return await kavaBroadcastTransaction({ origin, ...params })
case 'ltc_getAddress':
return await litecoinGetAddress(params)
case 'ltc_getPublicKeys':
return await litecoinGetPublicKeys(params)
case 'ltc_signTransaction':
return await litecoinSignTransaction({ origin, ...params })
case 'ltc_broadcastTransaction':
Expand Down
Loading
Loading