From 024fd12116b0a2355e8c2308c01aa504c5f1185b Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 9 May 2024 10:57:32 +0000 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'package.js?= =?UTF-8?q?on'=20with=20remote=20'package.json'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a93b11d..5a9c0e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@circle-fin/w3s-pw-web-sdk", - "version": "1.0.9", + "version": "1.0.13", "description": "Javascript/Typescript SDK for Circle Programmable Wallets", "main": "dist/index.js", "types": "dist/index.d.ts", From 57c8a7fba5a3ef228c6a4c70072aec891e688c9a Mon Sep 17 00:00:00 2001 From: undefined Date: Thu, 9 May 2024 10:57:33 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20synced=20local=20'src/'=20wi?= =?UTF-8?q?th=20remote=20'src/'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.ts | 15 +++++++++++++++ src/types.ts | 37 ++++++++++++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 3a6bcce..4db745f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -18,6 +18,7 @@ import type { Challenge, ChallengeCompleteCallback, CustomLinks, + DeviceInfo, Localizations, PostMessageEvent, Resources, @@ -26,6 +27,8 @@ import type { ThemeColor, } from './types' +const packageInfo = require('../package.json') as { version: string } + export class W3SSdk { private readonly serviceUrl = 'https://pw-auth.circle.com' private static instance: W3SSdk | null = null @@ -42,6 +45,7 @@ export class W3SSdk { private resources?: Resources private customLinks?: CustomLinks private ssoSettings?: SsoSettings + private deviceInfo?: DeviceInfo /** * Callback function that is called when the challenge is completed. */ @@ -62,13 +66,23 @@ export class W3SSdk { private rejectDeviceIdPromise?: (reason: string) => void constructor() { + const version = packageInfo.version + if (W3SSdk.instance != null) { this.iframe = W3SSdk.instance.iframe + this.deviceInfo = { + model: 'Web', + version, + } return W3SSdk.instance } this.iframe = document.createElement('iframe') + this.deviceInfo = { + model: 'Web', + version, + } W3SSdk.instance = this } @@ -309,6 +323,7 @@ export class W3SSdk { customLinks: this.customLinks, ssoSettings: this.ssoSettings, }, + deviceInfo: this.deviceInfo, }, }, this.serviceUrl diff --git a/src/types.ts b/src/types.ts index ac64625..76ae502 100644 --- a/src/types.ts +++ b/src/types.ts @@ -126,12 +126,15 @@ export enum ErrorCode { biometricsUserLockoutPermanent = 155714, biometricsUserNotAllowPermission = 155715, biometricsInternalError = 155716, - invalidUserSecret= 155718, walletIdNotFound = 156001, tokenIdNotFound = 156002, transactionIdNotFound = 156003, entityCredentialNotFound = 156004, walletSetIdNotFound = 156005, + + userSecretMissing = 155717, + invalidUserSecret = 155718, + userTokenMismatch = 155719, } // Settings and Authentication @@ -165,6 +168,18 @@ export interface Challenge { userSecret?: string } +// Device Information +export interface DeviceInfo { + /** + * SDK type. + */ + model: string + /** + * SDK version. + */ + version: string +} + /** * Base challenge result interface. Holds the challenge type and status. */ @@ -216,6 +231,18 @@ export interface SignTransactionResult extends ChallengeResult { * Signed transaction. */ signedTransaction: string + /** + * The `v` field of the elliptic curve signature. It is used to calculate the public key. + */ + v?: string + /** + * The `r` field of the elliptic curve signature. It is part of the actual signature along with the `s` field. + */ + r?: string + /** + * The `s` field of the elliptic curve signature. It is part of the actual signature along with the `r` field. + */ + s?: string } } @@ -408,6 +435,14 @@ export interface ThemeColor { * Fill color for inputted pincode input dot, e.g. '#0000ff' or 'blue'. */ pinDotActivated?: string + /** + * Text color for entered pincode input, e.g. `'#000000'` or `'black'`. + */ + enteredPinText?: string + /** + * Text color for text input, e.g. '#000000' or 'black'. + */ + inputText?: string /** * Outline color for text input on focused, e.g. '#0000ff' or 'blue'. */