@near-mobile/connector 0.0.2 → 0.0.4
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.
- package/dist/chunk-2P3A4VVY.js +37 -0
- package/dist/{chunk-OQVZGXMP.mjs → chunk-B2YNUFH6.mjs} +1 -1
- package/dist/chunk-CC4VKGDC.mjs +37 -0
- package/dist/{chunk-ZTA2C53I.js → chunk-HVMVKTGG.js} +2 -2
- package/dist/{chunk-LWAUIGDD.js → chunk-JLBRCZBF.js} +2 -2
- package/dist/{chunk-AVS7JT4Z.mjs → chunk-L2EA5E7P.mjs} +2 -2
- package/dist/chunk-MLBWBY57.js +2577 -0
- package/dist/chunk-YAMG4CQQ.mjs +2577 -0
- package/dist/config.js +1 -1
- package/dist/config.mjs +1 -1
- package/dist/connector.js +3 -3
- package/dist/connector.mjs +2 -2
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/main.d.mts +1 -1
- package/dist/main.d.ts +1 -1
- package/dist/main.js +5 -5
- package/dist/main.mjs +4 -4
- package/dist/strategies/qr-code/index.js +4 -4
- package/dist/strategies/qr-code/index.mjs +3 -3
- package/dist/strategies/qr-code/qr-code.config.js +3 -3
- package/dist/strategies/qr-code/qr-code.config.mjs +2 -2
- package/dist/strategies/qr-code/qr-code.js +4 -4
- package/dist/strategies/qr-code/qr-code.mjs +3 -3
- package/dist/types.d.mts +114 -19
- package/dist/types.d.ts +114 -19
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-25UUG7ZP.mjs +0 -506
- package/dist/chunk-7P6ASYW6.mjs +0 -9
- package/dist/chunk-IRBR4FPV.js +0 -506
- package/dist/chunk-MLKGABMK.js +0 -9
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
type AllowMethodsAllDto = {
|
|
2
|
+
anyMethod: boolean;
|
|
3
|
+
};
|
|
4
|
+
|
|
5
|
+
type AllowMethodsAllParams = {
|
|
6
|
+
anyMethod: boolean;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type AllowMethodsSelectDto = {
|
|
10
|
+
anyMethod: boolean;
|
|
11
|
+
methodNames: Array<string>;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type AllowMethodsSelectParams = {
|
|
15
|
+
anyMethod: boolean;
|
|
16
|
+
methodNames: Array<string>;
|
|
17
|
+
};
|
|
18
|
+
|
|
1
19
|
type ConnectorActionDto = {
|
|
2
20
|
type: string;
|
|
3
21
|
params?: Record<string, any>;
|
|
@@ -8,8 +26,18 @@ type ConnectorActionRequest = {
|
|
|
8
26
|
params?: Array<Record<string, any>>;
|
|
9
27
|
};
|
|
10
28
|
|
|
29
|
+
type ConnectorDelegateActionDto = {
|
|
30
|
+
receiverId: string;
|
|
31
|
+
actions: Array<ConnectorActionDto>;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
type ConnectorDelegateActionRequest = {
|
|
35
|
+
receiverId: string;
|
|
36
|
+
actions: Array<ConnectorActionRequest>;
|
|
37
|
+
};
|
|
38
|
+
|
|
11
39
|
type ConnectorRequestDto = {
|
|
12
|
-
method: 'signIn' | 'signMessage' | 'signAndSendTransaction' | 'signAndSendTransactions';
|
|
40
|
+
method: 'signIn' | 'signMessage' | 'signAndSendTransaction' | 'signAndSendTransactions' | 'signDelegateActions';
|
|
13
41
|
status: 'pending' | 'approved' | 'rejected';
|
|
14
42
|
network: 'mainnet' | 'testnet';
|
|
15
43
|
id: string;
|
|
@@ -22,7 +50,7 @@ type ConnectorRequestDto = {
|
|
|
22
50
|
};
|
|
23
51
|
|
|
24
52
|
type ConnectorRequestRequest = {
|
|
25
|
-
method: 'signIn' | 'signMessage' | 'signAndSendTransaction' | 'signAndSendTransactions';
|
|
53
|
+
method: 'signIn' | 'signMessage' | 'signAndSendTransaction' | 'signAndSendTransactions' | 'signDelegateActions';
|
|
26
54
|
network: 'mainnet' | 'testnet';
|
|
27
55
|
origin: string;
|
|
28
56
|
payload?: Record<string, any>;
|
|
@@ -34,9 +62,9 @@ type ConnectorRequestResponseRequest = {
|
|
|
34
62
|
};
|
|
35
63
|
|
|
36
64
|
type ConnectorSignAndSendTransactionPayloadDto = {
|
|
37
|
-
actions: Array<ConnectorActionDto>;
|
|
38
65
|
signerId?: string;
|
|
39
66
|
receiverId: string;
|
|
67
|
+
actions: Array<ConnectorActionDto>;
|
|
40
68
|
};
|
|
41
69
|
|
|
42
70
|
type ConnectorSignAndSendTransactionPayloadRequest = {
|
|
@@ -51,13 +79,13 @@ type ConnectorTransactionDto = {
|
|
|
51
79
|
};
|
|
52
80
|
|
|
53
81
|
type ConnectorSignAndSendTransactionsPayloadDto = {
|
|
54
|
-
transactions: Array<ConnectorTransactionDto>;
|
|
55
82
|
signerId?: string;
|
|
83
|
+
transactions: Array<ConnectorTransactionDto>;
|
|
56
84
|
};
|
|
57
85
|
|
|
58
86
|
type ConnectorTransactionRequest = {
|
|
59
87
|
receiverId: string;
|
|
60
|
-
actions:
|
|
88
|
+
actions: ConnectorActionRequest;
|
|
61
89
|
};
|
|
62
90
|
|
|
63
91
|
type ConnectorSignAndSendTransactionsPayloadRequest = {
|
|
@@ -65,32 +93,79 @@ type ConnectorSignAndSendTransactionsPayloadRequest = {
|
|
|
65
93
|
transactions: Array<ConnectorTransactionRequest>;
|
|
66
94
|
};
|
|
67
95
|
|
|
68
|
-
type
|
|
69
|
-
|
|
96
|
+
type ConnectorSignDelegateActionsPayloadDto = {
|
|
97
|
+
signerId?: string;
|
|
98
|
+
delegateActions: Array<ConnectorDelegateActionDto>;
|
|
70
99
|
};
|
|
71
100
|
|
|
72
|
-
type
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
type ConnectorSignDelegateActionsPayloadRequest = {
|
|
102
|
+
signerId?: string;
|
|
103
|
+
delegateActions: Array<ConnectorDelegateActionRequest>;
|
|
75
104
|
};
|
|
76
105
|
|
|
77
|
-
type
|
|
78
|
-
|
|
106
|
+
type GasAllowanceLimitedDto = {
|
|
107
|
+
kind: string;
|
|
108
|
+
amount: string;
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
type GasAllowanceUnlimitedDto = {
|
|
112
|
+
kind: string;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
type ConnectorSignInAddFunctionCallKeyDto = {
|
|
116
|
+
contractId: string;
|
|
79
117
|
publicKey: string;
|
|
118
|
+
allowMethods: (AllowMethodsAllDto | AllowMethodsSelectDto);
|
|
119
|
+
gasAllowance?: (GasAllowanceUnlimitedDto | GasAllowanceLimitedDto);
|
|
80
120
|
};
|
|
81
121
|
|
|
82
|
-
type
|
|
83
|
-
|
|
122
|
+
type GasAllowanceLimitedParams = {
|
|
123
|
+
kind: string;
|
|
124
|
+
amount: string;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
type GasAllowanceUnlimitedParams = {
|
|
128
|
+
kind: string;
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
type ConnectorSignInAddFunctionCallKeyParams = {
|
|
132
|
+
contractId: string;
|
|
133
|
+
publicKey: string;
|
|
134
|
+
allowMethods: (AllowMethodsAllParams | AllowMethodsSelectParams);
|
|
135
|
+
gasAllowance?: (GasAllowanceUnlimitedParams | GasAllowanceLimitedParams);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
type ConnectorSignInAndSignMessageDto = {
|
|
84
139
|
message: string;
|
|
85
140
|
recipient: string;
|
|
86
|
-
|
|
141
|
+
nonce: Array<number>;
|
|
87
142
|
};
|
|
88
143
|
|
|
89
|
-
type
|
|
144
|
+
type ConnectorSignInAndSignMessageParams = {
|
|
90
145
|
message: string;
|
|
91
146
|
recipient: string;
|
|
92
|
-
nonce: Array<
|
|
93
|
-
|
|
147
|
+
nonce: Array<number>;
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
type ConnectorSignInResponseDto = {
|
|
151
|
+
accountId: string;
|
|
152
|
+
publicKey: string;
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
type ConnectorSignInWithKeyPayloadDto = {
|
|
156
|
+
addFunctionCallKey: ConnectorSignInAddFunctionCallKeyDto;
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
type ConnectorSignInWithKeyPayloadRequest = {
|
|
160
|
+
addFunctionCallKey: ConnectorSignInAddFunctionCallKeyParams;
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
type ConnectorSignInWithMessagePayloadDto = {
|
|
164
|
+
messageParams: ConnectorSignInAndSignMessageDto;
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
type ConnectorSignInWithMessagePayloadRequest = {
|
|
168
|
+
messageParams: ConnectorSignInAndSignMessageParams;
|
|
94
169
|
};
|
|
95
170
|
|
|
96
171
|
type ConnectorSignMessageResponseDto = {
|
|
@@ -99,6 +174,26 @@ type ConnectorSignMessageResponseDto = {
|
|
|
99
174
|
signature: string;
|
|
100
175
|
};
|
|
101
176
|
|
|
177
|
+
type ConnectorSignInWithMessageResponseDto = {
|
|
178
|
+
accountId: string;
|
|
179
|
+
publicKey: string;
|
|
180
|
+
signedMessage: ConnectorSignMessageResponseDto;
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
type ConnectorSignMessagePayloadDto = {
|
|
184
|
+
message: string;
|
|
185
|
+
recipient: string;
|
|
186
|
+
nonce: Array<number>;
|
|
187
|
+
signerId?: string;
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
type ConnectorSignMessagePayloadRequest = {
|
|
191
|
+
message: string;
|
|
192
|
+
recipient: string;
|
|
193
|
+
nonce: Array<number>;
|
|
194
|
+
signerId?: string;
|
|
195
|
+
};
|
|
196
|
+
|
|
102
197
|
type Polling<R> = Promise<R> & {
|
|
103
198
|
abort(): void;
|
|
104
199
|
};
|
|
@@ -108,4 +203,4 @@ type PollingOptions = {
|
|
|
108
203
|
timeout?: number;
|
|
109
204
|
};
|
|
110
205
|
|
|
111
|
-
export type { ConnectorRequestDto, ConnectorRequestRequest, ConnectorRequestResponseRequest, ConnectorSignAndSendTransactionPayloadDto, ConnectorSignAndSendTransactionPayloadRequest, ConnectorSignAndSendTransactionsPayloadDto, ConnectorSignAndSendTransactionsPayloadRequest,
|
|
206
|
+
export type { AllowMethodsAllDto, AllowMethodsAllParams, AllowMethodsSelectDto, AllowMethodsSelectParams, ConnectorActionDto, ConnectorActionRequest, ConnectorDelegateActionDto, ConnectorDelegateActionRequest, ConnectorRequestDto, ConnectorRequestRequest, ConnectorRequestResponseRequest, ConnectorSignAndSendTransactionPayloadDto, ConnectorSignAndSendTransactionPayloadRequest, ConnectorSignAndSendTransactionsPayloadDto, ConnectorSignAndSendTransactionsPayloadRequest, ConnectorSignDelegateActionsPayloadDto, ConnectorSignDelegateActionsPayloadRequest, ConnectorSignInAddFunctionCallKeyDto, ConnectorSignInAddFunctionCallKeyParams, ConnectorSignInAndSignMessageDto, ConnectorSignInAndSignMessageParams, ConnectorSignInResponseDto, ConnectorSignInWithKeyPayloadDto, ConnectorSignInWithKeyPayloadRequest, ConnectorSignInWithMessagePayloadDto, ConnectorSignInWithMessagePayloadRequest, ConnectorSignInWithMessageResponseDto, ConnectorSignMessagePayloadDto, ConnectorSignMessagePayloadRequest, ConnectorSignMessageResponseDto, ConnectorTransactionDto, ConnectorTransactionRequest, GasAllowanceLimitedDto, GasAllowanceLimitedParams, GasAllowanceUnlimitedDto, GasAllowanceUnlimitedParams, Polling, PollingOptions };
|
package/dist/utils.js
CHANGED
package/dist/utils.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@near-mobile/connector",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Public client for the Near Mobile Connector: create requests, poll for responses, build deep-link URLs, and generate QR codes for wallet connections.",
|
|
5
5
|
"author": "Peersyst",
|
|
6
6
|
"license": "MIT",
|