@credenza3/contracts-lib-sui 0.2.9 → 0.2.10
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/cjs/client/index.cjs +12 -1
- package/dist/cjs/client/index.cjs.map +2 -2
- package/dist/cjs/client/modules/CredenzaLedger/CredenzaMetaLedgerV2.d.ts +1 -0
- package/dist/esm/client/index.mjs +12 -1
- package/dist/esm/client/index.mjs.map +2 -2
- package/dist/esm/client/modules/CredenzaLedger/CredenzaMetaLedgerV2.d.ts +1 -0
- package/dist/umd/client/index.js +2 -2
- package/dist/umd/client/index.js.map +3 -3
- package/package.json +1 -1
|
@@ -4204,6 +4204,17 @@ var CredenzaMetaLedgerV2 = class extends CredenzaSuiModule {
|
|
|
4204
4204
|
);
|
|
4205
4205
|
return amount ? parseInt(amount) : 0;
|
|
4206
4206
|
}
|
|
4207
|
+
async getPointsPerEvent(userAddress, event) {
|
|
4208
|
+
const configId = await this.getLoyaltyConfig();
|
|
4209
|
+
const res = await this.client.getObjectGrpc(configId);
|
|
4210
|
+
const points_per_event = await this.client.graphqlClient.getDynamicFieldValue(
|
|
4211
|
+
res.json.points_per_event?.id,
|
|
4212
|
+
"address",
|
|
4213
|
+
userAddress
|
|
4214
|
+
);
|
|
4215
|
+
const amount = await this.client.graphqlClient.getDynamicFieldValue(points_per_event?.id, "string", event);
|
|
4216
|
+
return amount ? parseInt(amount) : 0;
|
|
4217
|
+
}
|
|
4207
4218
|
async getOwners() {
|
|
4208
4219
|
const configId = await this.getLoyaltyConfig();
|
|
4209
4220
|
const res = await this.client.getObjectGrpc(configId);
|
|
@@ -9119,7 +9130,7 @@ var SuiGraphqlClient = class {
|
|
|
9119
9130
|
async getDynamicFieldValue(parentAddress, fieldNameType, fieldNameValue) {
|
|
9120
9131
|
const variables = {
|
|
9121
9132
|
address: parentAddress,
|
|
9122
|
-
nameType: fieldNameType,
|
|
9133
|
+
nameType: fieldNameType === "string" ? "0x1::string::String" : fieldNameType,
|
|
9123
9134
|
nameBcs: toBcsBase64(fieldNameType, fieldNameValue)
|
|
9124
9135
|
};
|
|
9125
9136
|
const data = await this.client.request(GET_DYNAMIC_FIELD_QUERY, variables);
|