Skip to content

Commit e9bf635

Browse files
authored
add fetchListOfChain (#380)
1 parent d019ade commit e9bf635

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/client/address.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ export const AddressKeystoreClient = (axiosInstance: AxiosInstance, keystore: Ke
1515
/** Get an address by addressID */
1616
fetch: (addressID: string): Promise<AddressResponse> => axiosInstance.get<unknown, AddressResponse>(`/addresses/${addressID}`),
1717

18+
/** @deprecated Use fetchListOfChain() instead */
1819
/** Get a list of withdrawal addresses for the given asset */
1920
fetchList: (assetID: string): Promise<AddressResponse[]> => axiosInstance.get<unknown, AddressResponse[]>(`/assets/${assetID}/addresses`),
2021

22+
fetchListOfChain: (chainID: string): Promise<AddressResponse[]> => axiosInstance.get<unknown, AddressResponse[]>(`/safe/addresses?chain=${chainID}`),
23+
2124
/** Create a new withdrawal address */
2225
create: (pin: string, params: AddressRequest): Promise<AddressResponse> => {
2326
const msg = getCreateAddressTipBody(params.asset_id, params.destination, params.tag ?? '', params.label);

test/address.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('address', () => {
1313
tmpAddressID = receive.address_id;
1414
});
1515
it('read addresses', async () => {
16-
const list = await client.address.fetchList(asset_id);
16+
const list = await client.address.fetchListOfChain(asset_id);
1717
const isHave = list.some(item => item.address_id === tmpAddressID);
1818
expect(isHave).toBeTruthy();
1919
});

0 commit comments

Comments
 (0)