Skip to content

Commit 9d0cef8

Browse files
committed
Simplify locator retrieval
1 parent 0101c7a commit 9d0cef8

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/getGateway.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import { isDefined } from '@xylabs/typeof'
2-
import type { SimpleXyoSigner, XyoConnection } from '@xyo-network/xl1-sdk'
3-
import {
4-
SimpleXyoGatewayRunner, XyoConnectionMoniker, XyoSignerMoniker,
5-
} from '@xyo-network/xl1-sdk'
2+
import { SimpleXyoGatewayRunner } from '@xyo-network/xl1-sdk'
63

74
import { getLocator } from './getLocator.ts'
85

@@ -17,11 +14,7 @@ export const getGateway = async () => {
1714
// Get locator
1815
const locator = await getLocator()
1916

20-
// Use locator to get connection and signer
21-
const connection = await locator.getInstance<XyoConnection>(XyoConnectionMoniker)
22-
const signer = await locator.getInstance<SimpleXyoSigner>(XyoSignerMoniker)
23-
2417
// Create gateway from connection and signer
25-
gateway = new SimpleXyoGatewayRunner(connection, signer)
18+
gateway = await locator.getInstance<SimpleXyoGatewayRunner>(SimpleXyoGatewayRunner.defaultMoniker)
2619
return gateway
2720
}

0 commit comments

Comments
 (0)