Skip to content

Commit 4e1fa9d

Browse files
committed
feat: support setllar
1 parent 2c691ae commit 4e1fa9d

File tree

6 files changed

+27
-18
lines changed

6 files changed

+27
-18
lines changed

packages/core/src/api/allnetwork/AllNetworkGetAddress.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import { HardwareErrorCode, HardwareErrorCodeMessage } from '@onekeyfe/hd-shared';
2-
import { CoreApi } from '../../types';
32

3+
import { createUiMessage } from '../../events';
4+
import { UI_REQUEST } from '../../constants/ui-request';
5+
import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
6+
7+
import type { CoreApi } from '../../types';
48
import type {
59
AllNetworkAddress,
610
AllNetworkAddressParams,
711
AllNetworkGetAddressParams,
812
} from '../../types/api/allNetworkGetAddress';
9-
import { createUiMessage } from '../../events';
10-
import { UI_REQUEST } from '../../constants/ui-request';
11-
import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
1213

1314
type MethodParams = {
1415
methodName: keyof CoreApi;

packages/core/src/api/allnetwork/AllNetworkGetAddressBase.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,9 @@ const networkConfigMap: NetworkConfigMap = {
240240
neo: {
241241
methodName: 'neoGetAddress',
242242
},
243+
stellar: {
244+
methodName: 'stellarGetAddress',
245+
},
243246
};
244247

245248
type MethodParams = {

packages/core/src/api/allnetwork/AllNetworkGetAddressByLoop.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
import {
2-
createDeferred,
32
ERRORS,
43
HardwareError,
54
HardwareErrorCode,
65
HardwareErrorCodeMessage,
6+
createDeferred,
77
} from '@onekeyfe/hd-shared';
8+
9+
import { IFRAME } from '../../events';
10+
import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
11+
12+
import type { Unsuccessful } from '../../types';
813
import type {
914
AllNetworkAddress,
1015
AllNetworkGetAddressParamsByLoop,
1116
} from '../../types/api/allNetworkGetAddress';
1217

13-
import { IFRAME } from '../../events';
14-
import AllNetworkGetAddressBase from './AllNetworkGetAddressBase';
15-
import { Unsuccessful } from '../../types';
16-
1718
export default class AllNetworkGetAddressByLoop extends AllNetworkGetAddressBase {
1819
async getAllNetworkAddress(rootFingerprint: number) {
1920
const { callbackId, callbackIdFinish } = this.payload as AllNetworkGetAddressParamsByLoop;

packages/core/src/api/stellar/StellarGetAddress.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
21
import { UI_REQUEST } from '../../constants/ui-request';
32
import { serializedPath, validatePath } from '../helpers/pathUtils';
43
import { BaseMethod } from '../BaseMethod';
54
import { validateParams, validateResult } from '../helpers/paramsValidator';
6-
import { StellarGetAddressParams, StellarAddress } from '../../types';
5+
6+
import type { StellarGetAddress as HardwareStellarGetAddress } from '@onekeyfe/hd-transport';
7+
import type { StellarAddress, StellarGetAddressParams } from '../../types';
78

89
export default class StellarGetAddress extends BaseMethod<HardwareStellarGetAddress[]> {
910
hasBundle = false;

packages/core/src/api/stellar/StellarSignTransaction.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import {
2-
StellarMemoType,
3-
StellarSignedTx,
4-
StellarSignTx as HardwareStellarSignTx,
5-
} from '@onekeyfe/hd-transport';
1+
import { StellarMemoType } from '@onekeyfe/hd-transport';
62
import { ERRORS, HardwareErrorCode } from '@onekeyfe/hd-shared';
3+
74
import { UI_REQUEST } from '../../constants/ui-request';
85
import { validatePath } from '../helpers/pathUtils';
96
import { BaseMethod } from '../BaseMethod';
107
import { validateParams } from '../helpers/paramsValidator';
11-
import { StellarOperation, StellarSignTransactionParams } from '../../types';
8+
9+
import type {
10+
StellarSignTx as HardwareStellarSignTx,
11+
StellarSignedTx,
12+
} from '@onekeyfe/hd-transport';
13+
import type { StellarOperation, StellarSignTransactionParams } from '../../types';
1214

1315
export default class StellarSignTransaction extends BaseMethod<HardwareStellarSignTx> {
1416
operations: any[] = [];

packages/core/src/types/api/allNetworkGetAddress.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ export type INetwork =
3333
| 'alph'
3434
| 'nostr'
3535
| 'benfen'
36-
| 'neo';
36+
| 'neo'
37+
| 'stellar';
3738

3839
export type CommonResponseParams = {
3940
path: string;

0 commit comments

Comments
 (0)