@avaprotocol/sdk-js 0.6.7 → 0.6.9
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/index.cjs +4 -20
- package/dist/index.d.cts +29 -34
- package/dist/index.d.ts +29 -34
- package/dist/index.js +4 -20
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -4115,23 +4115,6 @@ __export(src_exports, {
|
|
|
4115
4115
|
module.exports = __toCommonJS(src_exports);
|
|
4116
4116
|
var grpc2 = __toESM(require("@grpc/grpc-js"), 1);
|
|
4117
4117
|
|
|
4118
|
-
// src/config.ts
|
|
4119
|
-
var DEFAULT_JWT_EXPIRATION = 24 * 60 * 60;
|
|
4120
|
-
var configs = {
|
|
4121
|
-
development: {
|
|
4122
|
-
AVS_RPC_URL: process.env.AVS_RPC_URL || "localhost:2206"
|
|
4123
|
-
},
|
|
4124
|
-
staging: {
|
|
4125
|
-
AVS_RPC_URL: "aggregator-holesky.avaprotocol.org:2206"
|
|
4126
|
-
},
|
|
4127
|
-
production: {
|
|
4128
|
-
AVS_RPC_URL: "aggregator.avaprotocol.org:2206"
|
|
4129
|
-
}
|
|
4130
|
-
};
|
|
4131
|
-
function getRpcEndpoint(env) {
|
|
4132
|
-
return configs[env].AVS_RPC_URL;
|
|
4133
|
-
}
|
|
4134
|
-
|
|
4135
4118
|
// src/auth.ts
|
|
4136
4119
|
var getKeyRequestMessage = (address, expiredAt) => {
|
|
4137
4120
|
return `key request for ${address} expired at ${expiredAt}`;
|
|
@@ -4446,12 +4429,13 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
|
4446
4429
|
init_avs_pb();
|
|
4447
4430
|
var metadata = new grpc2.Metadata();
|
|
4448
4431
|
var BaseClient = class {
|
|
4432
|
+
// protected wallet?: any;
|
|
4449
4433
|
constructor(opts) {
|
|
4450
|
-
this.
|
|
4434
|
+
this.endpoint = opts.endpoint;
|
|
4451
4435
|
this.rpcClient = new AggregatorClient(
|
|
4452
|
-
|
|
4436
|
+
this.endpoint,
|
|
4453
4437
|
// TODO: switch to the TLS after we're able to update all the operator
|
|
4454
|
-
grpc2.
|
|
4438
|
+
grpc2.ChannelCredentials.createInsecure()
|
|
4455
4439
|
);
|
|
4456
4440
|
console.log("this.rpcClient:", this.rpcClient);
|
|
4457
4441
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -3,38 +3,6 @@ import * as jspb from 'google-protobuf';
|
|
|
3
3
|
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
4
4
|
import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
5
5
|
|
|
6
|
-
type Environment = "production" | "development" | "staging";
|
|
7
|
-
interface KeyExchangeResp {
|
|
8
|
-
key: string;
|
|
9
|
-
}
|
|
10
|
-
interface ClientOption {
|
|
11
|
-
privateKey?: string;
|
|
12
|
-
jwtApiKey?: string;
|
|
13
|
-
presignSignature?: string;
|
|
14
|
-
signatureExpiredAt?: number;
|
|
15
|
-
env?: Environment;
|
|
16
|
-
owner?: string;
|
|
17
|
-
}
|
|
18
|
-
interface TaskResp {
|
|
19
|
-
id: string;
|
|
20
|
-
status: string;
|
|
21
|
-
result?: any;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
interface TaskListResp {
|
|
25
|
-
tasks: TaskResp[];
|
|
26
|
-
}
|
|
27
|
-
interface SmartWalletResp {
|
|
28
|
-
address: string;
|
|
29
|
-
smart_account_address: string;
|
|
30
|
-
}
|
|
31
|
-
interface TransactionResp {
|
|
32
|
-
hash: string;
|
|
33
|
-
}
|
|
34
|
-
interface BalanceResp {
|
|
35
|
-
balance: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
6
|
declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
|
|
39
7
|
|
|
40
8
|
// package: aggregator
|
|
@@ -1487,11 +1455,38 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
|
|
|
1487
1455
|
): grpc.ClientUnaryCall;
|
|
1488
1456
|
}
|
|
1489
1457
|
|
|
1458
|
+
type Environment = "production" | "development" | "staging";
|
|
1459
|
+
interface KeyExchangeResp {
|
|
1460
|
+
key: string;
|
|
1461
|
+
}
|
|
1462
|
+
interface ClientOption {
|
|
1463
|
+
endpoint: string;
|
|
1464
|
+
jwtApiKey?: string;
|
|
1465
|
+
}
|
|
1466
|
+
interface TaskResp {
|
|
1467
|
+
id: string;
|
|
1468
|
+
status: string;
|
|
1469
|
+
result?: any;
|
|
1470
|
+
error?: string;
|
|
1471
|
+
}
|
|
1472
|
+
interface TaskListResp {
|
|
1473
|
+
tasks: TaskResp[];
|
|
1474
|
+
}
|
|
1475
|
+
interface SmartWalletResp {
|
|
1476
|
+
address: string;
|
|
1477
|
+
smart_account_address: string;
|
|
1478
|
+
}
|
|
1479
|
+
interface TransactionResp {
|
|
1480
|
+
hash: string;
|
|
1481
|
+
}
|
|
1482
|
+
interface BalanceResp {
|
|
1483
|
+
balance: string;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1490
1486
|
declare class BaseClient {
|
|
1491
|
-
readonly
|
|
1487
|
+
readonly endpoint: string;
|
|
1492
1488
|
readonly rpcClient: AggregatorClient;
|
|
1493
1489
|
protected authkey?: string;
|
|
1494
|
-
protected wallet?: any;
|
|
1495
1490
|
constructor(opts: ClientOption);
|
|
1496
1491
|
authWithSignature(address: string, signature: string, expiredAtEpoch: number): Promise<KeyExchangeResp>;
|
|
1497
1492
|
isAuthenticated(): boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,38 +3,6 @@ import * as jspb from 'google-protobuf';
|
|
|
3
3
|
import * as google_protobuf_timestamp_pb from 'google-protobuf/google/protobuf/timestamp_pb';
|
|
4
4
|
import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
|
|
5
5
|
|
|
6
|
-
type Environment = "production" | "development" | "staging";
|
|
7
|
-
interface KeyExchangeResp {
|
|
8
|
-
key: string;
|
|
9
|
-
}
|
|
10
|
-
interface ClientOption {
|
|
11
|
-
privateKey?: string;
|
|
12
|
-
jwtApiKey?: string;
|
|
13
|
-
presignSignature?: string;
|
|
14
|
-
signatureExpiredAt?: number;
|
|
15
|
-
env?: Environment;
|
|
16
|
-
owner?: string;
|
|
17
|
-
}
|
|
18
|
-
interface TaskResp {
|
|
19
|
-
id: string;
|
|
20
|
-
status: string;
|
|
21
|
-
result?: any;
|
|
22
|
-
error?: string;
|
|
23
|
-
}
|
|
24
|
-
interface TaskListResp {
|
|
25
|
-
tasks: TaskResp[];
|
|
26
|
-
}
|
|
27
|
-
interface SmartWalletResp {
|
|
28
|
-
address: string;
|
|
29
|
-
smart_account_address: string;
|
|
30
|
-
}
|
|
31
|
-
interface TransactionResp {
|
|
32
|
-
hash: string;
|
|
33
|
-
}
|
|
34
|
-
interface BalanceResp {
|
|
35
|
-
balance: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
6
|
declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
|
|
39
7
|
|
|
40
8
|
// package: aggregator
|
|
@@ -1487,11 +1455,38 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
|
|
|
1487
1455
|
): grpc.ClientUnaryCall;
|
|
1488
1456
|
}
|
|
1489
1457
|
|
|
1458
|
+
type Environment = "production" | "development" | "staging";
|
|
1459
|
+
interface KeyExchangeResp {
|
|
1460
|
+
key: string;
|
|
1461
|
+
}
|
|
1462
|
+
interface ClientOption {
|
|
1463
|
+
endpoint: string;
|
|
1464
|
+
jwtApiKey?: string;
|
|
1465
|
+
}
|
|
1466
|
+
interface TaskResp {
|
|
1467
|
+
id: string;
|
|
1468
|
+
status: string;
|
|
1469
|
+
result?: any;
|
|
1470
|
+
error?: string;
|
|
1471
|
+
}
|
|
1472
|
+
interface TaskListResp {
|
|
1473
|
+
tasks: TaskResp[];
|
|
1474
|
+
}
|
|
1475
|
+
interface SmartWalletResp {
|
|
1476
|
+
address: string;
|
|
1477
|
+
smart_account_address: string;
|
|
1478
|
+
}
|
|
1479
|
+
interface TransactionResp {
|
|
1480
|
+
hash: string;
|
|
1481
|
+
}
|
|
1482
|
+
interface BalanceResp {
|
|
1483
|
+
balance: string;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1490
1486
|
declare class BaseClient {
|
|
1491
|
-
readonly
|
|
1487
|
+
readonly endpoint: string;
|
|
1492
1488
|
readonly rpcClient: AggregatorClient;
|
|
1493
1489
|
protected authkey?: string;
|
|
1494
|
-
protected wallet?: any;
|
|
1495
1490
|
constructor(opts: ClientOption);
|
|
1496
1491
|
authWithSignature(address: string, signature: string, expiredAtEpoch: number): Promise<KeyExchangeResp>;
|
|
1497
1492
|
isAuthenticated(): boolean;
|
package/dist/index.js
CHANGED
|
@@ -4104,23 +4104,6 @@ var init_avs_pb = __esm({
|
|
|
4104
4104
|
// src/index.ts
|
|
4105
4105
|
import * as grpc2 from "@grpc/grpc-js";
|
|
4106
4106
|
|
|
4107
|
-
// src/config.ts
|
|
4108
|
-
var DEFAULT_JWT_EXPIRATION = 24 * 60 * 60;
|
|
4109
|
-
var configs = {
|
|
4110
|
-
development: {
|
|
4111
|
-
AVS_RPC_URL: process.env.AVS_RPC_URL || "localhost:2206"
|
|
4112
|
-
},
|
|
4113
|
-
staging: {
|
|
4114
|
-
AVS_RPC_URL: "aggregator-holesky.avaprotocol.org:2206"
|
|
4115
|
-
},
|
|
4116
|
-
production: {
|
|
4117
|
-
AVS_RPC_URL: "aggregator.avaprotocol.org:2206"
|
|
4118
|
-
}
|
|
4119
|
-
};
|
|
4120
|
-
function getRpcEndpoint(env) {
|
|
4121
|
-
return configs[env].AVS_RPC_URL;
|
|
4122
|
-
}
|
|
4123
|
-
|
|
4124
4107
|
// src/auth.ts
|
|
4125
4108
|
var getKeyRequestMessage = (address, expiredAt) => {
|
|
4126
4109
|
return `key request for ${address} expired at ${expiredAt}`;
|
|
@@ -4435,12 +4418,13 @@ var AggregatorClient = grpc.makeGenericClientConstructor(AggregatorService);
|
|
|
4435
4418
|
init_avs_pb();
|
|
4436
4419
|
var metadata = new grpc2.Metadata();
|
|
4437
4420
|
var BaseClient = class {
|
|
4421
|
+
// protected wallet?: any;
|
|
4438
4422
|
constructor(opts) {
|
|
4439
|
-
this.
|
|
4423
|
+
this.endpoint = opts.endpoint;
|
|
4440
4424
|
this.rpcClient = new AggregatorClient(
|
|
4441
|
-
|
|
4425
|
+
this.endpoint,
|
|
4442
4426
|
// TODO: switch to the TLS after we're able to update all the operator
|
|
4443
|
-
grpc2.
|
|
4427
|
+
grpc2.ChannelCredentials.createInsecure()
|
|
4444
4428
|
);
|
|
4445
4429
|
console.log("this.rpcClient:", this.rpcClient);
|
|
4446
4430
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol’s AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"module": "dist/index.
|
|
6
|
+
"module": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": [
|
|
9
9
|
"dist",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"exports": {
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
|
-
"import": "./dist/index.
|
|
16
|
+
"import": "./dist/index.js",
|
|
17
17
|
"require": "./dist/index.js"
|
|
18
18
|
}
|
|
19
19
|
},
|