@openfort/openfort-js 0.7.23 → 0.7.25
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.
- package/README.md +1 -1
- package/dist/index.cjs +171 -59
- package/dist/index.js +171 -59
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -66,7 +66,7 @@ The Embedded Signer uses SSS to manage the private key on the client side. To le
|
|
|
66
66
|
- **Login and Configure the Embedded Signer**: First, ensure the user is logged in, using `LoginWithEmailPassword`, `AuthenticateWithOAuth` or if not registred `SignUpWithEmailPassword`. Then call `ConfigureEmbeddedSigner`.
|
|
67
67
|
```typescript
|
|
68
68
|
const shieldAuth: ShieldAuthentication = {
|
|
69
|
-
auth:
|
|
69
|
+
auth: ShieldAuthType.OPENFORT,
|
|
70
70
|
token: identityToken,
|
|
71
71
|
authProvider: "firebase",
|
|
72
72
|
tokenType: "idToken",
|
package/dist/index.cjs
CHANGED
|
@@ -3246,7 +3246,7 @@ class SDKConfiguration {
|
|
|
3246
3246
|
}
|
|
3247
3247
|
}
|
|
3248
3248
|
|
|
3249
|
-
const chain$
|
|
3249
|
+
const chain$o = {
|
|
3250
3250
|
chain: 'BSC',
|
|
3251
3251
|
chainId: 56,
|
|
3252
3252
|
explorers: [
|
|
@@ -3307,7 +3307,7 @@ const chain$m = {
|
|
|
3307
3307
|
testnet: false,
|
|
3308
3308
|
};
|
|
3309
3309
|
|
|
3310
|
-
const chain$
|
|
3310
|
+
const chain$n = {
|
|
3311
3311
|
chain: 'BSC',
|
|
3312
3312
|
chainId: 97,
|
|
3313
3313
|
explorers: [
|
|
@@ -3348,7 +3348,7 @@ const chain$l = {
|
|
|
3348
3348
|
testnet: true,
|
|
3349
3349
|
};
|
|
3350
3350
|
|
|
3351
|
-
const chain$
|
|
3351
|
+
const chain$m = {
|
|
3352
3352
|
name: 'Base',
|
|
3353
3353
|
chain: 'ETH',
|
|
3354
3354
|
rpc: [
|
|
@@ -3393,7 +3393,7 @@ const chain$k = {
|
|
|
3393
3393
|
slug: 'base',
|
|
3394
3394
|
};
|
|
3395
3395
|
|
|
3396
|
-
const chain$
|
|
3396
|
+
const chain$l = {
|
|
3397
3397
|
chain: 'ETH',
|
|
3398
3398
|
chainId: 84532,
|
|
3399
3399
|
explorers: [
|
|
@@ -3432,7 +3432,7 @@ const chain$j = {
|
|
|
3432
3432
|
testnet: true,
|
|
3433
3433
|
};
|
|
3434
3434
|
|
|
3435
|
-
const chain$
|
|
3435
|
+
const chain$k = {
|
|
3436
3436
|
name: 'Beam',
|
|
3437
3437
|
chainId: 4337,
|
|
3438
3438
|
chain: 'BEAM',
|
|
@@ -3455,7 +3455,7 @@ const chain$i = {
|
|
|
3455
3455
|
decimals: 18,
|
|
3456
3456
|
},
|
|
3457
3457
|
rpc: [
|
|
3458
|
-
'https://
|
|
3458
|
+
'https://build.onbeam.com/rpc',
|
|
3459
3459
|
],
|
|
3460
3460
|
faucets: ['https://faucet.onbeam.com'],
|
|
3461
3461
|
explorers: [
|
|
@@ -3469,7 +3469,7 @@ const chain$i = {
|
|
|
3469
3469
|
testnet: false,
|
|
3470
3470
|
};
|
|
3471
3471
|
|
|
3472
|
-
const chain$
|
|
3472
|
+
const chain$j = {
|
|
3473
3473
|
name: 'Beam Testnet',
|
|
3474
3474
|
chainId: 13337,
|
|
3475
3475
|
chain: 'BEAM',
|
|
@@ -3492,7 +3492,7 @@ const chain$h = {
|
|
|
3492
3492
|
decimals: 18,
|
|
3493
3493
|
},
|
|
3494
3494
|
rpc: [
|
|
3495
|
-
'https://
|
|
3495
|
+
'https://build.onbeam.com/rpc/testnet',
|
|
3496
3496
|
],
|
|
3497
3497
|
faucets: ['https://faucet.avax.network/?subnet=beam', 'https://faucet.onbeam.com'],
|
|
3498
3498
|
explorers: [
|
|
@@ -3506,7 +3506,7 @@ const chain$h = {
|
|
|
3506
3506
|
testnet: true,
|
|
3507
3507
|
};
|
|
3508
3508
|
|
|
3509
|
-
const chain$
|
|
3509
|
+
const chain$i = {
|
|
3510
3510
|
chain: 'AVAX',
|
|
3511
3511
|
chainId: 43113,
|
|
3512
3512
|
explorers: [
|
|
@@ -3542,7 +3542,7 @@ const chain$g = {
|
|
|
3542
3542
|
testnet: true,
|
|
3543
3543
|
};
|
|
3544
3544
|
|
|
3545
|
-
const chain$
|
|
3545
|
+
const chain$h = {
|
|
3546
3546
|
chain: 'AVAX',
|
|
3547
3547
|
chainId: 43114,
|
|
3548
3548
|
explorers: [
|
|
@@ -3583,7 +3583,7 @@ const chain$f = {
|
|
|
3583
3583
|
testnet: false,
|
|
3584
3584
|
};
|
|
3585
3585
|
|
|
3586
|
-
const chain$
|
|
3586
|
+
const chain$g = {
|
|
3587
3587
|
chain: 'ETH',
|
|
3588
3588
|
chainId: 11155111,
|
|
3589
3589
|
explorers: [
|
|
@@ -3629,7 +3629,7 @@ const chain$e = {
|
|
|
3629
3629
|
title: 'Ethereum Testnet Sepolia',
|
|
3630
3630
|
};
|
|
3631
3631
|
|
|
3632
|
-
const chain$
|
|
3632
|
+
const chain$f = {
|
|
3633
3633
|
chain: 'ETH',
|
|
3634
3634
|
chainId: 59140,
|
|
3635
3635
|
explorers: [
|
|
@@ -3691,7 +3691,7 @@ const chain$d = {
|
|
|
3691
3691
|
title: 'Linea Goerli Testnet',
|
|
3692
3692
|
};
|
|
3693
3693
|
|
|
3694
|
-
const chain$
|
|
3694
|
+
const chain$e = {
|
|
3695
3695
|
chain: 'GNO',
|
|
3696
3696
|
chainId: 10200,
|
|
3697
3697
|
explorers: [
|
|
@@ -3737,7 +3737,7 @@ const chain$c = {
|
|
|
3737
3737
|
testnet: true,
|
|
3738
3738
|
};
|
|
3739
3739
|
|
|
3740
|
-
const chain$
|
|
3740
|
+
const chain$d = {
|
|
3741
3741
|
chain: 'Immutable zkEVM',
|
|
3742
3742
|
chainId: 13371,
|
|
3743
3743
|
explorers: [
|
|
@@ -3778,7 +3778,7 @@ const chain$b = {
|
|
|
3778
3778
|
testnet: false,
|
|
3779
3779
|
};
|
|
3780
3780
|
|
|
3781
|
-
const chain$
|
|
3781
|
+
const chain$c = {
|
|
3782
3782
|
chain: 'ETH',
|
|
3783
3783
|
chainId: 421614,
|
|
3784
3784
|
explorers: [
|
|
@@ -3815,7 +3815,7 @@ const chain$a = {
|
|
|
3815
3815
|
title: 'Arbitrum Sepolia Rollup Testnet',
|
|
3816
3816
|
};
|
|
3817
3817
|
|
|
3818
|
-
const chain$
|
|
3818
|
+
const chain$b = {
|
|
3819
3819
|
chain: 'ETH',
|
|
3820
3820
|
chainId: 42161,
|
|
3821
3821
|
explorers: [
|
|
@@ -3877,7 +3877,7 @@ const chain$9 = {
|
|
|
3877
3877
|
testnet: false,
|
|
3878
3878
|
};
|
|
3879
3879
|
|
|
3880
|
-
const chain$
|
|
3880
|
+
const chain$a = {
|
|
3881
3881
|
chain: 'ETH',
|
|
3882
3882
|
chainId: 42170,
|
|
3883
3883
|
explorers: [
|
|
@@ -3932,7 +3932,7 @@ const chain$8 = {
|
|
|
3932
3932
|
testnet: false,
|
|
3933
3933
|
};
|
|
3934
3934
|
|
|
3935
|
-
const chain$
|
|
3935
|
+
const chain$9 = {
|
|
3936
3936
|
chain: 'Polygon',
|
|
3937
3937
|
chainId: 137,
|
|
3938
3938
|
explorers: [
|
|
@@ -3988,7 +3988,7 @@ const chain$7 = {
|
|
|
3988
3988
|
testnet: false,
|
|
3989
3989
|
};
|
|
3990
3990
|
|
|
3991
|
-
const chain$
|
|
3991
|
+
const chain$8 = {
|
|
3992
3992
|
chain: 'Polygon',
|
|
3993
3993
|
chainId: 80002,
|
|
3994
3994
|
explorers: [
|
|
@@ -4025,7 +4025,7 @@ const chain$6 = {
|
|
|
4025
4025
|
title: 'Polygon Amoy Testnet',
|
|
4026
4026
|
};
|
|
4027
4027
|
|
|
4028
|
-
const chain$
|
|
4028
|
+
const chain$7 = {
|
|
4029
4029
|
chain: 'Ancient8',
|
|
4030
4030
|
chainId: 28122024,
|
|
4031
4031
|
explorers: [
|
|
@@ -4057,7 +4057,7 @@ const chain$5 = {
|
|
|
4057
4057
|
testnet: true,
|
|
4058
4058
|
};
|
|
4059
4059
|
|
|
4060
|
-
const chain$
|
|
4060
|
+
const chain$6 = {
|
|
4061
4061
|
chain: 'Ancient8',
|
|
4062
4062
|
chainId: 888888888,
|
|
4063
4063
|
explorers: [
|
|
@@ -4088,7 +4088,7 @@ const chain$4 = {
|
|
|
4088
4088
|
testnet: false,
|
|
4089
4089
|
};
|
|
4090
4090
|
|
|
4091
|
-
const chain$
|
|
4091
|
+
const chain$5 = {
|
|
4092
4092
|
chain: 'ETH',
|
|
4093
4093
|
chainId: 999999999,
|
|
4094
4094
|
explorers: [
|
|
@@ -4120,7 +4120,7 @@ const chain$3 = {
|
|
|
4120
4120
|
testnet: true,
|
|
4121
4121
|
};
|
|
4122
4122
|
|
|
4123
|
-
const chain$
|
|
4123
|
+
const chain$4 = {
|
|
4124
4124
|
chain: 'ETH',
|
|
4125
4125
|
chainId: 7777777,
|
|
4126
4126
|
explorers: [
|
|
@@ -4153,7 +4153,7 @@ const chain$2 = {
|
|
|
4153
4153
|
testnet: false,
|
|
4154
4154
|
};
|
|
4155
4155
|
|
|
4156
|
-
const chain$
|
|
4156
|
+
const chain$3 = {
|
|
4157
4157
|
chain: 'Degen',
|
|
4158
4158
|
chainId: 666666666,
|
|
4159
4159
|
explorers: [],
|
|
@@ -4180,7 +4180,7 @@ const chain$1 = {
|
|
|
4180
4180
|
title: 'Degen Chain',
|
|
4181
4181
|
};
|
|
4182
4182
|
|
|
4183
|
-
const chain = {
|
|
4183
|
+
const chain$2 = {
|
|
4184
4184
|
chain: 'Immutable zkEVM',
|
|
4185
4185
|
chainId: 13473,
|
|
4186
4186
|
explorers: [
|
|
@@ -4222,53 +4222,161 @@ const chain = {
|
|
|
4222
4222
|
testnet: true,
|
|
4223
4223
|
};
|
|
4224
4224
|
|
|
4225
|
+
const chain$1 = {
|
|
4226
|
+
chain: 'ETH',
|
|
4227
|
+
chainId: 11155420,
|
|
4228
|
+
explorers: [
|
|
4229
|
+
{
|
|
4230
|
+
name: 'etherscan',
|
|
4231
|
+
url: 'https://sepolia-optimism.etherscan.io',
|
|
4232
|
+
standard: 'EIP3091',
|
|
4233
|
+
},
|
|
4234
|
+
{
|
|
4235
|
+
name: 'opscout',
|
|
4236
|
+
url: 'https://optimism-sepolia.blockscout.com',
|
|
4237
|
+
standard: 'EIP3091',
|
|
4238
|
+
icon: {
|
|
4239
|
+
url: 'ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM',
|
|
4240
|
+
width: 551,
|
|
4241
|
+
height: 540,
|
|
4242
|
+
format: 'png',
|
|
4243
|
+
},
|
|
4244
|
+
},
|
|
4245
|
+
],
|
|
4246
|
+
faucets: ['https://app.optimism.io/faucet'],
|
|
4247
|
+
features: [],
|
|
4248
|
+
icon: {
|
|
4249
|
+
url: 'ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png',
|
|
4250
|
+
width: 512,
|
|
4251
|
+
height: 512,
|
|
4252
|
+
format: 'png',
|
|
4253
|
+
},
|
|
4254
|
+
infoURL: 'https://optimism.io',
|
|
4255
|
+
name: 'OP Sepolia Testnet',
|
|
4256
|
+
nativeCurrency: {
|
|
4257
|
+
name: 'Sepolia Ether',
|
|
4258
|
+
symbol: 'ETH',
|
|
4259
|
+
decimals: 18,
|
|
4260
|
+
},
|
|
4261
|
+
networkId: 11155420,
|
|
4262
|
+
redFlags: [],
|
|
4263
|
+
rpc: [
|
|
4264
|
+
'https://optimism-sepolia-rpc.publicnode.com',
|
|
4265
|
+
],
|
|
4266
|
+
shortName: 'opsep',
|
|
4267
|
+
slip44: 1,
|
|
4268
|
+
slug: 'op-sepolia-testnet',
|
|
4269
|
+
testnet: true,
|
|
4270
|
+
};
|
|
4271
|
+
|
|
4272
|
+
const chain = {
|
|
4273
|
+
chain: 'ETH',
|
|
4274
|
+
chainId: 10,
|
|
4275
|
+
explorers: [
|
|
4276
|
+
{
|
|
4277
|
+
name: 'etherscan',
|
|
4278
|
+
url: 'https://optimistic.etherscan.io',
|
|
4279
|
+
standard: 'EIP3091',
|
|
4280
|
+
},
|
|
4281
|
+
{
|
|
4282
|
+
name: 'blockscout',
|
|
4283
|
+
url: 'https://optimism.blockscout.com',
|
|
4284
|
+
standard: 'EIP3091',
|
|
4285
|
+
icon: {
|
|
4286
|
+
url: 'ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM',
|
|
4287
|
+
width: 551,
|
|
4288
|
+
height: 540,
|
|
4289
|
+
format: 'png',
|
|
4290
|
+
},
|
|
4291
|
+
},
|
|
4292
|
+
{
|
|
4293
|
+
name: 'dexguru',
|
|
4294
|
+
url: 'https://optimism.dex.guru',
|
|
4295
|
+
standard: 'EIP3091',
|
|
4296
|
+
icon: {
|
|
4297
|
+
url: 'ipfs://QmRaASKRSjQ5btoUQ2rNTJNxKtx2a2RoewgA7DMQkLVEne',
|
|
4298
|
+
width: 83,
|
|
4299
|
+
height: 82,
|
|
4300
|
+
format: 'svg',
|
|
4301
|
+
},
|
|
4302
|
+
},
|
|
4303
|
+
],
|
|
4304
|
+
faucets: [],
|
|
4305
|
+
features: [],
|
|
4306
|
+
icon: {
|
|
4307
|
+
url: 'ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png',
|
|
4308
|
+
width: 512,
|
|
4309
|
+
height: 512,
|
|
4310
|
+
format: 'png',
|
|
4311
|
+
},
|
|
4312
|
+
infoURL: 'https://optimism.io',
|
|
4313
|
+
name: 'OP Mainnet',
|
|
4314
|
+
nativeCurrency: {
|
|
4315
|
+
name: 'Ether',
|
|
4316
|
+
symbol: 'ETH',
|
|
4317
|
+
decimals: 18,
|
|
4318
|
+
},
|
|
4319
|
+
networkId: 10,
|
|
4320
|
+
redFlags: [],
|
|
4321
|
+
rpc: [
|
|
4322
|
+
'https://optimism-rpc.publicnode.com',
|
|
4323
|
+
],
|
|
4324
|
+
shortName: 'oeth',
|
|
4325
|
+
slug: 'optimism',
|
|
4326
|
+
testnet: false,
|
|
4327
|
+
};
|
|
4328
|
+
|
|
4225
4329
|
const chainMap = {
|
|
4226
4330
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4227
|
-
56: chain$
|
|
4331
|
+
56: chain$o,
|
|
4228
4332
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4229
|
-
97: chain$
|
|
4333
|
+
97: chain$n,
|
|
4230
4334
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4231
|
-
8453: chain$
|
|
4335
|
+
8453: chain$m,
|
|
4232
4336
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4233
|
-
84532: chain$
|
|
4337
|
+
84532: chain$l,
|
|
4234
4338
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4235
|
-
4337: chain$
|
|
4339
|
+
4337: chain$k,
|
|
4236
4340
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4237
|
-
13337: chain$
|
|
4341
|
+
13337: chain$j,
|
|
4238
4342
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4239
|
-
43113: chain$
|
|
4343
|
+
43113: chain$i,
|
|
4240
4344
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4241
|
-
43114: chain$
|
|
4345
|
+
43114: chain$h,
|
|
4242
4346
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4243
|
-
11155111: chain$
|
|
4347
|
+
11155111: chain$g,
|
|
4244
4348
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4245
|
-
59140: chain$
|
|
4349
|
+
59140: chain$f,
|
|
4246
4350
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4247
|
-
10200: chain$
|
|
4351
|
+
10200: chain$e,
|
|
4248
4352
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4249
|
-
421614: chain$
|
|
4353
|
+
421614: chain$c,
|
|
4250
4354
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4251
|
-
42161: chain$
|
|
4355
|
+
42161: chain$b,
|
|
4252
4356
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4253
|
-
42170: chain$
|
|
4357
|
+
42170: chain$a,
|
|
4254
4358
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4255
|
-
137: chain$
|
|
4359
|
+
137: chain$9,
|
|
4256
4360
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4257
|
-
80002: chain$
|
|
4361
|
+
80002: chain$8,
|
|
4258
4362
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4259
|
-
28122024: chain$
|
|
4363
|
+
28122024: chain$7,
|
|
4260
4364
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4261
|
-
888888888: chain$
|
|
4365
|
+
888888888: chain$6,
|
|
4262
4366
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4263
|
-
999999999: chain$
|
|
4367
|
+
999999999: chain$5,
|
|
4264
4368
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4265
|
-
7777777: chain$
|
|
4369
|
+
7777777: chain$4,
|
|
4266
4370
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4267
|
-
666666666: chain$
|
|
4371
|
+
666666666: chain$3,
|
|
4268
4372
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4269
|
-
13473: chain,
|
|
4373
|
+
13473: chain$2,
|
|
4270
4374
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4271
|
-
13371: chain$
|
|
4375
|
+
13371: chain$d,
|
|
4376
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4377
|
+
11155420: chain$1,
|
|
4378
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4379
|
+
10: chain,
|
|
4272
4380
|
};
|
|
4273
4381
|
|
|
4274
4382
|
var BackendTransactionStatus;
|
|
@@ -4479,13 +4587,13 @@ class EvmProvider {
|
|
|
4479
4587
|
#backendApiClients;
|
|
4480
4588
|
#address;
|
|
4481
4589
|
isOpenfort = true;
|
|
4482
|
-
constructor({ signer,
|
|
4590
|
+
constructor({ signer, backendApiClients, instanceManager, openfortEventEmitter, policyId, }) {
|
|
4483
4591
|
this.#signer = signer;
|
|
4484
4592
|
this.#policyId = policyId;
|
|
4485
|
-
this.#address = address;
|
|
4486
4593
|
this.#instanceManager = instanceManager;
|
|
4487
4594
|
this.#backendApiClients = backendApiClients;
|
|
4488
|
-
|
|
4595
|
+
// default base mainnet as default chainId
|
|
4596
|
+
const chainId = Number(this.#instanceManager.getChainID() ?? 8453);
|
|
4489
4597
|
this.#rpcProvider = new providers.StaticJsonRpcProvider(chainMap[chainId].rpc[0]);
|
|
4490
4598
|
this.#backendApiClients = backendApiClients;
|
|
4491
4599
|
this.#eventEmitter = new TypedEventEmitter();
|
|
@@ -4494,7 +4602,7 @@ class EvmProvider {
|
|
|
4494
4602
|
#handleLogout = () => {
|
|
4495
4603
|
const shouldEmitAccountsChanged = !!this.#address;
|
|
4496
4604
|
this.#address = undefined;
|
|
4497
|
-
this.#signer
|
|
4605
|
+
this.#signer = undefined;
|
|
4498
4606
|
if (shouldEmitAccountsChanged) {
|
|
4499
4607
|
this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, []);
|
|
4500
4608
|
}
|
|
@@ -4505,13 +4613,16 @@ class EvmProvider {
|
|
|
4505
4613
|
if (this.#address) {
|
|
4506
4614
|
return [this.#address];
|
|
4507
4615
|
}
|
|
4616
|
+
if (!this.#signer) {
|
|
4617
|
+
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - must be authenticated and configured with a signer');
|
|
4618
|
+
}
|
|
4508
4619
|
const user = await this.#signer.ensureEmbeddedAccount();
|
|
4509
4620
|
this.#address = user.address;
|
|
4510
4621
|
this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, [this.#address]);
|
|
4511
4622
|
return [this.#address];
|
|
4512
4623
|
}
|
|
4513
4624
|
case 'eth_sendTransaction': {
|
|
4514
|
-
if (!this.#address) {
|
|
4625
|
+
if (!this.#address || !this.#signer) {
|
|
4515
4626
|
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - call eth_requestAccounts first');
|
|
4516
4627
|
}
|
|
4517
4628
|
return await sendTransaction({
|
|
@@ -4527,7 +4638,7 @@ class EvmProvider {
|
|
|
4527
4638
|
}
|
|
4528
4639
|
case 'eth_signTypedData':
|
|
4529
4640
|
case 'eth_signTypedData_v4': {
|
|
4530
|
-
if (!this.#address) {
|
|
4641
|
+
if (!this.#address || !this.#signer) {
|
|
4531
4642
|
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - call eth_requestAccounts first');
|
|
4532
4643
|
}
|
|
4533
4644
|
const accountType = this.#instanceManager.getAccountType();
|
|
@@ -4672,7 +4783,7 @@ class EvmProvider {
|
|
|
4672
4783
|
|
|
4673
4784
|
const openfortProviderInfo = {
|
|
4674
4785
|
// eslint-disable-next-line max-len
|
|
4675
|
-
icon: 'data:image/svg+xml,<svg aria-hidden="true" viewBox="597.32 331.34 171.36 105.32" ><g><rect x="673.9" y="404.26" width="18.2" height="32.4" /><polygon points="768.68,331.36 768.68,331.36 768.68,331.34 610.78,331.34 610.78,331.36 597.32,331.36 597.32,436.64 615.52,436.64 615.52,349.54 750.48,349.54 750.48,436.64 768.68,436.64 " /><polygon points="732.16,367.79 633.83,367.79 633.83,370.19 633.79,370.19 633.79,436.64 651.99,436.64 651.99,385.99 713.9,385.99 713.9,436.64 732.09,436.64 732.09,385.99 732.16,385.99 " /></g></svg>',
|
|
4786
|
+
icon: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="597.32 331.34 171.36 105.32" ><g><rect x="673.9" y="404.26" width="18.2" height="32.4" /><polygon points="768.68,331.36 768.68,331.36 768.68,331.34 610.78,331.34 610.78,331.36 597.32,331.36 597.32,436.64 615.52,436.64 615.52,349.54 750.48,349.54 750.48,436.64 768.68,436.64 " /><polygon points="732.16,367.79 633.83,367.79 633.83,370.19 633.79,370.19 633.79,436.64 651.99,436.64 651.99,385.99 713.9,385.99 713.9,436.64 732.09,436.64 732.09,385.99 732.16,385.99 " /></g></svg>',
|
|
4676
4787
|
name: 'Openfort',
|
|
4677
4788
|
rdns: 'xyz.openfort',
|
|
4678
4789
|
uuid: uuid.v4(),
|
|
@@ -5178,7 +5289,7 @@ class AuthManager {
|
|
|
5178
5289
|
}
|
|
5179
5290
|
}
|
|
5180
5291
|
|
|
5181
|
-
const VERSION = '0.7.
|
|
5292
|
+
const VERSION = '0.7.25';
|
|
5182
5293
|
|
|
5183
5294
|
var Event;
|
|
5184
5295
|
(function (Event) {
|
|
@@ -5997,6 +6108,7 @@ class IframeManager {
|
|
|
5997
6108
|
publishableKey: this.sdkConfiguration.baseConfiguration.publishableKey,
|
|
5998
6109
|
shieldAPIKey: this.sdkConfiguration.shieldConfiguration.shieldPublishableKey,
|
|
5999
6110
|
accessToken: iframeConfiguration.accessToken,
|
|
6111
|
+
playerID: iframeConfiguration.playerID,
|
|
6000
6112
|
thirdPartyProvider: iframeConfiguration.thirdPartyProvider,
|
|
6001
6113
|
thirdPartyTokenType: iframeConfiguration.thirdPartyTokenType,
|
|
6002
6114
|
encryptionKey: password ?? null,
|
|
@@ -6178,14 +6290,12 @@ class Openfort {
|
|
|
6178
6290
|
* @throws {OpenfortError} If the signer is not an EmbeddedSigner.
|
|
6179
6291
|
*/
|
|
6180
6292
|
getEthereumProvider(options = { announceProvider: true }) {
|
|
6181
|
-
if (
|
|
6293
|
+
if ((this.signer instanceof SessionSigner)) {
|
|
6182
6294
|
throw new OpenfortError('Embedded signer must be configured to get Ethereum provider', exports.OpenfortErrorType.NOT_LOGGED_IN_ERROR);
|
|
6183
6295
|
}
|
|
6184
|
-
const address = this.instanceManager.getAccountAddress();
|
|
6185
6296
|
const provider = new EvmProvider({
|
|
6186
6297
|
openfortEventEmitter: this.openfortEventEmitter,
|
|
6187
6298
|
signer: this.signer,
|
|
6188
|
-
address: address,
|
|
6189
6299
|
instanceManager: this.instanceManager,
|
|
6190
6300
|
backendApiClients: this.backendApiClients,
|
|
6191
6301
|
policyId: options.policy,
|
|
@@ -6746,6 +6856,7 @@ class Openfort {
|
|
|
6746
6856
|
};
|
|
6747
6857
|
const iframeConfiguration = {
|
|
6748
6858
|
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
|
|
6859
|
+
playerID: this.instanceManager.getPlayerID() ?? null,
|
|
6749
6860
|
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
|
|
6750
6861
|
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
|
|
6751
6862
|
chainId: !chainId ? Number(this.instanceManager.getChainID()) ?? null : chainId,
|
|
@@ -6764,6 +6875,7 @@ class Openfort {
|
|
|
6764
6875
|
case SignerType.EMBEDDED: {
|
|
6765
6876
|
const iframeConfiguration = {
|
|
6766
6877
|
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
|
|
6878
|
+
playerID: this.instanceManager.getPlayerID() ?? null,
|
|
6767
6879
|
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
|
|
6768
6880
|
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
|
|
6769
6881
|
chainId: null,
|
package/dist/index.js
CHANGED
|
@@ -3223,7 +3223,7 @@ class SDKConfiguration {
|
|
|
3223
3223
|
}
|
|
3224
3224
|
}
|
|
3225
3225
|
|
|
3226
|
-
const chain$
|
|
3226
|
+
const chain$o = {
|
|
3227
3227
|
chain: 'BSC',
|
|
3228
3228
|
chainId: 56,
|
|
3229
3229
|
explorers: [
|
|
@@ -3284,7 +3284,7 @@ const chain$m = {
|
|
|
3284
3284
|
testnet: false,
|
|
3285
3285
|
};
|
|
3286
3286
|
|
|
3287
|
-
const chain$
|
|
3287
|
+
const chain$n = {
|
|
3288
3288
|
chain: 'BSC',
|
|
3289
3289
|
chainId: 97,
|
|
3290
3290
|
explorers: [
|
|
@@ -3325,7 +3325,7 @@ const chain$l = {
|
|
|
3325
3325
|
testnet: true,
|
|
3326
3326
|
};
|
|
3327
3327
|
|
|
3328
|
-
const chain$
|
|
3328
|
+
const chain$m = {
|
|
3329
3329
|
name: 'Base',
|
|
3330
3330
|
chain: 'ETH',
|
|
3331
3331
|
rpc: [
|
|
@@ -3370,7 +3370,7 @@ const chain$k = {
|
|
|
3370
3370
|
slug: 'base',
|
|
3371
3371
|
};
|
|
3372
3372
|
|
|
3373
|
-
const chain$
|
|
3373
|
+
const chain$l = {
|
|
3374
3374
|
chain: 'ETH',
|
|
3375
3375
|
chainId: 84532,
|
|
3376
3376
|
explorers: [
|
|
@@ -3409,7 +3409,7 @@ const chain$j = {
|
|
|
3409
3409
|
testnet: true,
|
|
3410
3410
|
};
|
|
3411
3411
|
|
|
3412
|
-
const chain$
|
|
3412
|
+
const chain$k = {
|
|
3413
3413
|
name: 'Beam',
|
|
3414
3414
|
chainId: 4337,
|
|
3415
3415
|
chain: 'BEAM',
|
|
@@ -3432,7 +3432,7 @@ const chain$i = {
|
|
|
3432
3432
|
decimals: 18,
|
|
3433
3433
|
},
|
|
3434
3434
|
rpc: [
|
|
3435
|
-
'https://
|
|
3435
|
+
'https://build.onbeam.com/rpc',
|
|
3436
3436
|
],
|
|
3437
3437
|
faucets: ['https://faucet.onbeam.com'],
|
|
3438
3438
|
explorers: [
|
|
@@ -3446,7 +3446,7 @@ const chain$i = {
|
|
|
3446
3446
|
testnet: false,
|
|
3447
3447
|
};
|
|
3448
3448
|
|
|
3449
|
-
const chain$
|
|
3449
|
+
const chain$j = {
|
|
3450
3450
|
name: 'Beam Testnet',
|
|
3451
3451
|
chainId: 13337,
|
|
3452
3452
|
chain: 'BEAM',
|
|
@@ -3469,7 +3469,7 @@ const chain$h = {
|
|
|
3469
3469
|
decimals: 18,
|
|
3470
3470
|
},
|
|
3471
3471
|
rpc: [
|
|
3472
|
-
'https://
|
|
3472
|
+
'https://build.onbeam.com/rpc/testnet',
|
|
3473
3473
|
],
|
|
3474
3474
|
faucets: ['https://faucet.avax.network/?subnet=beam', 'https://faucet.onbeam.com'],
|
|
3475
3475
|
explorers: [
|
|
@@ -3483,7 +3483,7 @@ const chain$h = {
|
|
|
3483
3483
|
testnet: true,
|
|
3484
3484
|
};
|
|
3485
3485
|
|
|
3486
|
-
const chain$
|
|
3486
|
+
const chain$i = {
|
|
3487
3487
|
chain: 'AVAX',
|
|
3488
3488
|
chainId: 43113,
|
|
3489
3489
|
explorers: [
|
|
@@ -3519,7 +3519,7 @@ const chain$g = {
|
|
|
3519
3519
|
testnet: true,
|
|
3520
3520
|
};
|
|
3521
3521
|
|
|
3522
|
-
const chain$
|
|
3522
|
+
const chain$h = {
|
|
3523
3523
|
chain: 'AVAX',
|
|
3524
3524
|
chainId: 43114,
|
|
3525
3525
|
explorers: [
|
|
@@ -3560,7 +3560,7 @@ const chain$f = {
|
|
|
3560
3560
|
testnet: false,
|
|
3561
3561
|
};
|
|
3562
3562
|
|
|
3563
|
-
const chain$
|
|
3563
|
+
const chain$g = {
|
|
3564
3564
|
chain: 'ETH',
|
|
3565
3565
|
chainId: 11155111,
|
|
3566
3566
|
explorers: [
|
|
@@ -3606,7 +3606,7 @@ const chain$e = {
|
|
|
3606
3606
|
title: 'Ethereum Testnet Sepolia',
|
|
3607
3607
|
};
|
|
3608
3608
|
|
|
3609
|
-
const chain$
|
|
3609
|
+
const chain$f = {
|
|
3610
3610
|
chain: 'ETH',
|
|
3611
3611
|
chainId: 59140,
|
|
3612
3612
|
explorers: [
|
|
@@ -3668,7 +3668,7 @@ const chain$d = {
|
|
|
3668
3668
|
title: 'Linea Goerli Testnet',
|
|
3669
3669
|
};
|
|
3670
3670
|
|
|
3671
|
-
const chain$
|
|
3671
|
+
const chain$e = {
|
|
3672
3672
|
chain: 'GNO',
|
|
3673
3673
|
chainId: 10200,
|
|
3674
3674
|
explorers: [
|
|
@@ -3714,7 +3714,7 @@ const chain$c = {
|
|
|
3714
3714
|
testnet: true,
|
|
3715
3715
|
};
|
|
3716
3716
|
|
|
3717
|
-
const chain$
|
|
3717
|
+
const chain$d = {
|
|
3718
3718
|
chain: 'Immutable zkEVM',
|
|
3719
3719
|
chainId: 13371,
|
|
3720
3720
|
explorers: [
|
|
@@ -3755,7 +3755,7 @@ const chain$b = {
|
|
|
3755
3755
|
testnet: false,
|
|
3756
3756
|
};
|
|
3757
3757
|
|
|
3758
|
-
const chain$
|
|
3758
|
+
const chain$c = {
|
|
3759
3759
|
chain: 'ETH',
|
|
3760
3760
|
chainId: 421614,
|
|
3761
3761
|
explorers: [
|
|
@@ -3792,7 +3792,7 @@ const chain$a = {
|
|
|
3792
3792
|
title: 'Arbitrum Sepolia Rollup Testnet',
|
|
3793
3793
|
};
|
|
3794
3794
|
|
|
3795
|
-
const chain$
|
|
3795
|
+
const chain$b = {
|
|
3796
3796
|
chain: 'ETH',
|
|
3797
3797
|
chainId: 42161,
|
|
3798
3798
|
explorers: [
|
|
@@ -3854,7 +3854,7 @@ const chain$9 = {
|
|
|
3854
3854
|
testnet: false,
|
|
3855
3855
|
};
|
|
3856
3856
|
|
|
3857
|
-
const chain$
|
|
3857
|
+
const chain$a = {
|
|
3858
3858
|
chain: 'ETH',
|
|
3859
3859
|
chainId: 42170,
|
|
3860
3860
|
explorers: [
|
|
@@ -3909,7 +3909,7 @@ const chain$8 = {
|
|
|
3909
3909
|
testnet: false,
|
|
3910
3910
|
};
|
|
3911
3911
|
|
|
3912
|
-
const chain$
|
|
3912
|
+
const chain$9 = {
|
|
3913
3913
|
chain: 'Polygon',
|
|
3914
3914
|
chainId: 137,
|
|
3915
3915
|
explorers: [
|
|
@@ -3965,7 +3965,7 @@ const chain$7 = {
|
|
|
3965
3965
|
testnet: false,
|
|
3966
3966
|
};
|
|
3967
3967
|
|
|
3968
|
-
const chain$
|
|
3968
|
+
const chain$8 = {
|
|
3969
3969
|
chain: 'Polygon',
|
|
3970
3970
|
chainId: 80002,
|
|
3971
3971
|
explorers: [
|
|
@@ -4002,7 +4002,7 @@ const chain$6 = {
|
|
|
4002
4002
|
title: 'Polygon Amoy Testnet',
|
|
4003
4003
|
};
|
|
4004
4004
|
|
|
4005
|
-
const chain$
|
|
4005
|
+
const chain$7 = {
|
|
4006
4006
|
chain: 'Ancient8',
|
|
4007
4007
|
chainId: 28122024,
|
|
4008
4008
|
explorers: [
|
|
@@ -4034,7 +4034,7 @@ const chain$5 = {
|
|
|
4034
4034
|
testnet: true,
|
|
4035
4035
|
};
|
|
4036
4036
|
|
|
4037
|
-
const chain$
|
|
4037
|
+
const chain$6 = {
|
|
4038
4038
|
chain: 'Ancient8',
|
|
4039
4039
|
chainId: 888888888,
|
|
4040
4040
|
explorers: [
|
|
@@ -4065,7 +4065,7 @@ const chain$4 = {
|
|
|
4065
4065
|
testnet: false,
|
|
4066
4066
|
};
|
|
4067
4067
|
|
|
4068
|
-
const chain$
|
|
4068
|
+
const chain$5 = {
|
|
4069
4069
|
chain: 'ETH',
|
|
4070
4070
|
chainId: 999999999,
|
|
4071
4071
|
explorers: [
|
|
@@ -4097,7 +4097,7 @@ const chain$3 = {
|
|
|
4097
4097
|
testnet: true,
|
|
4098
4098
|
};
|
|
4099
4099
|
|
|
4100
|
-
const chain$
|
|
4100
|
+
const chain$4 = {
|
|
4101
4101
|
chain: 'ETH',
|
|
4102
4102
|
chainId: 7777777,
|
|
4103
4103
|
explorers: [
|
|
@@ -4130,7 +4130,7 @@ const chain$2 = {
|
|
|
4130
4130
|
testnet: false,
|
|
4131
4131
|
};
|
|
4132
4132
|
|
|
4133
|
-
const chain$
|
|
4133
|
+
const chain$3 = {
|
|
4134
4134
|
chain: 'Degen',
|
|
4135
4135
|
chainId: 666666666,
|
|
4136
4136
|
explorers: [],
|
|
@@ -4157,7 +4157,7 @@ const chain$1 = {
|
|
|
4157
4157
|
title: 'Degen Chain',
|
|
4158
4158
|
};
|
|
4159
4159
|
|
|
4160
|
-
const chain = {
|
|
4160
|
+
const chain$2 = {
|
|
4161
4161
|
chain: 'Immutable zkEVM',
|
|
4162
4162
|
chainId: 13473,
|
|
4163
4163
|
explorers: [
|
|
@@ -4199,53 +4199,161 @@ const chain = {
|
|
|
4199
4199
|
testnet: true,
|
|
4200
4200
|
};
|
|
4201
4201
|
|
|
4202
|
+
const chain$1 = {
|
|
4203
|
+
chain: 'ETH',
|
|
4204
|
+
chainId: 11155420,
|
|
4205
|
+
explorers: [
|
|
4206
|
+
{
|
|
4207
|
+
name: 'etherscan',
|
|
4208
|
+
url: 'https://sepolia-optimism.etherscan.io',
|
|
4209
|
+
standard: 'EIP3091',
|
|
4210
|
+
},
|
|
4211
|
+
{
|
|
4212
|
+
name: 'opscout',
|
|
4213
|
+
url: 'https://optimism-sepolia.blockscout.com',
|
|
4214
|
+
standard: 'EIP3091',
|
|
4215
|
+
icon: {
|
|
4216
|
+
url: 'ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM',
|
|
4217
|
+
width: 551,
|
|
4218
|
+
height: 540,
|
|
4219
|
+
format: 'png',
|
|
4220
|
+
},
|
|
4221
|
+
},
|
|
4222
|
+
],
|
|
4223
|
+
faucets: ['https://app.optimism.io/faucet'],
|
|
4224
|
+
features: [],
|
|
4225
|
+
icon: {
|
|
4226
|
+
url: 'ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png',
|
|
4227
|
+
width: 512,
|
|
4228
|
+
height: 512,
|
|
4229
|
+
format: 'png',
|
|
4230
|
+
},
|
|
4231
|
+
infoURL: 'https://optimism.io',
|
|
4232
|
+
name: 'OP Sepolia Testnet',
|
|
4233
|
+
nativeCurrency: {
|
|
4234
|
+
name: 'Sepolia Ether',
|
|
4235
|
+
symbol: 'ETH',
|
|
4236
|
+
decimals: 18,
|
|
4237
|
+
},
|
|
4238
|
+
networkId: 11155420,
|
|
4239
|
+
redFlags: [],
|
|
4240
|
+
rpc: [
|
|
4241
|
+
'https://optimism-sepolia-rpc.publicnode.com',
|
|
4242
|
+
],
|
|
4243
|
+
shortName: 'opsep',
|
|
4244
|
+
slip44: 1,
|
|
4245
|
+
slug: 'op-sepolia-testnet',
|
|
4246
|
+
testnet: true,
|
|
4247
|
+
};
|
|
4248
|
+
|
|
4249
|
+
const chain = {
|
|
4250
|
+
chain: 'ETH',
|
|
4251
|
+
chainId: 10,
|
|
4252
|
+
explorers: [
|
|
4253
|
+
{
|
|
4254
|
+
name: 'etherscan',
|
|
4255
|
+
url: 'https://optimistic.etherscan.io',
|
|
4256
|
+
standard: 'EIP3091',
|
|
4257
|
+
},
|
|
4258
|
+
{
|
|
4259
|
+
name: 'blockscout',
|
|
4260
|
+
url: 'https://optimism.blockscout.com',
|
|
4261
|
+
standard: 'EIP3091',
|
|
4262
|
+
icon: {
|
|
4263
|
+
url: 'ipfs://QmYtUimyqHkkFxYdbXXRbUqNg2VLPUg6Uu2C2nmFWowiZM',
|
|
4264
|
+
width: 551,
|
|
4265
|
+
height: 540,
|
|
4266
|
+
format: 'png',
|
|
4267
|
+
},
|
|
4268
|
+
},
|
|
4269
|
+
{
|
|
4270
|
+
name: 'dexguru',
|
|
4271
|
+
url: 'https://optimism.dex.guru',
|
|
4272
|
+
standard: 'EIP3091',
|
|
4273
|
+
icon: {
|
|
4274
|
+
url: 'ipfs://QmRaASKRSjQ5btoUQ2rNTJNxKtx2a2RoewgA7DMQkLVEne',
|
|
4275
|
+
width: 83,
|
|
4276
|
+
height: 82,
|
|
4277
|
+
format: 'svg',
|
|
4278
|
+
},
|
|
4279
|
+
},
|
|
4280
|
+
],
|
|
4281
|
+
faucets: [],
|
|
4282
|
+
features: [],
|
|
4283
|
+
icon: {
|
|
4284
|
+
url: 'ipfs://QmcxZHpyJa8T4i63xqjPYrZ6tKrt55tZJpbXcjSDKuKaf9/optimism/512.png',
|
|
4285
|
+
width: 512,
|
|
4286
|
+
height: 512,
|
|
4287
|
+
format: 'png',
|
|
4288
|
+
},
|
|
4289
|
+
infoURL: 'https://optimism.io',
|
|
4290
|
+
name: 'OP Mainnet',
|
|
4291
|
+
nativeCurrency: {
|
|
4292
|
+
name: 'Ether',
|
|
4293
|
+
symbol: 'ETH',
|
|
4294
|
+
decimals: 18,
|
|
4295
|
+
},
|
|
4296
|
+
networkId: 10,
|
|
4297
|
+
redFlags: [],
|
|
4298
|
+
rpc: [
|
|
4299
|
+
'https://optimism-rpc.publicnode.com',
|
|
4300
|
+
],
|
|
4301
|
+
shortName: 'oeth',
|
|
4302
|
+
slug: 'optimism',
|
|
4303
|
+
testnet: false,
|
|
4304
|
+
};
|
|
4305
|
+
|
|
4202
4306
|
const chainMap = {
|
|
4203
4307
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4204
|
-
56: chain$
|
|
4308
|
+
56: chain$o,
|
|
4205
4309
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4206
|
-
97: chain$
|
|
4310
|
+
97: chain$n,
|
|
4207
4311
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4208
|
-
8453: chain$
|
|
4312
|
+
8453: chain$m,
|
|
4209
4313
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4210
|
-
84532: chain$
|
|
4314
|
+
84532: chain$l,
|
|
4211
4315
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4212
|
-
4337: chain$
|
|
4316
|
+
4337: chain$k,
|
|
4213
4317
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4214
|
-
13337: chain$
|
|
4318
|
+
13337: chain$j,
|
|
4215
4319
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4216
|
-
43113: chain$
|
|
4320
|
+
43113: chain$i,
|
|
4217
4321
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4218
|
-
43114: chain$
|
|
4322
|
+
43114: chain$h,
|
|
4219
4323
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4220
|
-
11155111: chain$
|
|
4324
|
+
11155111: chain$g,
|
|
4221
4325
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4222
|
-
59140: chain$
|
|
4326
|
+
59140: chain$f,
|
|
4223
4327
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4224
|
-
10200: chain$
|
|
4328
|
+
10200: chain$e,
|
|
4225
4329
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4226
|
-
421614: chain$
|
|
4330
|
+
421614: chain$c,
|
|
4227
4331
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4228
|
-
42161: chain$
|
|
4332
|
+
42161: chain$b,
|
|
4229
4333
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4230
|
-
42170: chain$
|
|
4334
|
+
42170: chain$a,
|
|
4231
4335
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4232
|
-
137: chain$
|
|
4336
|
+
137: chain$9,
|
|
4233
4337
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4234
|
-
80002: chain$
|
|
4338
|
+
80002: chain$8,
|
|
4235
4339
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4236
|
-
28122024: chain$
|
|
4340
|
+
28122024: chain$7,
|
|
4237
4341
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4238
|
-
888888888: chain$
|
|
4342
|
+
888888888: chain$6,
|
|
4239
4343
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4240
|
-
999999999: chain$
|
|
4344
|
+
999999999: chain$5,
|
|
4241
4345
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4242
|
-
7777777: chain$
|
|
4346
|
+
7777777: chain$4,
|
|
4243
4347
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4244
|
-
666666666: chain$
|
|
4348
|
+
666666666: chain$3,
|
|
4245
4349
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4246
|
-
13473: chain,
|
|
4350
|
+
13473: chain$2,
|
|
4247
4351
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4248
|
-
13371: chain$
|
|
4352
|
+
13371: chain$d,
|
|
4353
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4354
|
+
11155420: chain$1,
|
|
4355
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
4356
|
+
10: chain,
|
|
4249
4357
|
};
|
|
4250
4358
|
|
|
4251
4359
|
var BackendTransactionStatus;
|
|
@@ -4456,13 +4564,13 @@ class EvmProvider {
|
|
|
4456
4564
|
#backendApiClients;
|
|
4457
4565
|
#address;
|
|
4458
4566
|
isOpenfort = true;
|
|
4459
|
-
constructor({ signer,
|
|
4567
|
+
constructor({ signer, backendApiClients, instanceManager, openfortEventEmitter, policyId, }) {
|
|
4460
4568
|
this.#signer = signer;
|
|
4461
4569
|
this.#policyId = policyId;
|
|
4462
|
-
this.#address = address;
|
|
4463
4570
|
this.#instanceManager = instanceManager;
|
|
4464
4571
|
this.#backendApiClients = backendApiClients;
|
|
4465
|
-
|
|
4572
|
+
// default base mainnet as default chainId
|
|
4573
|
+
const chainId = Number(this.#instanceManager.getChainID() ?? 8453);
|
|
4466
4574
|
this.#rpcProvider = new StaticJsonRpcProvider(chainMap[chainId].rpc[0]);
|
|
4467
4575
|
this.#backendApiClients = backendApiClients;
|
|
4468
4576
|
this.#eventEmitter = new TypedEventEmitter();
|
|
@@ -4471,7 +4579,7 @@ class EvmProvider {
|
|
|
4471
4579
|
#handleLogout = () => {
|
|
4472
4580
|
const shouldEmitAccountsChanged = !!this.#address;
|
|
4473
4581
|
this.#address = undefined;
|
|
4474
|
-
this.#signer
|
|
4582
|
+
this.#signer = undefined;
|
|
4475
4583
|
if (shouldEmitAccountsChanged) {
|
|
4476
4584
|
this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, []);
|
|
4477
4585
|
}
|
|
@@ -4482,13 +4590,16 @@ class EvmProvider {
|
|
|
4482
4590
|
if (this.#address) {
|
|
4483
4591
|
return [this.#address];
|
|
4484
4592
|
}
|
|
4593
|
+
if (!this.#signer) {
|
|
4594
|
+
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - must be authenticated and configured with a signer');
|
|
4595
|
+
}
|
|
4485
4596
|
const user = await this.#signer.ensureEmbeddedAccount();
|
|
4486
4597
|
this.#address = user.address;
|
|
4487
4598
|
this.#eventEmitter.emit(ProviderEvent.ACCOUNTS_CHANGED, [this.#address]);
|
|
4488
4599
|
return [this.#address];
|
|
4489
4600
|
}
|
|
4490
4601
|
case 'eth_sendTransaction': {
|
|
4491
|
-
if (!this.#address) {
|
|
4602
|
+
if (!this.#address || !this.#signer) {
|
|
4492
4603
|
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - call eth_requestAccounts first');
|
|
4493
4604
|
}
|
|
4494
4605
|
return await sendTransaction({
|
|
@@ -4504,7 +4615,7 @@ class EvmProvider {
|
|
|
4504
4615
|
}
|
|
4505
4616
|
case 'eth_signTypedData':
|
|
4506
4617
|
case 'eth_signTypedData_v4': {
|
|
4507
|
-
if (!this.#address) {
|
|
4618
|
+
if (!this.#address || !this.#signer) {
|
|
4508
4619
|
throw new JsonRpcError(ProviderErrorCode.UNAUTHORIZED, 'Unauthorized - call eth_requestAccounts first');
|
|
4509
4620
|
}
|
|
4510
4621
|
const accountType = this.#instanceManager.getAccountType();
|
|
@@ -4649,7 +4760,7 @@ class EvmProvider {
|
|
|
4649
4760
|
|
|
4650
4761
|
const openfortProviderInfo = {
|
|
4651
4762
|
// eslint-disable-next-line max-len
|
|
4652
|
-
icon: 'data:image/svg+xml,<svg aria-hidden="true" viewBox="597.32 331.34 171.36 105.32" ><g><rect x="673.9" y="404.26" width="18.2" height="32.4" /><polygon points="768.68,331.36 768.68,331.36 768.68,331.34 610.78,331.34 610.78,331.36 597.32,331.36 597.32,436.64 615.52,436.64 615.52,349.54 750.48,349.54 750.48,436.64 768.68,436.64 " /><polygon points="732.16,367.79 633.83,367.79 633.83,370.19 633.79,370.19 633.79,436.64 651.99,436.64 651.99,385.99 713.9,385.99 713.9,436.64 732.09,436.64 732.09,385.99 732.16,385.99 " /></g></svg>',
|
|
4763
|
+
icon: 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="597.32 331.34 171.36 105.32" ><g><rect x="673.9" y="404.26" width="18.2" height="32.4" /><polygon points="768.68,331.36 768.68,331.36 768.68,331.34 610.78,331.34 610.78,331.36 597.32,331.36 597.32,436.64 615.52,436.64 615.52,349.54 750.48,349.54 750.48,436.64 768.68,436.64 " /><polygon points="732.16,367.79 633.83,367.79 633.83,370.19 633.79,370.19 633.79,436.64 651.99,436.64 651.99,385.99 713.9,385.99 713.9,436.64 732.09,436.64 732.09,385.99 732.16,385.99 " /></g></svg>',
|
|
4653
4764
|
name: 'Openfort',
|
|
4654
4765
|
rdns: 'xyz.openfort',
|
|
4655
4766
|
uuid: v4(),
|
|
@@ -5155,7 +5266,7 @@ class AuthManager {
|
|
|
5155
5266
|
}
|
|
5156
5267
|
}
|
|
5157
5268
|
|
|
5158
|
-
const VERSION = '0.7.
|
|
5269
|
+
const VERSION = '0.7.25';
|
|
5159
5270
|
|
|
5160
5271
|
var Event;
|
|
5161
5272
|
(function (Event) {
|
|
@@ -5974,6 +6085,7 @@ class IframeManager {
|
|
|
5974
6085
|
publishableKey: this.sdkConfiguration.baseConfiguration.publishableKey,
|
|
5975
6086
|
shieldAPIKey: this.sdkConfiguration.shieldConfiguration.shieldPublishableKey,
|
|
5976
6087
|
accessToken: iframeConfiguration.accessToken,
|
|
6088
|
+
playerID: iframeConfiguration.playerID,
|
|
5977
6089
|
thirdPartyProvider: iframeConfiguration.thirdPartyProvider,
|
|
5978
6090
|
thirdPartyTokenType: iframeConfiguration.thirdPartyTokenType,
|
|
5979
6091
|
encryptionKey: password ?? null,
|
|
@@ -6155,14 +6267,12 @@ class Openfort {
|
|
|
6155
6267
|
* @throws {OpenfortError} If the signer is not an EmbeddedSigner.
|
|
6156
6268
|
*/
|
|
6157
6269
|
getEthereumProvider(options = { announceProvider: true }) {
|
|
6158
|
-
if (
|
|
6270
|
+
if ((this.signer instanceof SessionSigner)) {
|
|
6159
6271
|
throw new OpenfortError('Embedded signer must be configured to get Ethereum provider', OpenfortErrorType.NOT_LOGGED_IN_ERROR);
|
|
6160
6272
|
}
|
|
6161
|
-
const address = this.instanceManager.getAccountAddress();
|
|
6162
6273
|
const provider = new EvmProvider({
|
|
6163
6274
|
openfortEventEmitter: this.openfortEventEmitter,
|
|
6164
6275
|
signer: this.signer,
|
|
6165
|
-
address: address,
|
|
6166
6276
|
instanceManager: this.instanceManager,
|
|
6167
6277
|
backendApiClients: this.backendApiClients,
|
|
6168
6278
|
policyId: options.policy,
|
|
@@ -6723,6 +6833,7 @@ class Openfort {
|
|
|
6723
6833
|
};
|
|
6724
6834
|
const iframeConfiguration = {
|
|
6725
6835
|
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
|
|
6836
|
+
playerID: this.instanceManager.getPlayerID() ?? null,
|
|
6726
6837
|
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
|
|
6727
6838
|
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
|
|
6728
6839
|
chainId: !chainId ? Number(this.instanceManager.getChainID()) ?? null : chainId,
|
|
@@ -6741,6 +6852,7 @@ class Openfort {
|
|
|
6741
6852
|
case SignerType.EMBEDDED: {
|
|
6742
6853
|
const iframeConfiguration = {
|
|
6743
6854
|
accessToken: this.instanceManager.getAccessToken()?.token ?? null,
|
|
6855
|
+
playerID: this.instanceManager.getPlayerID() ?? null,
|
|
6744
6856
|
thirdPartyProvider: this.instanceManager.getAccessToken()?.thirdPartyProvider ?? null,
|
|
6745
6857
|
thirdPartyTokenType: this.instanceManager.getAccessToken()?.thirdPartyTokenType ?? null,
|
|
6746
6858
|
chainId: null,
|
package/package.json
CHANGED