@triadxyz/poseidons-protocol 0.1.7 → 0.1.8
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.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export default class PoseidonsProtocolClient {
|
|
|
36
36
|
* Get User
|
|
37
37
|
* @returns The User
|
|
38
38
|
*/
|
|
39
|
-
getUser(): Promise<import("./types").User>;
|
|
39
|
+
getUser(authority: PublicKey): Promise<import("./types").User>;
|
|
40
40
|
/**
|
|
41
41
|
* Add Poseidon vault rewards
|
|
42
42
|
* @returns The transaction signature or versioned transaction
|
package/dist/index.js
CHANGED
|
@@ -87,9 +87,9 @@ class PoseidonsProtocolClient {
|
|
|
87
87
|
* Get User
|
|
88
88
|
* @returns The User
|
|
89
89
|
*/
|
|
90
|
-
getUser() {
|
|
90
|
+
getUser(authority) {
|
|
91
91
|
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
-
const userPDA = (0, pda_1.getUserPDA)(
|
|
92
|
+
const userPDA = (0, pda_1.getUserPDA)(authority);
|
|
93
93
|
const user = yield this.program.account.user.fetch(userPDA);
|
|
94
94
|
return (0, helpers_1.formatUser)(user, userPDA);
|
|
95
95
|
});
|
|
@@ -787,6 +787,10 @@
|
|
|
787
787
|
"name": "ChestCreatedEvent",
|
|
788
788
|
"discriminator": [27, 178, 135, 161, 240, 189, 246, 238]
|
|
789
789
|
},
|
|
790
|
+
{
|
|
791
|
+
"name": "ChestEvent",
|
|
792
|
+
"discriminator": [11, 104, 65, 65, 185, 174, 170, 126]
|
|
793
|
+
},
|
|
790
794
|
{
|
|
791
795
|
"name": "ChestFinishedEvent",
|
|
792
796
|
"discriminator": [131, 41, 197, 21, 81, 13, 105, 118]
|
|
@@ -1087,6 +1091,79 @@
|
|
|
1087
1091
|
]
|
|
1088
1092
|
}
|
|
1089
1093
|
},
|
|
1094
|
+
{
|
|
1095
|
+
"name": "ChestEvent",
|
|
1096
|
+
"type": {
|
|
1097
|
+
"kind": "struct",
|
|
1098
|
+
"fields": [
|
|
1099
|
+
{
|
|
1100
|
+
"name": "authority",
|
|
1101
|
+
"type": "pubkey"
|
|
1102
|
+
},
|
|
1103
|
+
{
|
|
1104
|
+
"name": "id",
|
|
1105
|
+
"type": "u64"
|
|
1106
|
+
},
|
|
1107
|
+
{
|
|
1108
|
+
"name": "amount",
|
|
1109
|
+
"type": "u64"
|
|
1110
|
+
},
|
|
1111
|
+
{
|
|
1112
|
+
"name": "coins",
|
|
1113
|
+
"type": "u64"
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"name": "timer",
|
|
1117
|
+
"type": "i64"
|
|
1118
|
+
},
|
|
1119
|
+
{
|
|
1120
|
+
"name": "price",
|
|
1121
|
+
"type": "u64"
|
|
1122
|
+
},
|
|
1123
|
+
{
|
|
1124
|
+
"name": "is_finished",
|
|
1125
|
+
"type": "bool"
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
"name": "last_user",
|
|
1129
|
+
"type": "pubkey"
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
"name": "grand_winner",
|
|
1133
|
+
"type": {
|
|
1134
|
+
"defined": {
|
|
1135
|
+
"name": "ChestWinner"
|
|
1136
|
+
}
|
|
1137
|
+
}
|
|
1138
|
+
},
|
|
1139
|
+
{
|
|
1140
|
+
"name": "top_10",
|
|
1141
|
+
"type": {
|
|
1142
|
+
"array": [
|
|
1143
|
+
{
|
|
1144
|
+
"defined": {
|
|
1145
|
+
"name": "ChestWinner"
|
|
1146
|
+
}
|
|
1147
|
+
},
|
|
1148
|
+
10
|
|
1149
|
+
]
|
|
1150
|
+
}
|
|
1151
|
+
},
|
|
1152
|
+
{
|
|
1153
|
+
"name": "is_paid",
|
|
1154
|
+
"type": "bool"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
"name": "created_at",
|
|
1158
|
+
"type": "i64"
|
|
1159
|
+
},
|
|
1160
|
+
{
|
|
1161
|
+
"name": "finished_at",
|
|
1162
|
+
"type": "i64"
|
|
1163
|
+
}
|
|
1164
|
+
]
|
|
1165
|
+
}
|
|
1166
|
+
},
|
|
1090
1167
|
{
|
|
1091
1168
|
"name": "ChestFinishedEvent",
|
|
1092
1169
|
"type": {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1078,6 +1078,10 @@ export type PoseidonsProtocol = {
|
|
|
1078
1078
|
name: 'chestCreatedEvent';
|
|
1079
1079
|
discriminator: [27, 178, 135, 161, 240, 189, 246, 238];
|
|
1080
1080
|
},
|
|
1081
|
+
{
|
|
1082
|
+
name: 'chestEvent';
|
|
1083
|
+
discriminator: [11, 104, 65, 65, 185, 174, 170, 126];
|
|
1084
|
+
},
|
|
1081
1085
|
{
|
|
1082
1086
|
name: 'chestFinishedEvent';
|
|
1083
1087
|
discriminator: [131, 41, 197, 21, 81, 13, 105, 118];
|
|
@@ -1378,6 +1382,79 @@ export type PoseidonsProtocol = {
|
|
|
1378
1382
|
];
|
|
1379
1383
|
};
|
|
1380
1384
|
},
|
|
1385
|
+
{
|
|
1386
|
+
name: 'chestEvent';
|
|
1387
|
+
type: {
|
|
1388
|
+
kind: 'struct';
|
|
1389
|
+
fields: [
|
|
1390
|
+
{
|
|
1391
|
+
name: 'authority';
|
|
1392
|
+
type: 'pubkey';
|
|
1393
|
+
},
|
|
1394
|
+
{
|
|
1395
|
+
name: 'id';
|
|
1396
|
+
type: 'u64';
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: 'amount';
|
|
1400
|
+
type: 'u64';
|
|
1401
|
+
},
|
|
1402
|
+
{
|
|
1403
|
+
name: 'coins';
|
|
1404
|
+
type: 'u64';
|
|
1405
|
+
},
|
|
1406
|
+
{
|
|
1407
|
+
name: 'timer';
|
|
1408
|
+
type: 'i64';
|
|
1409
|
+
},
|
|
1410
|
+
{
|
|
1411
|
+
name: 'price';
|
|
1412
|
+
type: 'u64';
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
name: 'isFinished';
|
|
1416
|
+
type: 'bool';
|
|
1417
|
+
},
|
|
1418
|
+
{
|
|
1419
|
+
name: 'lastUser';
|
|
1420
|
+
type: 'pubkey';
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
name: 'grandWinner';
|
|
1424
|
+
type: {
|
|
1425
|
+
defined: {
|
|
1426
|
+
name: 'chestWinner';
|
|
1427
|
+
};
|
|
1428
|
+
};
|
|
1429
|
+
},
|
|
1430
|
+
{
|
|
1431
|
+
name: 'top10';
|
|
1432
|
+
type: {
|
|
1433
|
+
array: [
|
|
1434
|
+
{
|
|
1435
|
+
defined: {
|
|
1436
|
+
name: 'chestWinner';
|
|
1437
|
+
};
|
|
1438
|
+
},
|
|
1439
|
+
10
|
|
1440
|
+
];
|
|
1441
|
+
};
|
|
1442
|
+
},
|
|
1443
|
+
{
|
|
1444
|
+
name: 'isPaid';
|
|
1445
|
+
type: 'bool';
|
|
1446
|
+
},
|
|
1447
|
+
{
|
|
1448
|
+
name: 'createdAt';
|
|
1449
|
+
type: 'i64';
|
|
1450
|
+
},
|
|
1451
|
+
{
|
|
1452
|
+
name: 'finishedAt';
|
|
1453
|
+
type: 'i64';
|
|
1454
|
+
}
|
|
1455
|
+
];
|
|
1456
|
+
};
|
|
1457
|
+
},
|
|
1381
1458
|
{
|
|
1382
1459
|
name: 'chestFinishedEvent';
|
|
1383
1460
|
type: {
|
package/dist/utils/helpers.js
CHANGED
|
@@ -30,7 +30,8 @@ const formatUser = (account, address) => {
|
|
|
30
30
|
address: address.toString(),
|
|
31
31
|
authority: account.authority.toString(),
|
|
32
32
|
refer: account.refer.toString(),
|
|
33
|
-
createdAt: account.createdAt.toNumber()
|
|
33
|
+
createdAt: account.createdAt.toNumber(),
|
|
34
|
+
coins: account.coins.toNumber()
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
exports.formatUser = formatUser;
|