@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.
@@ -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);