Skip to content

Commit

Permalink
feat: implement new Fuel Wallet Connector (#959)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio authored Nov 3, 2023
1 parent 53f9664 commit 1da4011
Show file tree
Hide file tree
Showing 24 changed files with 2,230 additions and 46 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"access": "public",
"baseBranch": "master",
"updateInternalDependencies": "patch",
"ignore": ["docs"],
"ignore": ["docs", "@fuel-wallet/sdk-v2", "@fuel-wallet/e2e-contract-tests"],
"snapshot": {
"useCalculatedVersion": true,
"prereleaseTemplate": "{tag}-{commit}"
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk-v2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Fuel Wallet SDK version 2.0

> This is a work in progress version of the new Fuel Wallet SDK. Please only use this version if you are actively looking to test it. This version is not compatible with the current versions of Fuel Wallet and Fuel Wallet Development.
25 changes: 25 additions & 0 deletions packages/sdk-v2/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { JestConfigWithTsJest } from 'ts-jest';
import { defaultsESM as tsjPreset } from 'ts-jest/presets';

import pkg from './package.json';

const config: JestConfigWithTsJest = {
displayName: pkg.name,
extensionsToTreatAsEsm: ['.ts', '.tsx'],
modulePathIgnorePatterns: ['dist'],
rootDir: __dirname,
transform: tsjPreset.transform,
setupFilesAfterEnv: ['./jest.setup.ts'],
clearMocks: true,
moduleFileExtensions: ['js', 'ts'],
testEnvironment: 'jsdom',
preset: 'ts-jest',
testMatch: ['./**/*.test.ts'],
testRunner: 'jest-circus/runner',
verbose: true,
globals: {
window: {},
},
};

export default config;
9 changes: 9 additions & 0 deletions packages/sdk-v2/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// This is needed bc of this error https://github.com/jestjs/jest/issues/2549
Object.defineProperty(Uint8Array, Symbol.hasInstance, {
value(potentialInstance: unknown) {
return this === Uint8Array
? Object.prototype.toString.call(potentialInstance) ===
'[object Uint8Array]'
: Uint8Array[Symbol.hasInstance].call(this, potentialInstance);
},
});
43 changes: 43 additions & 0 deletions packages/sdk-v2/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@fuel-wallet/sdk-v2",
"private": true,
"description": "Integrate DApps with Fuel Network compatible Wallets.",
"version": "0.13.5",
"license": "Apache-2.0",
"main": "src/index.ts",
"publishConfig": {
"access": "public",
"main": "dist/index.js",
"module": "dist/index.mjs",
"types": "dist/index.d.ts",
"typings": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"types": "./dist/index.d.ts",
"default": "./dist/index.mjs"
}
}
},
"files": [
"dist"
],
"scripts": {
"build": "pnpm ts:check && tsup",
"ts:check": "tsc --noEmit",
"test": "jest --verbose"
},
"dependencies": {
"@fuels/assets": "0.0.11",
"events": "^3.3.0"
},
"peerDependencies": {
"fuels": ">=0.63.0"
},
"devDependencies": {
"@fuel-ts/wallet": "0.63.0",
"fuels": "0.63.0",
"jest-environment-jsdom": "29.6.2",
"tsup": "^7.2.0"
}
}
Loading

0 comments on commit 1da4011

Please sign in to comment.