@onekeyfe/onekey-near-provider 2.0.0-alpha.8 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,28 +5,28 @@ import { Account, Connection, transactions } from 'near-api-js';
5
5
  import type { Action as NearTransactionAction, Transaction as NearTransaction } from 'near-api-js/lib/transaction';
6
6
  import type { AccessKeyInfoView, FinalExecutionOutcome } from 'near-api-js/lib/providers/provider';
7
7
  import { ProviderNearBase } from './ProviderNearBase';
8
- export declare type NearAccountInfo = {
8
+ export type NearAccountInfo = {
9
9
  accountId: string;
10
10
  publicKey: string;
11
11
  allKeys?: string[];
12
12
  };
13
- export declare type NearNetworkInfo = {
13
+ export type NearNetworkInfo = {
14
14
  networkId: string;
15
15
  nodeUrls?: string[];
16
16
  };
17
- export declare type NearNetworkChangedPayload = NearNetworkInfo;
18
- export declare type NearProviderState = {
17
+ export type NearNetworkChangedPayload = NearNetworkInfo;
18
+ export type NearProviderState = {
19
19
  accounts: Array<NearAccountInfo>;
20
20
  network: NearNetworkChangedPayload;
21
21
  };
22
- export declare type NearAccountsChangedPayload = {
22
+ export type NearAccountsChangedPayload = {
23
23
  accounts: Array<NearAccountInfo>;
24
24
  };
25
- export declare type NearUnlockChangedPayload = {
25
+ export type NearUnlockChangedPayload = {
26
26
  isUnlocked: boolean;
27
27
  };
28
- export declare type NearConnection = Connection;
29
- export declare type TransactionCreatorParams = {
28
+ export type NearConnection = Connection;
29
+ export type TransactionCreatorParams = {
30
30
  accountId: string;
31
31
  publicKey: string;
32
32
  receiverId: string;
@@ -34,8 +34,8 @@ export declare type TransactionCreatorParams = {
34
34
  actions: NearTransactionAction[];
35
35
  blockHash: Buffer;
36
36
  };
37
- export declare type TransactionCreator = (params: TransactionCreatorParams) => any;
38
- export declare type OneKeyNearWalletProps = {
37
+ export type TransactionCreator = (params: TransactionCreatorParams) => any;
38
+ export type OneKeyNearWalletProps = {
39
39
  connection?: NearConnection | any;
40
40
  networkId?: string;
41
41
  connectEagerly?: boolean;
@@ -44,41 +44,41 @@ export declare type OneKeyNearWalletProps = {
44
44
  keyPrefix?: string;
45
45
  transactionCreator?: TransactionCreator;
46
46
  } & IInpageProviderConfig;
47
- export declare type OneKeyWalletAccountProps = {
47
+ export type OneKeyWalletAccountProps = {
48
48
  wallet: OneKeyNearProvider;
49
49
  connection: unknown;
50
50
  accountId: string;
51
51
  };
52
- export declare type CommonOptionsMeta = unknown | string | object;
53
- export declare type SignInOptions = {
52
+ export type CommonOptionsMeta = unknown | string | object;
53
+ export type SignInOptions = {
54
54
  contractId?: string;
55
55
  methodNames?: string[];
56
56
  successUrl?: string;
57
57
  failureUrl?: string;
58
58
  };
59
- export declare type SignInResult = NearAccountsChangedPayload;
60
- export declare type SignTransactionsOptions = {
59
+ export type SignInResult = NearAccountsChangedPayload;
60
+ export type SignTransactionsOptions = {
61
61
  transactions: NearTransaction[];
62
62
  callbackUrl?: string;
63
63
  meta?: CommonOptionsMeta;
64
64
  send?: boolean;
65
65
  };
66
- export declare type SignTransactionsResult = {
66
+ export type SignTransactionsResult = {
67
67
  transactionHashes: string[];
68
68
  };
69
- export declare type SignMessagesOptions = {
69
+ export type SignMessagesOptions = {
70
70
  messages: string[];
71
71
  meta?: CommonOptionsMeta;
72
72
  };
73
- export declare type SignMessagesResult = {
73
+ export type SignMessagesResult = {
74
74
  signatures: string[];
75
75
  };
76
- export declare type CreateTransactionOptions = {
76
+ export type CreateTransactionOptions = {
77
77
  receiverId: string;
78
78
  actions: NearTransactionAction[];
79
79
  nonceOffset?: number;
80
80
  };
81
- export declare type SignAndSendTransactionOptions = {
81
+ export type SignAndSendTransactionOptions = {
82
82
  receiverId: string;
83
83
  actions: NearTransactionAction[];
84
84
  meta?: CommonOptionsMeta;
@@ -98,8 +98,8 @@ declare const PROVIDER_EVENTS: {
98
98
  readonly chainChanged: "chainChanged";
99
99
  readonly unlockChanged: "unlockChanged";
100
100
  };
101
- export declare type PROVIDER_EVENTS_STRINGS = keyof typeof PROVIDER_EVENTS;
102
- declare type OneKeyNearProviderEventsMap = {
101
+ export type PROVIDER_EVENTS_STRINGS = keyof typeof PROVIDER_EVENTS;
102
+ type OneKeyNearProviderEventsMap = {
103
103
  [PROVIDER_EVENTS.accountsChanged]: (payload: NearAccountsChangedPayload) => void;
104
104
  [PROVIDER_EVENTS.networkChanged]: (payload: NearNetworkChangedPayload) => void;
105
105
  [PROVIDER_EVENTS.chainChanged]: (payload: NearNetworkChangedPayload) => void;
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onekeyfe/onekey-near-provider",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0",
4
4
  "keywords": [
5
5
  "cross-inpage-provider"
6
6
  ],
@@ -35,13 +35,13 @@
35
35
  "near-api-js": "^0.44.2"
36
36
  },
37
37
  "dependencies": {
38
- "@onekeyfe/cross-inpage-provider-core": "2.0.0-alpha.8",
39
- "@onekeyfe/cross-inpage-provider-errors": "2.0.0-alpha.8",
40
- "@onekeyfe/cross-inpage-provider-types": "2.0.0-alpha.8",
41
- "@onekeyfe/extension-bridge-injected": "2.0.0-alpha.8",
38
+ "@onekeyfe/cross-inpage-provider-core": "2.0.0",
39
+ "@onekeyfe/cross-inpage-provider-errors": "2.0.0",
40
+ "@onekeyfe/cross-inpage-provider-types": "2.0.0",
41
+ "@onekeyfe/extension-bridge-injected": "2.0.0",
42
42
  "borsh": "^0.6.0",
43
43
  "depd": "^2.0.0",
44
44
  "tweetnacl": "^1.0.3"
45
45
  },
46
- "gitHead": "a72404c2d39b3910aa62c137be02e4643c3b59f0"
46
+ "gitHead": "4e9109e35064cc7dafe3a4f86a33f497ad9567ec"
47
47
  }