Skip to content

Commit

Permalink
refactor(sdk): Format after rename (#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
marc2332 authored Jun 6, 2024
1 parent a864be5 commit 2185f71
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
6 changes: 3 additions & 3 deletions sdk/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ For more complete docs, visit the [Iota TypeScript SDK docs](https://sdk.mystenl
# Iota TypeScript SDK

This is the Iota TypeScript SDK built on the Iota
[JSON RPC API](https://github.com/iotaledger/iota/blob/main/docs/content/references/iota-api.mdx). It
provides utility classes and functions for applications to sign transactions and interact with the
Iota network.
[JSON RPC API](https://github.com/iotaledger/iota/blob/main/docs/content/references/iota-api.mdx).
It provides utility classes and functions for applications to sign transactions and interact with
the Iota network.

WARNING: Note that we are still iterating on the RPC and SDK API before TestNet, therefore please
expect frequent breaking changes in the short-term. We expect the API to stabilize after the
Expand Down
4 changes: 3 additions & 1 deletion sdk/typescript/src/bcs/type-tag-serializer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ export class TypeTagSerializer {

const structMatch = str.match(STRUCT_REGEX);
if (structMatch) {
const address = normalizeAddress ? normalizeIotaAddress(structMatch[1]) : structMatch[1];
const address = normalizeAddress
? normalizeIotaAddress(structMatch[1])
: structMatch[1];
return {
struct: {
address,
Expand Down
10 changes: 8 additions & 2 deletions sdk/typescript/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,10 @@ export class IotaClient {
* Return the latest system state content.
*/
async getLatestIotaSystemState(): Promise<IotaSystemStateSummary> {
return await this.transport.request({ method: 'iotax_getLatestIotaSystemState', params: [] });
return await this.transport.request({
method: 'iotax_getLatestIotaSystemState',
params: [],
});
}

/**
Expand Down Expand Up @@ -672,7 +675,10 @@ export class IotaClient {
}

async getAddressMetrics(): Promise<AddressMetrics> {
return await this.transport.request({ method: 'iotax_getLatestAddressMetrics', params: [] });
return await this.transport.request({
method: 'iotax_getLatestAddressMetrics',
params: [],
});
}

async getEpochMetrics(
Expand Down
4 changes: 3 additions & 1 deletion sdk/typescript/src/client/http-transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export interface IotaTransportSubscribeOptions<T> {

export interface IotaTransport {
request<T = unknown>(input: IotaTransportRequestOptions): Promise<T>;
subscribe<T = unknown>(input: IotaTransportSubscribeOptions<T>): Promise<() => Promise<boolean>>;
subscribe<T = unknown>(
input: IotaTransportSubscribeOptions<T>,
): Promise<() => Promise<boolean>>;
}

export class IotaHTTPTransport implements IotaTransport {
Expand Down
6 changes: 5 additions & 1 deletion sdk/typescript/test/e2e/read-transactions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ describe('Transaction Reading API', () => {

beforeAll(async () => {
toolbox = await setup();
transactions = await executePayIotaNTimes(toolbox.client, toolbox.keypair, NUM_TRANSACTIONS);
transactions = await executePayIotaNTimes(
toolbox.client,
toolbox.keypair,
NUM_TRANSACTIONS,
);
});

it('Get Total Transactions', async () => {
Expand Down
7 changes: 4 additions & 3 deletions sdk/typescript/test/e2e/rpc-endpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ describe('Invoke any RPC endpoint', () => {
const gasObjectsExpected = await toolbox.client.getOwnedObjects({
owner: toolbox.address(),
});
const gasObjects = await toolbox.client.call<{ data: IotaGasData }>('iotax_getOwnedObjects', [
toolbox.address(),
]);
const gasObjects = await toolbox.client.call<{ data: IotaGasData }>(
'iotax_getOwnedObjects',
[toolbox.address()],
);
expect(gasObjects.data).toStrictEqual(gasObjectsExpected.data);
});

Expand Down
6 changes: 5 additions & 1 deletion sdk/typescript/test/e2e/txn-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

import { beforeAll, beforeEach, describe, expect, it } from 'vitest';

import { IotaClient, IotaObjectChangeCreated, IotaTransactionBlockResponse } from '../../src/client';
import {
IotaClient,
IotaObjectChangeCreated,
IotaTransactionBlockResponse,
} from '../../src/client';
import type { Keypair } from '../../src/cryptography';
import { normalizeIotaObjectId, IOTA_SYSTEM_STATE_OBJECT_ID } from '../../src/utils';
import {
Expand Down

0 comments on commit 2185f71

Please sign in to comment.