Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔄 synced file(s) with circlefin/w3s-pw-web-sdk-internal #28

Merged
merged 4 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
- [SecurityIntros](#securityintros)
- [SecurityQuestions](#securityquestions)
- [SecuritySummary](#securitysummary)
- [SsoConfirm](#ssoconfirm)
- [SocialEmailConfirm](#socialemailconfirm)
- [TransactionRequest](#transactionrequest)
- [ContractInteraction](#contractinteraction)
- [SignatureRequest](#signaturerequest)
Expand Down Expand Up @@ -81,7 +81,7 @@ Holds localization settings.
- `securityIntros` [\<SecurityIntros | undefined>](#securityintros) The settings for `SecurityIntros` screen.
- `securityQuestions` [\<SecurityQuestions | undefined>](#securityquestions) The settings for `SecurityQuestions` screen.
- `securitySummary` [\<SecuritySummary | undefined>](#securitysummary) The settings for `SecuritySummary` screen.
- `ssoConfirm` [\<SsoConfirm | undefined>](#ssoconfirm) The settings for `SsoConfirm` screen.
- `socialEmailConfirm` [\<SocialEmailConfirm | undefined>](#socialemailconfirm) The settings for `SocialEmailConfirm` screen.

### Common

Expand Down Expand Up @@ -166,9 +166,9 @@ Holds localization settings for `SecuritySummary` screen.
- `title` [\<string | undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Title text
- `question` [\<string | undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Question text

### SsoConfirm
### SocialEmailConfirm

Holds localization settings for `SsoConfirm` screen.
Holds localization settings for `SocialEmailConfirm` screen.

- `title` [\<string | undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Title text
- `headline` [\<string | undefined>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Headline text
Expand Down
17 changes: 5 additions & 12 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,9 @@ enum enum ErrorCode {
insecurePinCode = 155704,
hintsMatchAnswers = 155705,
networkError = 155706,
biometricsSettingNotEnabled = 155708,
deviceNotSupportBiometrics = 155709,
biometricsKeyPermanentlyInvalidated = 155710,
biometricsUserSkip = 155711,
biometricsUserDisableForPin = 155712,
biometricsUserLockout = 155713,
biometricsUserLockoutPermanent = 155714,
biometricsUserNotAllowPermission = 155715,
biometricsInternalError = 155716,
invalidUserSecret= 155718,
userSecretMissing = 155717,
invalidUserTokenFormat= 155718,
userTokenMismatch = 155719,
walletIdNotFound = 156001,
tokenIdNotFound = 156002,
transactionIdNotFound = 156003,
Expand Down Expand Up @@ -271,8 +264,8 @@ Holds the OAuth information.

- `provider` [\<SocialLoginProvider>](#socialloginprovider) Social login
- `scope` [\<string[]>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) OAuth scope
- ssoUserUUID [\<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) SSO user UUID
- `ssoUserInfo` [\<object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#objects) SSO user information
- socialUserUUID [\<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Social login user UUID
- `socialUserInfo` [\<object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#objects) Social login user information
- email [\<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Email
- name [\<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Name
- phone [\<string>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures#string_type) Phone
Expand Down
5 changes: 4 additions & 1 deletion examples/js-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
"main": "index.js",
"license": "MIT",
"dependencies": {
"@circle-fin/w3s-pw-web-sdk": "^1.0.0",
"@circle-fin/w3s-pw-web-sdk": "^1.1.1",
"buffer": "^6.0.3",
"html-webpack-plugin": "^5.5.3",
"jquery": "^3.7.1",
"live-server": "^1.2.2",
"node-polyfill-webpack-plugin": "^4.0.0",
"process": "^0.11.10",
"webpack": "^5.89.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.1"
Expand Down
11 changes: 11 additions & 0 deletions examples/js-example/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')

module.exports = {
entry: './src/index.js',
Expand All @@ -16,7 +17,17 @@ module.exports = {
$: 'jquery',
jQuery: 'jquery',
}),
new NodePolyfillPlugin(),
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
})
],
resolve: {
alias: {
process: 'process/browser',
},
},
devServer: {
static: {
directory: path.join(__dirname, 'dist'),
Expand Down
30 changes: 30 additions & 0 deletions examples/react-example/config-overrides.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
const webpack = require('webpack')

module.exports = function override(config) {
const fallback = config.resolve.fallback || {}

Object.assign(fallback, {
buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'),
stream: require.resolve('stream-browserify'),
util: require.resolve('util/'),
vm: require.resolve('vm-browserify'),
'process/browser': require.resolve('process/browser'),
})

config.resolve.fallback = fallback
config.plugins = (config.plugins || []).concat([
new webpack.ProvidePlugin({
process: 'process/browser',
Buffer: ['buffer', 'Buffer'],
}),
])
config.module.rules.unshift({
test: /\.m?js$/,
resolve: {
fullySpecified: false,
},
})

return config
}
17 changes: 12 additions & 5 deletions examples/react-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,25 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@circle-fin/w3s-pw-web-sdk": "^1.0.0",
"@circle-fin/w3s-pw-web-sdk": "^1.1.1",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"process": "^0.11.10",
"react": "^18.3.1",
"react-app-rewired": "^2.2.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
"stream-browserify": "^3.0.0",
"util": "^0.12.5",
"vm-browserify": "^1.1.2",
"web-vitals": "^2.1.4"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand Down
5 changes: 4 additions & 1 deletion examples/vue-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"preview": "vite preview"
},
"dependencies": {
"@circle-fin/w3s-pw-web-sdk": "^1.0.0",
"@circle-fin/w3s-pw-web-sdk": "^1.1.1",
"buffer": "^6.0.3",
"process": "^0.11.10",
"vite-plugin-node-polyfills": "^0.22.0",
"vue": "^3.2.47"
},
"devDependencies": {
Expand Down
12 changes: 6 additions & 6 deletions examples/vue-example/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import vue from '@vitejs/plugin-vue'
import { fileURLToPath, URL } from 'node:url'

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { nodePolyfills } from 'vite-plugin-node-polyfills'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue()],
plugins: [nodePolyfills(), vue()],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url))
}
}
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
})
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@circle-fin/w3s-pw-web-sdk",
"version": "1.1.0",
"version": "1.1.2",
"description": "Javascript/Typescript SDK for Circle Programmable Wallets",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ describe('W3SSdk', () => {
expect(addEventListenerSpy).toHaveBeenCalledWith(
'message',
expect.any(Function),
false
false,
)
})

Expand Down Expand Up @@ -97,7 +97,7 @@ describe('W3SSdk', () => {
code: 1,
message: 'Some error',
} as Error,
undefined
undefined,
)
})
})
Loading
Loading