// New creates new Orb client.
New creates new Orb client.
// New creates new Orb client .
func New(namespace string, cas common.CASReader, opts ...Option) (*OrbClient, error) {
	versions := []string{"1.0"}
	registry := clientregistry.New()
	var clientVersions []protocol.Version
	for _, version := range versions {
		cv, err := registry.CreateClientVersion(version, cas, &config.Sidetree{})
		if err != nil {
			return nil, fmt.Errorf("error creating client version [%s]: %w", version, err)
		}
		clientVersions = append(clientVersions, cv)
	}
	nsProvider := nsprovider.New()
	nsProvider.Add(namespace, verprovider.New(clientVersions))
	orbClient := &OrbClient{
		nsProvider: nsProvider,
		casReader:  cas,
	}
	for _, opt := range opts {
		opt(orbClient)
	}
	return orbClient, nil
}
func New ( namespace string , cas common . CASReader , opts ... Option ) ( * OrbClient , error ) { versions := [ ] string { " " } registry := clientregistry . New ( ) var clientVersions [ ] protocol . Version for _ , version := range versions { cv , err := registry . CreateClientVersion ( version , cas , & config . Sidetree { } ) if err != nil { return nil , fmt . Errorf ( " " , version , err ) } clientVersions = append ( clientVersions , cv ) } nsProvider := nsprovider . New ( ) nsProvider . Add ( namespace , verprovider . New ( clientVersions ) ) orbClient := & OrbClient { nsProvider : nsProvider , casReader : cas , } for _ , opt := range opts { opt ( orbClient ) } return orbClient , nil }
New creates new Orb client.
New creates new Orb client .
// apply options