@wharfkit/transact-plugin-resource-provider 0.3.0-ui-5 → 0.3.0-ui-16
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/README.md +53 -2
- package/lib/transact-plugin-resource-provider.d.ts +44 -5
- package/lib/transact-plugin-resource-provider.js +168 -80
- package/lib/transact-plugin-resource-provider.js.map +1 -1
- package/lib/transact-plugin-resource-provider.m.js +160 -63
- package/lib/transact-plugin-resource-provider.m.js.map +1 -1
- package/package.json +6 -4
- package/src/index.ts +157 -48
- package/src/translations.json +30 -0
- package/lib/resource-provider-plugin.d.ts +0 -84
- package/lib/resource-provider-plugin.js +0 -322
- package/lib/resource-provider-plugin.js.map +0 -1
- package/lib/resource-provider-plugin.m.js +0 -302
- package/lib/resource-provider-plugin.m.js.map +0 -1
- package/lib/resource-provider-plugin.umd.js +0 -303
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ A `transactPlugin` for use with the `@wharfkit/session` library that provides re
|
|
|
4
4
|
|
|
5
5
|
## Caveats
|
|
6
6
|
|
|
7
|
-
- Resource Provider API endpoint must conform to the Resource Provider API specification.
|
|
7
|
+
- Resource Provider API endpoint must conform to the [Resource Provider API specification](https://forums.eoscommunity.org/t/initial-specification-for-the-resource-provider-api-endpoint/1546).
|
|
8
8
|
- To enable fees, the `allowFees` parameter must be specified and set to `true`.
|
|
9
9
|
- Any fees must be paid in the networks system token, deployed on the `eosio.token` account using the standard token contract.
|
|
10
10
|
|
|
@@ -20,7 +20,58 @@ npm install --save @wharfkit/transact-plugin-resource-provider
|
|
|
20
20
|
|
|
21
21
|
## Usage
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
Include when configuring the Session Kit:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'
|
|
27
|
+
|
|
28
|
+
const kit = new SessionKit({
|
|
29
|
+
// ... your other options
|
|
30
|
+
transactPlugins: [new TransactPluginResourceProvider()],
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Or when you are manually configuring a Session:
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'
|
|
38
|
+
|
|
39
|
+
const session = new Session({
|
|
40
|
+
// ... your other options
|
|
41
|
+
transactPlugins: [new TransactPluginResourceProvider()],
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The plugin is also capable of utilizing any API that conforms to the [Resource Provider API specification](https://forums.eoscommunity.org/t/initial-specification-for-the-resource-provider-api-endpoint/1546). To change the default endpoints, specify them in the constructor as a key/value pair using the chainId and URL.
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import {TransactPluginResourceProvider} from '@wharfkit/transact-plugin-resource-provider'
|
|
49
|
+
|
|
50
|
+
const session = new Session({
|
|
51
|
+
// ... your other options
|
|
52
|
+
transactPlugins: [
|
|
53
|
+
new TransactPluginResourceProvider({
|
|
54
|
+
endpoints: {
|
|
55
|
+
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d':
|
|
56
|
+
'https://jungle4.greymass.com',
|
|
57
|
+
},
|
|
58
|
+
}),
|
|
59
|
+
],
|
|
60
|
+
})
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
The full list of options that can be passed in during instantiation are defined in the `ResourceProviderOptions`:
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
interface ResourceProviderOptions {
|
|
67
|
+
// Defaults to true, determines whether or not the user will be prompted with fees.
|
|
68
|
+
allowFees?: boolean
|
|
69
|
+
// The API endpoints to request resources from.
|
|
70
|
+
endpoints?: Record<string, string>
|
|
71
|
+
// The maximum allowed fee, if a fee exists. Provides a sanity check against the API.
|
|
72
|
+
maxFee?: AssetType
|
|
73
|
+
}
|
|
74
|
+
```
|
|
24
75
|
|
|
25
76
|
## Developing
|
|
26
77
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @wharfkit/transact-plugin-resource-provider v0.3.0-ui-
|
|
2
|
+
* @wharfkit/transact-plugin-resource-provider v0.3.0-ui-16
|
|
3
3
|
* https://github.com/wharfkit/transact-plugin-resource-provider
|
|
4
4
|
*
|
|
5
5
|
* @license
|
|
@@ -37,7 +37,7 @@ import { Struct, Name, Asset, AbstractTransactPlugin, TransactContext, ChainDefi
|
|
|
37
37
|
|
|
38
38
|
interface ResourceProviderOptions {
|
|
39
39
|
allowFees?: boolean;
|
|
40
|
-
endpoints
|
|
40
|
+
endpoints?: Record<string, string>;
|
|
41
41
|
maxFee?: AssetType;
|
|
42
42
|
}
|
|
43
43
|
interface ResourceProviderResponseData {
|
|
@@ -61,11 +61,50 @@ declare class Transfer extends Struct {
|
|
|
61
61
|
quantity: Asset;
|
|
62
62
|
memo: string;
|
|
63
63
|
}
|
|
64
|
-
declare
|
|
64
|
+
declare const defaultOptions: {
|
|
65
|
+
endpoints: {
|
|
66
|
+
aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906: string;
|
|
67
|
+
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d': string;
|
|
68
|
+
'4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11': string;
|
|
69
|
+
'1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4': string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
declare class TransactPluginResourceProvider extends AbstractTransactPlugin {
|
|
73
|
+
id: string;
|
|
74
|
+
translations: {
|
|
75
|
+
ko: {
|
|
76
|
+
timeout: string;
|
|
77
|
+
"will-continue": string;
|
|
78
|
+
fee: {
|
|
79
|
+
title: string;
|
|
80
|
+
body: string;
|
|
81
|
+
cost: string;
|
|
82
|
+
};
|
|
83
|
+
rejected: {
|
|
84
|
+
"no-fees": string;
|
|
85
|
+
"original-modified": string;
|
|
86
|
+
"max-fee": string;
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
zh: {
|
|
90
|
+
timeout: string;
|
|
91
|
+
"will-continue": string;
|
|
92
|
+
fee: {
|
|
93
|
+
title: string;
|
|
94
|
+
body: string;
|
|
95
|
+
cost: string;
|
|
96
|
+
};
|
|
97
|
+
rejected: {
|
|
98
|
+
"no-fees": string;
|
|
99
|
+
"original-modified": string;
|
|
100
|
+
"max-fee": string;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
};
|
|
65
104
|
readonly allowFees: boolean;
|
|
66
105
|
readonly maxFee?: Asset;
|
|
67
106
|
readonly endpoints: Record<string, string>;
|
|
68
|
-
constructor(options
|
|
107
|
+
constructor(options?: ResourceProviderOptions);
|
|
69
108
|
register(context: TransactContext): void;
|
|
70
109
|
getEndpoint(chain: ChainDefinition): string;
|
|
71
110
|
request(request: SigningRequest, context: TransactContext): Promise<TransactHookResponse>;
|
|
@@ -81,4 +120,4 @@ declare class ResourceProviderPlugin extends AbstractTransactPlugin {
|
|
|
81
120
|
validateResponseData(response: Record<string, any>): Promise<void>;
|
|
82
121
|
}
|
|
83
122
|
|
|
84
|
-
export { Transfer,
|
|
123
|
+
export { TransactPluginResourceProvider, Transfer, defaultOptions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @wharfkit/transact-plugin-resource-provider v0.3.0-ui-
|
|
2
|
+
* @wharfkit/transact-plugin-resource-provider v0.3.0-ui-16
|
|
3
3
|
* https://github.com/wharfkit/transact-plugin-resource-provider
|
|
4
4
|
*
|
|
5
5
|
* @license
|
|
@@ -37,39 +37,41 @@
|
|
|
37
37
|
|
|
38
38
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
39
39
|
|
|
40
|
+
var tslib = require('tslib');
|
|
40
41
|
var session = require('@wharfkit/session');
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
var ko = {
|
|
44
|
+
timeout: "리소스 공급자의 제안이 만료되었습니다.",
|
|
45
|
+
"will-continue": "트랜잭션은 리소스 공급자 없이 계속됩니다.",
|
|
46
|
+
fee: {
|
|
47
|
+
title: "거래 수수료를 수락하시겠습니까?",
|
|
48
|
+
body: "계정에서 이 거래를 수행하려면 추가 리소스({{resource}})가 필요합니다. 이러한 리소스를 자동으로 구매하고 계속 진행하시겠습니까?",
|
|
49
|
+
cost: "{{resource}}의 비용"
|
|
50
|
+
},
|
|
51
|
+
rejected: {
|
|
52
|
+
"no-fees": "리소스 공급자가 이 트랜잭션을 유료로 처리하도록 제안했지만 수수료 기반 트랜잭션은 'allowFees = false'를 사용하는 구성에 의해 비활성화됩니다.",
|
|
53
|
+
"original-modified": "리소스 공급자가 반환한 원래 트랜잭션이 너무 많이 수정되었습니다. 리소스 공급자 없이 계속",
|
|
54
|
+
"max-fee": "리소스 공급자가 요청한 수수료가 비정상적으로 높아 거부되었습니다."
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
var zh = {
|
|
58
|
+
timeout: "来自资源提供程序的产品/服务已过期。",
|
|
59
|
+
"will-continue": "事务将在没有资源提供程序的情况下继续。",
|
|
60
|
+
fee: {
|
|
61
|
+
title: "接受交易费用?",
|
|
62
|
+
body: "您的账户需要其他资源 ({{resource}}) 才能执行此事务。是否要自动购买这些资源并继续?",
|
|
63
|
+
cost: "{{resource}} 的成本"
|
|
64
|
+
},
|
|
65
|
+
rejected: {
|
|
66
|
+
"no-fees": "资源提供程序提供付费支付此事务的费用,但使用“allowFee = false”的配置禁用了基于费用的事务。",
|
|
67
|
+
"original-modified": "资源提供程序返回的原始事务修改过多。在没有资源提供程序的情况下继续",
|
|
68
|
+
"max-fee": "资源提供商请求的费用异常高,已被拒绝。"
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var defaultTranslations = {
|
|
72
|
+
ko: ko,
|
|
73
|
+
zh: zh
|
|
74
|
+
};
|
|
73
75
|
|
|
74
76
|
function hasOriginalActions(original, modified) {
|
|
75
77
|
return original.actions.every((originalAction) => {
|
|
@@ -114,47 +116,69 @@ function getNewActions(original, modified) {
|
|
|
114
116
|
|
|
115
117
|
exports.Transfer = class Transfer extends session.Struct {
|
|
116
118
|
};
|
|
117
|
-
__decorate([
|
|
119
|
+
tslib.__decorate([
|
|
118
120
|
session.Struct.field(session.Name)
|
|
119
121
|
], exports.Transfer.prototype, "from", void 0);
|
|
120
|
-
__decorate([
|
|
122
|
+
tslib.__decorate([
|
|
121
123
|
session.Struct.field(session.Name)
|
|
122
124
|
], exports.Transfer.prototype, "to", void 0);
|
|
123
|
-
__decorate([
|
|
125
|
+
tslib.__decorate([
|
|
124
126
|
session.Struct.field(session.Asset)
|
|
125
127
|
], exports.Transfer.prototype, "quantity", void 0);
|
|
126
|
-
__decorate([
|
|
128
|
+
tslib.__decorate([
|
|
127
129
|
session.Struct.field('string')
|
|
128
130
|
], exports.Transfer.prototype, "memo", void 0);
|
|
129
|
-
exports.Transfer = __decorate([
|
|
131
|
+
exports.Transfer = tslib.__decorate([
|
|
130
132
|
session.Struct.type('transfer')
|
|
131
133
|
], exports.Transfer);
|
|
132
|
-
|
|
134
|
+
const defaultOptions = {
|
|
135
|
+
endpoints: {
|
|
136
|
+
aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906: 'https://eos.greymass.com',
|
|
137
|
+
'73e4385a2708e6d7048834fbc1079f2fabb17b3c125b146af438971e90716c4d': 'https://jungle4.greymass.com',
|
|
138
|
+
'4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11': 'https://telos.greymass.com',
|
|
139
|
+
'1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4': 'https://wax.greymass.com',
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
class TransactPluginResourceProvider extends session.AbstractTransactPlugin {
|
|
133
143
|
constructor(options) {
|
|
134
144
|
super();
|
|
135
|
-
this.
|
|
136
|
-
this.
|
|
137
|
-
|
|
138
|
-
this.endpoints =
|
|
139
|
-
if (
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
145
|
+
this.id = 'transact-plugin-resource-provider';
|
|
146
|
+
this.translations = defaultTranslations;
|
|
147
|
+
this.allowFees = true;
|
|
148
|
+
this.endpoints = defaultOptions.endpoints;
|
|
149
|
+
if (options) {
|
|
150
|
+
// Set the endpoints and chains available
|
|
151
|
+
if (options.endpoints) {
|
|
152
|
+
this.endpoints = options.endpoints;
|
|
153
|
+
}
|
|
154
|
+
if (typeof options.allowFees !== 'undefined') {
|
|
155
|
+
this.allowFees = options.allowFees;
|
|
156
|
+
}
|
|
157
|
+
if (typeof options.maxFee !== 'undefined') {
|
|
158
|
+
this.maxFee = session.Asset.from(options.maxFee);
|
|
159
|
+
}
|
|
160
|
+
// TODO: Allow contact/action combos to be passed in and checked against to ensure no rogue actions were appended.
|
|
161
|
+
// if (typeof options.allowActions !== 'undefined') {
|
|
162
|
+
// this.allowActions = options.allowActions.map((action) => Name.from(action))
|
|
163
|
+
// }
|
|
148
164
|
}
|
|
149
165
|
}
|
|
150
166
|
register(context) {
|
|
151
|
-
context.addHook(session.TransactHookTypes.beforeSign, (request, context) =>
|
|
167
|
+
context.addHook(session.TransactHookTypes.beforeSign, (request, context) => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
return this.request(request, context);
|
|
169
|
+
}));
|
|
152
170
|
}
|
|
153
171
|
getEndpoint(chain) {
|
|
154
172
|
return this.endpoints[String(chain.id)];
|
|
155
173
|
}
|
|
156
174
|
request(request, context) {
|
|
157
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
175
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
176
|
+
// Mock the translation function if no UI is available
|
|
177
|
+
let t = (key, options) => options.default;
|
|
178
|
+
if (context.ui) {
|
|
179
|
+
// Use the translate function if available
|
|
180
|
+
t = context.ui.getTranslate(this.id);
|
|
181
|
+
}
|
|
158
182
|
// Validate that this request is valid for the resource provider
|
|
159
183
|
this.validateRequest(request, context);
|
|
160
184
|
// Determine appropriate URL for this request
|
|
@@ -187,8 +211,14 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
187
211
|
if (requiresPayment) {
|
|
188
212
|
// If the resource provider offered transaction with a fee, but plugin doesn't allow fees, return the original transaction.
|
|
189
213
|
if (!this.allowFees) {
|
|
190
|
-
// TODO: Notify the script somehow of this, maybe we need an optional logger?
|
|
191
214
|
// Notify that a fee was required but not allowed via allowFees: false.
|
|
215
|
+
if (context.ui) {
|
|
216
|
+
context.ui.status(`${t('rejected.no-fees', {
|
|
217
|
+
default: 'A resource provider offered to cover this transaction for a fee, but fee-based transactions are disabled by the configuration using `allowFees = false`.',
|
|
218
|
+
})} ${t('will-continue', {
|
|
219
|
+
default: 'The transaction will continue without the resource provider.',
|
|
220
|
+
})}`);
|
|
221
|
+
}
|
|
192
222
|
return {
|
|
193
223
|
request,
|
|
194
224
|
};
|
|
@@ -199,8 +229,14 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
199
229
|
// Ensure the new transaction has an unmodified version of the original action(s)
|
|
200
230
|
const originalActionsIntact = hasOriginalActions(request.getRawTransaction(), modifiedTransaction);
|
|
201
231
|
if (!originalActionsIntact) {
|
|
202
|
-
// TODO: Notify the script somehow of this, maybe we need an optional logger?
|
|
203
232
|
// Notify that the original actions requested were modified somehow, and reject the modification.
|
|
233
|
+
if (context.ui) {
|
|
234
|
+
context.ui.status(`${t('rejected.original-modified', {
|
|
235
|
+
default: 'The original transaction returned by the resource provider has been modified too much. Continuing without the resource provider',
|
|
236
|
+
})} ${t('will-continue', {
|
|
237
|
+
default: 'The transaction will continue without the resource provider.',
|
|
238
|
+
})}`);
|
|
239
|
+
}
|
|
204
240
|
return {
|
|
205
241
|
request,
|
|
206
242
|
};
|
|
@@ -222,8 +258,14 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
222
258
|
// If the resource provider offered transaction with a fee, but the fee was higher than allowed, return the original transaction.
|
|
223
259
|
if (this.maxFee) {
|
|
224
260
|
if (addedFees.units > this.maxFee.units) {
|
|
225
|
-
// TODO: Notify the script somehow of this, maybe we need an optional logger?
|
|
226
261
|
// Notify that a fee was required but higher than allowed via maxFee.
|
|
262
|
+
if (context.ui) {
|
|
263
|
+
context.ui.status(`${t('rejected.max-fee', {
|
|
264
|
+
default: 'The fee requested by the resource provider is unusually high and has been rejected.',
|
|
265
|
+
})} ${t('will-continue', {
|
|
266
|
+
default: 'The transaction will continue without the resource provider.',
|
|
267
|
+
})}`);
|
|
268
|
+
}
|
|
227
269
|
return {
|
|
228
270
|
request,
|
|
229
271
|
};
|
|
@@ -231,31 +273,76 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
231
273
|
}
|
|
232
274
|
// Validate that the response is valid for the session.
|
|
233
275
|
yield this.validateResponseData(json);
|
|
234
|
-
// NYI: Interact with interface via context for fee based prompting
|
|
235
|
-
/* Psuedo-code for fee based prompting
|
|
236
|
-
|
|
237
|
-
if (response.status === 402) {
|
|
238
|
-
|
|
239
|
-
// Prompt for the fee acceptance
|
|
240
|
-
const promptResponse = context.userPrompt({
|
|
241
|
-
title: 'Transaction Fee Required',
|
|
242
|
-
message: `This transaction requires a fee of ${response.json.data.fee} EOS. Do you wish to accept this fee?`,
|
|
243
|
-
})
|
|
244
|
-
|
|
245
|
-
// If the user did not accept the fee, return the original request without modification.
|
|
246
|
-
if (!promptResponse) {
|
|
247
|
-
return {
|
|
248
|
-
request,
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
} */
|
|
252
276
|
// Create a new signing request based on the response to return to the session's transact flow.
|
|
253
277
|
const modified = yield this.createRequest(json, context);
|
|
278
|
+
if (context.ui && addedFees.value > 0) {
|
|
279
|
+
// Determine which resources are being covered by this fee
|
|
280
|
+
const resourceTypes = [];
|
|
281
|
+
if (json.data.costs) {
|
|
282
|
+
const { cpu, net, ram } = json.data.costs;
|
|
283
|
+
if (session.Asset.from(cpu).value > 0)
|
|
284
|
+
resourceTypes.push('CPU');
|
|
285
|
+
if (session.Asset.from(net).value > 0)
|
|
286
|
+
resourceTypes.push('NET');
|
|
287
|
+
if (session.Asset.from(ram).value > 0)
|
|
288
|
+
resourceTypes.push('RAM');
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
resourceTypes.push('Unknown');
|
|
292
|
+
}
|
|
293
|
+
// Initiate a new cancelable prompt to inform the user of the fee required
|
|
294
|
+
const prompt = context.ui.prompt({
|
|
295
|
+
title: t('fee.title', { default: 'Accept Transaction Fee?' }),
|
|
296
|
+
body: t('fee.body', {
|
|
297
|
+
default: 'Additional resources ({{resource}}) are required for your account to perform this transaction. Would you like to automatically purchase these resources and proceed?',
|
|
298
|
+
resource: String(resourceTypes.join('/')),
|
|
299
|
+
}),
|
|
300
|
+
elements: [
|
|
301
|
+
{
|
|
302
|
+
type: 'asset',
|
|
303
|
+
data: {
|
|
304
|
+
label: t('fee.cost', {
|
|
305
|
+
default: 'Cost of {{resource}}',
|
|
306
|
+
resource: String(resourceTypes.join('/')),
|
|
307
|
+
}),
|
|
308
|
+
value: addedFees,
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
type: 'accept',
|
|
313
|
+
},
|
|
314
|
+
],
|
|
315
|
+
});
|
|
316
|
+
// TODO: Set the timer to match the expiration of the transaction
|
|
317
|
+
const timer = setTimeout(() => {
|
|
318
|
+
prompt.cancel(t('timeout', { default: 'The offer from the resource provider has expired.' }));
|
|
319
|
+
}, 120000);
|
|
320
|
+
// Return the promise from the prompt
|
|
321
|
+
return prompt
|
|
322
|
+
.then(() => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
323
|
+
// Return the modified transaction and additional signatures
|
|
324
|
+
return new Promise((r) => r({
|
|
325
|
+
request: modified,
|
|
326
|
+
signatures: json.data.signatures.map((sig) => session.Signature.from(sig)),
|
|
327
|
+
}));
|
|
328
|
+
}))
|
|
329
|
+
.catch((e) => {
|
|
330
|
+
// Throw if what we caught was a cancelation
|
|
331
|
+
if (e instanceof session.Canceled) {
|
|
332
|
+
throw e;
|
|
333
|
+
}
|
|
334
|
+
// Otherwise if it wasn't a cancel, it was a reject, and continue without modification
|
|
335
|
+
return new Promise((r) => r({ request }));
|
|
336
|
+
})
|
|
337
|
+
.finally(() => {
|
|
338
|
+
clearTimeout(timer); // TODO: Remove this, it's just here for testing
|
|
339
|
+
});
|
|
340
|
+
}
|
|
254
341
|
// Return the modified transaction and additional signatures
|
|
255
|
-
return {
|
|
342
|
+
return new Promise((r) => r({
|
|
256
343
|
request: modified,
|
|
257
344
|
signatures: json.data.signatures.map((sig) => session.Signature.from(sig)),
|
|
258
|
-
};
|
|
345
|
+
}));
|
|
259
346
|
});
|
|
260
347
|
}
|
|
261
348
|
getModifiedTransaction(json) {
|
|
@@ -270,9 +357,9 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
270
357
|
throw new Error('Invalid request type provided by resource provider.');
|
|
271
358
|
}
|
|
272
359
|
createRequest(response, context) {
|
|
273
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
360
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
274
361
|
// Create a new signing request based on the response to return to the session's transact flow.
|
|
275
|
-
const request = yield
|
|
362
|
+
const request = yield context.createRequest(response.data.request[1]);
|
|
276
363
|
// Set the required fee onto the request itself for wallets to process.
|
|
277
364
|
if (response.code === 402 && response.data.fee) {
|
|
278
365
|
request.setInfoKey('txfee', session.Asset.from(response.data.fee));
|
|
@@ -301,7 +388,7 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
301
388
|
* Perform validation against the response to ensure it is valid for the session.
|
|
302
389
|
*/
|
|
303
390
|
validateResponseData(response) {
|
|
304
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
391
|
+
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
305
392
|
// If the data wasn't provided in the response, throw an error.
|
|
306
393
|
if (!response) {
|
|
307
394
|
throw new Error('Resource provider did not respond to the request.');
|
|
@@ -318,5 +405,6 @@ class ResourceProviderPlugin extends session.AbstractTransactPlugin {
|
|
|
318
405
|
}
|
|
319
406
|
}
|
|
320
407
|
|
|
321
|
-
exports
|
|
408
|
+
exports.TransactPluginResourceProvider = TransactPluginResourceProvider;
|
|
409
|
+
exports.defaultOptions = defaultOptions;
|
|
322
410
|
//# sourceMappingURL=transact-plugin-resource-provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transact-plugin-resource-provider.js","sources":["../node_modules/tslib/tslib.es6.js","../src/utils.ts","../src/index.ts"],"sourcesContent":["/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n",null,null],"names":["Transfer","Struct","Name","Asset","AbstractTransactPlugin","TransactHookTypes","Serializer","Signature","Transaction","SigningRequest"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAwCA;AACO,SAAS,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE;AAC1D,IAAI,IAAI,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,wBAAwB,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;AACjI,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU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AI,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;AAC3D,gBAAA,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;AACnE,aAAA;SACJ,CAAA,CAAA;AAAA,KAAA;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"transact-plugin-resource-provider.js","sources":["../src/utils.ts","../src/index.ts"],"sourcesContent":[null,null],"names":["Transfer","Struct","__decorate","Name","Asset","AbstractTransactPlugin","TransactHookTypes","__awaiter","Serializer","Signature","Canceled","Transaction"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEgB,SAAA,kBAAkB,CAAC,QAAqB,EAAE,QAAqB,EAAA;IAC3E,OAAO,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,cAAsB,KAAI;QACrD,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,cAAsB,KAAI;;AAEpD,YAAA,MAAM,8BAA8B,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,CAChE,cAAc,CAAC,OAAO,CACzB,CAAA;;AAED,YAAA,MAAM,6BAA6B,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;;AAErF,YAAA,MAAM,4BAA4B,GAC9B,cAAc,CAAC,aAAa,CAAC,MAAM,KAAK,cAAc,CAAC,aAAa,CAAC,MAAM;AAC3E,gBAAA,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAA;;AAEvF,YAAA,MAAM,yBAAyB,GAAG,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,CAAC,CAAA;;AAEjF,YAAA,QACI,8BAA8B;gBAC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