@novasamatech/host-papp 0.6.14 → 0.6.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.
@@ -1,4 +1,3 @@
1
- export declare const SS_UNSTABLE_STAGE_ENDPOINTS: string[];
2
1
  export declare const SS_STABLE_STAGE_ENDPOINTS: string[];
3
2
  export declare const SS_PREVIEW_STAGE_ENDPOINTS: string[];
4
3
  export declare const SS_PASEO_STABLE_STAGE_ENDPOINTS: string[];
package/dist/constants.js CHANGED
@@ -1,4 +1,3 @@
1
- export const SS_UNSTABLE_STAGE_ENDPOINTS = ['wss://pop-testnet.parity-lab.parity.io:443/9910'];
2
1
  export const SS_STABLE_STAGE_ENDPOINTS = ['wss://pop3-testnet.parity-lab.parity.io/people'];
3
2
  export const SS_PREVIEW_STAGE_ENDPOINTS = ['wss://previewnet.substrate.dev/people'];
4
3
  export const SS_PASEO_STABLE_STAGE_ENDPOINTS = ['wss://paseo-people-next-rpc.polkadot.io'];
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { SS_PASEO_STABLE_STAGE_ENDPOINTS, SS_PREVIEW_STAGE_ENDPOINTS, SS_STABLE_STAGE_ENDPOINTS, SS_UNSTABLE_STAGE_ENDPOINTS, } from './constants.js';
1
+ export { SS_PASEO_STABLE_STAGE_ENDPOINTS, SS_PREVIEW_STAGE_ENDPOINTS, SS_STABLE_STAGE_ENDPOINTS } from './constants.js';
2
2
  export type { PappAdapter } from './papp.js';
3
3
  export { createPappAdapter } from './papp.js';
4
4
  export type { HostMetadata } from './sso/auth/impl.js';
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { SS_PASEO_STABLE_STAGE_ENDPOINTS, SS_PREVIEW_STAGE_ENDPOINTS, SS_STABLE_STAGE_ENDPOINTS, SS_UNSTABLE_STAGE_ENDPOINTS, } from './constants.js';
1
+ export { SS_PASEO_STABLE_STAGE_ENDPOINTS, SS_PREVIEW_STAGE_ENDPOINTS, SS_STABLE_STAGE_ENDPOINTS } from './constants.js';
2
2
  export { createPappAdapter } from './papp.js';
@@ -43,7 +43,7 @@ export const createAttestationService = (lazyClient) => {
43
43
  const sudoCall = api.tx.Sudo.sudo({
44
44
  call: increaseAllowanceCall.decodedCall,
45
45
  });
46
- return withRetry(() => sudoCall.signAndSubmit(createPeopleSigner(verifier)).then(() => undefined));
46
+ return withRetry(() => sudoCall.signAndSubmit(createPeopleSigner(verifier), { at: 'best' }).then(() => undefined));
47
47
  }, toError);
48
48
  return verifierAllowance.andThen(verifierAllowance => (verifierAllowance > 0 ? okAsync() : getAllowance()));
49
49
  },
@@ -117,28 +117,23 @@ export const createAttestationService = (lazyClient) => {
117
117
  },
118
118
  });
119
119
  const submitAttestation = () => new Promise((resolve, reject) => {
120
- const subscription = attestCall.signSubmitAndWatch(createPeopleSigner(verifier)).subscribe({
121
- next(event) {
122
- if (event.type === 'finalized') {
123
- // Check if transaction was successful
124
- if (event.ok) {
125
- subscription.unsubscribe();
126
- resolve();
127
- }
128
- else {
129
- // Extract error details
130
- let errorMessage = 'Transaction failed';
131
- if (event.dispatchError?.type === 'Module') {
132
- const moduleError = event.dispatchError.value;
133
- errorMessage = `${moduleError.type}.${moduleError.value?.type || 'Unknown'}`;
134
- }
135
- subscription.unsubscribe();
136
- reject(errorMessage);
137
- }
120
+ attestCall
121
+ .signAndSubmit(createPeopleSigner(verifier), { at: 'best' })
122
+ .then(event => {
123
+ if (event.ok) {
124
+ resolve();
125
+ }
126
+ else {
127
+ // Extract error details
128
+ let errorMessage = 'Transaction failed';
129
+ if (event.dispatchError.type === 'Module') {
130
+ const moduleError = event.dispatchError.value;
131
+ errorMessage = `${moduleError.type}.${moduleError.value?.type || 'Unknown'}`;
138
132
  }
139
- },
140
- error: reject,
141
- });
133
+ reject(errorMessage);
134
+ }
135
+ })
136
+ .catch(error => reject(String(error)));
142
137
  });
143
138
  return fromPromise(withRetry(submitAttestation), toError).map(() => undefined);
144
139
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@novasamatech/host-papp",
3
3
  "type": "module",
4
- "version": "0.6.14",
4
+ "version": "0.6.16",
5
5
  "description": "Polkadot app integration",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -29,10 +29,10 @@
29
29
  "@noble/ciphers": "2.1.1",
30
30
  "@noble/curves": "2.0.1",
31
31
  "@noble/hashes": "2.0.1",
32
- "@novasamatech/host-api": "0.6.14",
33
- "@novasamatech/scale": "0.6.14",
34
- "@novasamatech/statement-store": "0.6.14",
35
- "@novasamatech/storage-adapter": "0.6.14",
32
+ "@novasamatech/host-api": "0.6.16",
33
+ "@novasamatech/scale": "0.6.16",
34
+ "@novasamatech/statement-store": "0.6.16",
35
+ "@novasamatech/storage-adapter": "0.6.16",
36
36
  "@polkadot-api/utils": "0.2.0",
37
37
  "@polkadot-api/substrate-bindings": "^0.17.0",
38
38
  "@polkadot-labs/hdkd-helpers": "^0.0.28",